From 2d9b73af6eff3882159e12a552107b349cd8b2ca Mon Sep 17 00:00:00 2001 From: Vincent Langlet Date: Fri, 3 Apr 2020 22:08:26 +0200 Subject: [PATCH 1/5] :wrench: Remove composer.lock --- composer.lock | 2061 ------------------------------------------------- 1 file changed, 2061 deletions(-) delete mode 100644 composer.lock diff --git a/composer.lock b/composer.lock deleted file mode 100644 index c5291d8..0000000 --- a/composer.lock +++ /dev/null @@ -1,2061 +0,0 @@ -{ - "_readme": [ - "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", - "This file is @generated automatically" - ], - "content-hash": "69d470b84515679782c7faf031dcbab0", - "packages": [ - { - "name": "psr/container", - "version": "1.0.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/container.git", - "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f", - "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Container\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://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" - ], - "time": "2017-02-14T16:28:37+00:00" - }, - { - "name": "squizlabs/php_codesniffer", - "version": "3.5.3", - "source": { - "type": "git", - "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "557a1fc7ac702c66b0bbfe16ab3d55839ef724cb" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/557a1fc7ac702c66b0bbfe16ab3d55839ef724cb", - "reference": "557a1fc7ac702c66b0bbfe16ab3d55839ef724cb", - "shasum": "" - }, - "require": { - "ext-simplexml": "*", - "ext-tokenizer": "*", - "ext-xmlwriter": "*", - "php": ">=5.4.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" - }, - "bin": [ - "bin/phpcs", - "bin/phpcbf" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.x-dev" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Greg Sherwood", - "role": "lead" - } - ], - "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", - "homepage": "https://github.com/squizlabs/PHP_CodeSniffer", - "keywords": [ - "phpcs", - "standards" - ], - "time": "2019-12-04T04:46:47+00:00" - }, - { - "name": "symfony/console", - "version": "v5.0.2", - "source": { - "type": "git", - "url": "https://github.com/symfony/console.git", - "reference": "fe6e3cd889ca64172d7a742a2eb058541404ef47" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/fe6e3cd889ca64172d7a742a2eb058541404ef47", - "reference": "fe6e3cd889ca64172d7a742a2eb058541404ef47", - "shasum": "" - }, - "require": { - "php": "^7.2.5", - "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php73": "^1.8", - "symfony/service-contracts": "^1.1|^2" - }, - "conflict": { - "symfony/dependency-injection": "<4.4", - "symfony/event-dispatcher": "<4.4", - "symfony/lock": "<4.4", - "symfony/process": "<4.4" - }, - "provide": { - "psr/log-implementation": "1.0" - }, - "require-dev": { - "psr/log": "~1.0", - "symfony/config": "^4.4|^5.0", - "symfony/dependency-injection": "^4.4|^5.0", - "symfony/event-dispatcher": "^4.4|^5.0", - "symfony/lock": "^4.4|^5.0", - "symfony/process": "^4.4|^5.0", - "symfony/var-dumper": "^4.4|^5.0" - }, - "suggest": { - "psr/log": "For using the console logger", - "symfony/event-dispatcher": "", - "symfony/lock": "", - "symfony/process": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.0-dev" - } - }, - "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": "Symfony Console Component", - "homepage": "https://symfony.com", - "time": "2019-12-17T13:20:22+00:00" - }, - { - "name": "symfony/polyfill-ctype", - "version": "v1.13.1", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "f8f0b461be3385e56d6de3dbb5a0df24c0c275e3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/f8f0b461be3385e56d6de3dbb5a0df24c0c275e3", - "reference": "f8f0b461be3385e56d6de3dbb5a0df24c0c275e3", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "suggest": { - "ext-ctype": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.13-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Ctype\\": "" - }, - "files": [ - "bootstrap.php" - ] - }, - "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" - ], - "time": "2019-11-27T13:56:44+00:00" - }, - { - "name": "symfony/polyfill-mbstring", - "version": "v1.13.1", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "7b4aab9743c30be783b73de055d24a39cf4b954f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/7b4aab9743c30be783b73de055d24a39cf4b954f", - "reference": "7b4aab9743c30be783b73de055d24a39cf4b954f", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "suggest": { - "ext-mbstring": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.13-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" - }, - "files": [ - "bootstrap.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": "Symfony polyfill for the Mbstring extension", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "mbstring", - "polyfill", - "portable", - "shim" - ], - "time": "2019-11-27T14:18:11+00:00" - }, - { - "name": "symfony/polyfill-php73", - "version": "v1.13.1", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "4b0e2222c55a25b4541305a053013d5647d3a25f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/4b0e2222c55a25b4541305a053013d5647d3a25f", - "reference": "4b0e2222c55a25b4541305a053013d5647d3a25f", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.13-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Php73\\": "" - }, - "files": [ - "bootstrap.php" - ], - "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" - ], - "time": "2019-11-27T16:25:15+00:00" - }, - { - "name": "symfony/service-contracts", - "version": "v2.0.1", - "source": { - "type": "git", - "url": "https://github.com/symfony/service-contracts.git", - "reference": "144c5e51266b281231e947b51223ba14acf1a749" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/144c5e51266b281231e947b51223ba14acf1a749", - "reference": "144c5e51266b281231e947b51223ba14acf1a749", - "shasum": "" - }, - "require": { - "php": "^7.2.5", - "psr/container": "^1.0" - }, - "suggest": { - "symfony/service-implementation": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - }, - "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" - ], - "time": "2019-11-18T17:27:11+00:00" - }, - { - "name": "symfony/translation-contracts", - "version": "v2.0.1", - "source": { - "type": "git", - "url": "https://github.com/symfony/translation-contracts.git", - "reference": "8cc682ac458d75557203b2f2f14b0b92e1c744ed" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/8cc682ac458d75557203b2f2f14b0b92e1c744ed", - "reference": "8cc682ac458d75557203b2f2f14b0b92e1c744ed", - "shasum": "" - }, - "require": { - "php": "^7.2.5" - }, - "suggest": { - "symfony/translation-implementation": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - }, - "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" - ], - "time": "2019-11-18T17:27:11+00:00" - }, - { - "name": "symfony/twig-bridge", - "version": "v5.0.2", - "source": { - "type": "git", - "url": "https://github.com/symfony/twig-bridge.git", - "reference": "abbaeee38ff39651e335c55be40752be2ddd0976" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/twig-bridge/zipball/abbaeee38ff39651e335c55be40752be2ddd0976", - "reference": "abbaeee38ff39651e335c55be40752be2ddd0976", - "shasum": "" - }, - "require": { - "php": "^7.2.5", - "symfony/translation-contracts": "^1.1|^2", - "twig/twig": "^2.10|^3.0" - }, - "conflict": { - "symfony/console": "<4.4", - "symfony/form": "<5.0", - "symfony/http-foundation": "<4.4", - "symfony/http-kernel": "<4.4", - "symfony/translation": "<5.0", - "symfony/workflow": "<4.4" - }, - "require-dev": { - "egulias/email-validator": "^2.1.10", - "symfony/asset": "^4.4|^5.0", - "symfony/console": "^4.4|^5.0", - "symfony/dependency-injection": "^4.4|^5.0", - "symfony/expression-language": "^4.4|^5.0", - "symfony/finder": "^4.4|^5.0", - "symfony/form": "^5.0", - "symfony/http-foundation": "^4.4|^5.0", - "symfony/http-kernel": "^4.4|^5.0", - "symfony/mime": "^4.4|^5.0", - "symfony/polyfill-intl-icu": "~1.0", - "symfony/routing": "^4.4|^5.0", - "symfony/security-acl": "^2.8|^3.0", - "symfony/security-core": "^4.4|^5.0", - "symfony/security-csrf": "^4.4|^5.0", - "symfony/security-http": "^4.4|^5.0", - "symfony/stopwatch": "^4.4|^5.0", - "symfony/translation": "^5.0", - "symfony/web-link": "^4.4|^5.0", - "symfony/workflow": "^4.4|^5.0", - "symfony/yaml": "^4.4|^5.0", - "twig/cssinliner-extra": "^2.12", - "twig/inky-extra": "^2.12", - "twig/markdown-extra": "^2.12" - }, - "suggest": { - "symfony/asset": "For using the AssetExtension", - "symfony/expression-language": "For using the ExpressionExtension", - "symfony/finder": "", - "symfony/form": "For using the FormExtension", - "symfony/http-kernel": "For using the HttpKernelExtension", - "symfony/routing": "For using the RoutingExtension", - "symfony/security-core": "For using the SecurityExtension", - "symfony/security-csrf": "For using the CsrfExtension", - "symfony/security-http": "For using the LogoutUrlExtension", - "symfony/stopwatch": "For using the StopwatchExtension", - "symfony/translation": "For using the TranslationExtension", - "symfony/var-dumper": "For using the DumpExtension", - "symfony/web-link": "For using the WebLinkExtension", - "symfony/yaml": "For using the YamlExtension" - }, - "type": "symfony-bridge", - "extra": { - "branch-alias": { - "dev-master": "5.0-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Bridge\\Twig\\": "" - }, - "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": "Symfony Twig Bridge", - "homepage": "https://symfony.com", - "time": "2019-12-18T16:23:52+00:00" - }, - { - "name": "twig/twig", - "version": "v3.0.0", - "source": { - "type": "git", - "url": "https://github.com/twigphp/Twig.git", - "reference": "9b58bb8ac7a41d72fbb5a7dc643e07923e5ccc26" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/9b58bb8ac7a41d72fbb5a7dc643e07923e5ccc26", - "reference": "9b58bb8ac7a41d72fbb5a7dc643e07923e5ccc26", - "shasum": "" - }, - "require": { - "php": "^7.2.9", - "symfony/polyfill-ctype": "^1.8", - "symfony/polyfill-mbstring": "^1.3" - }, - "require-dev": { - "psr/container": "^1.0", - "symfony/debug": "^3.4|^4.2|^5.0", - "symfony/phpunit-bridge": "^4.4@dev|^5.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "autoload": { - "psr-4": { - "Twig\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com", - "homepage": "http://fabien.potencier.org", - "role": "Lead Developer" - }, - { - "name": "Twig Team", - "homepage": "https://twig.symfony.com/contributors", - "role": "Contributors" - }, - { - "name": "Armin Ronacher", - "email": "armin.ronacher@active-4.com", - "role": "Project Founder" - } - ], - "description": "Twig, the flexible, fast, and secure template language for PHP", - "homepage": "https://twig.symfony.com", - "keywords": [ - "templating" - ], - "time": "2019-11-15T20:38:32+00:00" - } - ], - "packages-dev": [ - { - "name": "doctrine/instantiator", - "version": "1.3.0", - "source": { - "type": "git", - "url": "https://github.com/doctrine/instantiator.git", - "reference": "ae466f726242e637cebdd526a7d991b9433bacf1" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/ae466f726242e637cebdd526a7d991b9433bacf1", - "reference": "ae466f726242e637cebdd526a7d991b9433bacf1", - "shasum": "" - }, - "require": { - "php": "^7.1" - }, - "require-dev": { - "doctrine/coding-standard": "^6.0", - "ext-pdo": "*", - "ext-phar": "*", - "phpbench/phpbench": "^0.13", - "phpstan/phpstan-phpunit": "^0.11", - "phpstan/phpstan-shim": "^0.11", - "phpunit/phpunit": "^7.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2.x-dev" - } - }, - "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": "http://ocramius.github.com/" - } - ], - "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" - ], - "time": "2019-10-21T16:45:58+00:00" - }, - { - "name": "myclabs/deep-copy", - "version": "1.9.4", - "source": { - "type": "git", - "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "579bb7356d91f9456ccd505f24ca8b667966a0a7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/579bb7356d91f9456ccd505f24ca8b667966a0a7", - "reference": "579bb7356d91f9456ccd505f24ca8b667966a0a7", - "shasum": "" - }, - "require": { - "php": "^7.1" - }, - "replace": { - "myclabs/deep-copy": "self.version" - }, - "require-dev": { - "doctrine/collections": "^1.0", - "doctrine/common": "^2.6", - "phpunit/phpunit": "^7.1" - }, - "type": "library", - "autoload": { - "psr-4": { - "DeepCopy\\": "src/DeepCopy/" - }, - "files": [ - "src/DeepCopy/deep_copy.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Create deep copies (clones) of your objects", - "keywords": [ - "clone", - "copy", - "duplicate", - "object", - "object graph" - ], - "time": "2019-12-15T19:12:40+00:00" - }, - { - "name": "phar-io/manifest", - "version": "1.0.3", - "source": { - "type": "git", - "url": "https://github.com/phar-io/manifest.git", - "reference": "7761fcacf03b4d4f16e7ccb606d4879ca431fcf4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phar-io/manifest/zipball/7761fcacf03b4d4f16e7ccb606d4879ca431fcf4", - "reference": "7761fcacf03b4d4f16e7ccb606d4879ca431fcf4", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-phar": "*", - "phar-io/version": "^2.0", - "php": "^5.6 || ^7.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.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)", - "time": "2018-07-08T19:23:20+00:00" - }, - { - "name": "phar-io/version", - "version": "2.0.1", - "source": { - "type": "git", - "url": "https://github.com/phar-io/version.git", - "reference": "45a2ec53a73c70ce41d55cedef9063630abaf1b6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phar-io/version/zipball/45a2ec53a73c70ce41d55cedef9063630abaf1b6", - "reference": "45a2ec53a73c70ce41d55cedef9063630abaf1b6", - "shasum": "" - }, - "require": { - "php": "^5.6 || ^7.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", - "time": "2018-07-08T19:19:57+00:00" - }, - { - "name": "phpdocumentor/reflection-common", - "version": "2.0.0", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionCommon.git", - "reference": "63a995caa1ca9e5590304cd845c15ad6d482a62a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/63a995caa1ca9e5590304cd845c15ad6d482a62a", - "reference": "63a995caa1ca9e5590304cd845c15ad6d482a62a", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "require-dev": { - "phpunit/phpunit": "~6" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jaap van Otterdijk", - "email": "opensource@ijaap.nl" - } - ], - "description": "Common reflection classes used by phpdocumentor to reflect the code structure", - "homepage": "http://www.phpdoc.org", - "keywords": [ - "FQSEN", - "phpDocumentor", - "phpdoc", - "reflection", - "static analysis" - ], - "time": "2018-08-07T13:53:10+00:00" - }, - { - "name": "phpdocumentor/reflection-docblock", - "version": "4.3.3", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "2ecaa9fef01634c83bfa8dc1fe35fb5cef223a62" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/2ecaa9fef01634c83bfa8dc1fe35fb5cef223a62", - "reference": "2ecaa9fef01634c83bfa8dc1fe35fb5cef223a62", - "shasum": "" - }, - "require": { - "php": "^7.0", - "phpdocumentor/reflection-common": "^1.0.0 || ^2.0.0", - "phpdocumentor/type-resolver": "~0.4 || ^1.0.0", - "webmozart/assert": "^1.0" - }, - "require-dev": { - "doctrine/instantiator": "^1.0.5", - "mockery/mockery": "^1.0", - "phpunit/phpunit": "^6.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": [ - "src/" - ] - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" - } - ], - "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "time": "2019-12-20T13:40:23+00:00" - }, - { - "name": "phpdocumentor/type-resolver", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "2e32a6d48972b2c1976ed5d8967145b6cec4a4a9" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/2e32a6d48972b2c1976ed5d8967145b6cec4a4a9", - "reference": "2e32a6d48972b2c1976ed5d8967145b6cec4a4a9", - "shasum": "" - }, - "require": { - "php": "^7.1", - "phpdocumentor/reflection-common": "^2.0" - }, - "require-dev": { - "ext-tokenizer": "^7.1", - "mockery/mockery": "~1", - "phpunit/phpunit": "^7.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" - } - ], - "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", - "time": "2019-08-22T18:11:29+00:00" - }, - { - "name": "phpspec/prophecy", - "version": "1.10.1", - "source": { - "type": "git", - "url": "https://github.com/phpspec/prophecy.git", - "reference": "cbe1df668b3fe136bcc909126a0f529a78d4cbbc" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/cbe1df668b3fe136bcc909126a0f529a78d4cbbc", - "reference": "cbe1df668b3fe136bcc909126a0f529a78d4cbbc", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.0.2", - "php": "^5.3|^7.0", - "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0|^5.0", - "sebastian/comparator": "^1.2.3|^2.0|^3.0", - "sebastian/recursion-context": "^1.0|^2.0|^3.0" - }, - "require-dev": { - "phpspec/phpspec": "^2.5 || ^3.2", - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.10.x-dev" - } - }, - "autoload": { - "psr-4": { - "Prophecy\\": "src/Prophecy" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - }, - { - "name": "Marcello Duarte", - "email": "marcello.duarte@gmail.com" - } - ], - "description": "Highly opinionated mocking framework for PHP 5.3+", - "homepage": "https://github.com/phpspec/prophecy", - "keywords": [ - "Double", - "Dummy", - "fake", - "mock", - "spy", - "stub" - ], - "time": "2019-12-22T21:05:45+00:00" - }, - { - "name": "phpunit/php-code-coverage", - "version": "6.1.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "807e6013b00af69b6c5d9ceb4282d0393dbb9d8d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/807e6013b00af69b6c5d9ceb4282d0393dbb9d8d", - "reference": "807e6013b00af69b6c5d9ceb4282d0393dbb9d8d", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-xmlwriter": "*", - "php": "^7.1", - "phpunit/php-file-iterator": "^2.0", - "phpunit/php-text-template": "^1.2.1", - "phpunit/php-token-stream": "^3.0", - "sebastian/code-unit-reverse-lookup": "^1.0.1", - "sebastian/environment": "^3.1 || ^4.0", - "sebastian/version": "^2.0.1", - "theseer/tokenizer": "^1.1" - }, - "require-dev": { - "phpunit/phpunit": "^7.0" - }, - "suggest": { - "ext-xdebug": "^2.6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "6.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": "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" - ], - "time": "2018-10-31T16:06:48+00:00" - }, - { - "name": "phpunit/php-file-iterator", - "version": "2.0.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "050bedf145a257b1ff02746c31894800e5122946" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/050bedf145a257b1ff02746c31894800e5122946", - "reference": "050bedf145a257b1ff02746c31894800e5122946", - "shasum": "" - }, - "require": { - "php": "^7.1" - }, - "require-dev": { - "phpunit/phpunit": "^7.1" - }, - "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": "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" - ], - "time": "2018-09-13T20:33:42+00:00" - }, - { - "name": "phpunit/php-text-template", - "version": "1.2.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "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" - ], - "time": "2015-06-21T13:50:34+00:00" - }, - { - "name": "phpunit/php-timer", - "version": "2.1.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "1038454804406b0b5f5f520358e78c1c2f71501e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/1038454804406b0b5f5f520358e78c1c2f71501e", - "reference": "1038454804406b0b5f5f520358e78c1c2f71501e", - "shasum": "" - }, - "require": { - "php": "^7.1" - }, - "require-dev": { - "phpunit/phpunit": "^7.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.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": "Utility class for timing", - "homepage": "https://github.com/sebastianbergmann/php-timer/", - "keywords": [ - "timer" - ], - "time": "2019-06-07T04:22:29+00:00" - }, - { - "name": "phpunit/php-token-stream", - "version": "3.1.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "995192df77f63a59e47f025390d2d1fdf8f425ff" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/995192df77f63a59e47f025390d2d1fdf8f425ff", - "reference": "995192df77f63a59e47f025390d2d1fdf8f425ff", - "shasum": "" - }, - "require": { - "ext-tokenizer": "*", - "php": "^7.1" - }, - "require-dev": { - "phpunit/phpunit": "^7.0" - }, - "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" - } - ], - "description": "Wrapper around PHP's tokenizer extension.", - "homepage": "https://github.com/sebastianbergmann/php-token-stream/", - "keywords": [ - "tokenizer" - ], - "time": "2019-09-17T06:23:10+00:00" - }, - { - "name": "phpunit/phpunit", - "version": "7.5.18", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "fcf6c4bfafaadc07785528b06385cce88935474d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/fcf6c4bfafaadc07785528b06385cce88935474d", - "reference": "fcf6c4bfafaadc07785528b06385cce88935474d", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.1", - "ext-dom": "*", - "ext-json": "*", - "ext-libxml": "*", - "ext-mbstring": "*", - "ext-xml": "*", - "myclabs/deep-copy": "^1.7", - "phar-io/manifest": "^1.0.2", - "phar-io/version": "^2.0", - "php": "^7.1", - "phpspec/prophecy": "^1.7", - "phpunit/php-code-coverage": "^6.0.7", - "phpunit/php-file-iterator": "^2.0.1", - "phpunit/php-text-template": "^1.2.1", - "phpunit/php-timer": "^2.1", - "sebastian/comparator": "^3.0", - "sebastian/diff": "^3.0", - "sebastian/environment": "^4.0", - "sebastian/exporter": "^3.1", - "sebastian/global-state": "^2.0", - "sebastian/object-enumerator": "^3.0.3", - "sebastian/resource-operations": "^2.0", - "sebastian/version": "^2.0.1" - }, - "conflict": { - "phpunit/phpunit-mock-objects": "*" - }, - "require-dev": { - "ext-pdo": "*" - }, - "suggest": { - "ext-soap": "*", - "ext-xdebug": "*", - "phpunit/php-invoker": "^2.0" - }, - "bin": [ - "phpunit" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "7.5-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": "The PHP Unit Testing framework.", - "homepage": "https://phpunit.de/", - "keywords": [ - "phpunit", - "testing", - "xunit" - ], - "time": "2019-12-06T05:14:37+00:00" - }, - { - "name": "sebastian/code-unit-reverse-lookup", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", - "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", - "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", - "shasum": "" - }, - "require": { - "php": "^5.6 || ^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^5.7 || ^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-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/", - "time": "2017-03-04T06:30:41+00:00" - }, - { - "name": "sebastian/comparator", - "version": "3.0.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "5de4fc177adf9bce8df98d8d141a7559d7ccf6da" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/5de4fc177adf9bce8df98d8d141a7559d7ccf6da", - "reference": "5de4fc177adf9bce8df98d8d141a7559d7ccf6da", - "shasum": "" - }, - "require": { - "php": "^7.1", - "sebastian/diff": "^3.0", - "sebastian/exporter": "^3.1" - }, - "require-dev": { - "phpunit/phpunit": "^7.1" - }, - "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": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides the functionality to compare PHP values for equality", - "homepage": "https://github.com/sebastianbergmann/comparator", - "keywords": [ - "comparator", - "compare", - "equality" - ], - "time": "2018-07-12T15:12:46+00:00" - }, - { - "name": "sebastian/diff", - "version": "3.0.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "720fcc7e9b5cf384ea68d9d930d480907a0c1a29" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/720fcc7e9b5cf384ea68d9d930d480907a0c1a29", - "reference": "720fcc7e9b5cf384ea68d9d930d480907a0c1a29", - "shasum": "" - }, - "require": { - "php": "^7.1" - }, - "require-dev": { - "phpunit/phpunit": "^7.5 || ^8.0", - "symfony/process": "^2 || ^3.3 || ^4" - }, - "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": "Kore Nordmann", - "email": "mail@kore-nordmann.de" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Diff implementation", - "homepage": "https://github.com/sebastianbergmann/diff", - "keywords": [ - "diff", - "udiff", - "unidiff", - "unified diff" - ], - "time": "2019-02-04T06:01:07+00:00" - }, - { - "name": "sebastian/environment", - "version": "4.2.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "464c90d7bdf5ad4e8a6aea15c091fec0603d4368" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/464c90d7bdf5ad4e8a6aea15c091fec0603d4368", - "reference": "464c90d7bdf5ad4e8a6aea15c091fec0603d4368", - "shasum": "" - }, - "require": { - "php": "^7.1" - }, - "require-dev": { - "phpunit/phpunit": "^7.5" - }, - "suggest": { - "ext-posix": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.2-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" - ], - "time": "2019-11-20T08:46:58+00:00" - }, - { - "name": "sebastian/exporter", - "version": "3.1.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "68609e1261d215ea5b21b7987539cbfbe156ec3e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/68609e1261d215ea5b21b7987539cbfbe156ec3e", - "reference": "68609e1261d215ea5b21b7987539cbfbe156ec3e", - "shasum": "" - }, - "require": { - "php": "^7.0", - "sebastian/recursion-context": "^3.0" - }, - "require-dev": { - "ext-mbstring": "*", - "phpunit/phpunit": "^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.1.x-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": "http://www.github.com/sebastianbergmann/exporter", - "keywords": [ - "export", - "exporter" - ], - "time": "2019-09-14T09:02:43+00:00" - }, - { - "name": "sebastian/global-state", - "version": "2.0.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", - "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", - "shasum": "" - }, - "require": { - "php": "^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.0" - }, - "suggest": { - "ext-uopz": "*" - }, - "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": "Snapshotting of global state", - "homepage": "http://www.github.com/sebastianbergmann/global-state", - "keywords": [ - "global state" - ], - "time": "2017-04-27T15:39:26+00:00" - }, - { - "name": "sebastian/object-enumerator", - "version": "3.0.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/7cfd9e65d11ffb5af41198476395774d4c8a84c5", - "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5", - "shasum": "" - }, - "require": { - "php": "^7.0", - "sebastian/object-reflector": "^1.1.1", - "sebastian/recursion-context": "^3.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0.x-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/", - "time": "2017-08-03T12:35:26+00:00" - }, - { - "name": "sebastian/object-reflector", - "version": "1.1.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/object-reflector.git", - "reference": "773f97c67f28de00d397be301821b06708fca0be" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/773f97c67f28de00d397be301821b06708fca0be", - "reference": "773f97c67f28de00d397be301821b06708fca0be", - "shasum": "" - }, - "require": { - "php": "^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1-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/", - "time": "2017-03-29T09:07:27+00:00" - }, - { - "name": "sebastian/recursion-context", - "version": "3.0.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", - "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", - "shasum": "" - }, - "require": { - "php": "^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net" - } - ], - "description": "Provides functionality to recursively process PHP variables", - "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2017-03-03T06:23:57+00:00" - }, - { - "name": "sebastian/resource-operations", - "version": "2.0.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/resource-operations.git", - "reference": "4d7a795d35b889bf80a0cc04e08d77cedfa917a9" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/4d7a795d35b889bf80a0cc04e08d77cedfa917a9", - "reference": "4d7a795d35b889bf80a0cc04e08d77cedfa917a9", - "shasum": "" - }, - "require": { - "php": "^7.1" - }, - "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": "Provides a list of PHP built-in functions that operate on resources", - "homepage": "https://www.github.com/sebastianbergmann/resource-operations", - "time": "2018-10-04T04:07:39+00:00" - }, - { - "name": "sebastian/version", - "version": "2.0.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/version.git", - "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019", - "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019", - "shasum": "" - }, - "require": { - "php": ">=5.6" - }, - "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": "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", - "time": "2016-10-03T07:35:21+00:00" - }, - { - "name": "theseer/tokenizer", - "version": "1.1.3", - "source": { - "type": "git", - "url": "https://github.com/theseer/tokenizer.git", - "reference": "11336f6f84e16a720dae9d8e6ed5019efa85a0f9" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/theseer/tokenizer/zipball/11336f6f84e16a720dae9d8e6ed5019efa85a0f9", - "reference": "11336f6f84e16a720dae9d8e6ed5019efa85a0f9", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-tokenizer": "*", - "ext-xmlwriter": "*", - "php": "^7.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", - "time": "2019-06-13T22:48:21+00:00" - }, - { - "name": "webmozart/assert", - "version": "1.6.0", - "source": { - "type": "git", - "url": "https://github.com/webmozart/assert.git", - "reference": "573381c0a64f155a0d9a23f4b0c797194805b925" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/webmozart/assert/zipball/573381c0a64f155a0d9a23f4b0c797194805b925", - "reference": "573381c0a64f155a0d9a23f4b0c797194805b925", - "shasum": "" - }, - "require": { - "php": "^5.3.3 || ^7.0", - "symfony/polyfill-ctype": "^1.8" - }, - "conflict": { - "vimeo/psalm": "<3.6.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.8.36 || ^7.5.13" - }, - "type": "library", - "autoload": { - "psr-4": { - "Webmozart\\Assert\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" - } - ], - "description": "Assertions to validate method input/output with nice error messages.", - "keywords": [ - "assert", - "check", - "validate" - ], - "time": "2019-11-24T13:36:37+00:00" - } - ], - "aliases": [], - "minimum-stability": "stable", - "stability-flags": [], - "prefer-stable": false, - "prefer-lowest": false, - "platform": { - "php": ">=7.2" - }, - "platform-dev": [] -} From d71b89b2dfc161e252276504a998c94cfb526327 Mon Sep 17 00:00:00 2001 From: Vincent Langlet Date: Fri, 3 Apr 2020 22:08:58 +0200 Subject: [PATCH 2/5] :wrench: Add composer.lock to .gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 6ea25b2..ea4fb47 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .idea/ +composer.lock composer.phar coverage/ vendor/ From 82360b0bedb389afd345bb14d5f02c78b0982b8e Mon Sep 17 00:00:00 2001 From: Vincent Langlet Date: Fri, 3 Apr 2020 23:11:20 +0200 Subject: [PATCH 3/5] :sparkles: Function comment improvements --- SymfonyCustom/Helpers/SniffHelper.php | 80 ++++++++++ .../Commenting/FunctionCommentSniff.php | 16 ++ .../Commenting/VariableCommentSniff.php | 15 +- .../NamingConventions/ValidTypeHintSniff.php | 87 +---------- .../Commenting/FunctionCommentUnitTest.inc | 17 ++ .../FunctionCommentUnitTest.inc.fixed | 146 ++++++++++++++++++ .../Commenting/FunctionCommentUnitTest.php | 2 + composer.json | 11 +- 8 files changed, 285 insertions(+), 89 deletions(-) create mode 100644 SymfonyCustom/Tests/Commenting/FunctionCommentUnitTest.inc.fixed diff --git a/SymfonyCustom/Helpers/SniffHelper.php b/SymfonyCustom/Helpers/SniffHelper.php index 6caaa02..ee5e305 100644 --- a/SymfonyCustom/Helpers/SniffHelper.php +++ b/SymfonyCustom/Helpers/SniffHelper.php @@ -56,6 +56,70 @@ class SniffHelper extends AbstractHelper '@var', ]; + /** + * is any non-array, non-generic, non-alternated type, eg `int` or `\Foo` + * is array of , eg `int[]` or `\Foo[]` + * is generic collection type, like `array`, `Collection` or more complex` + * is array key => value type, like `array{type: string, name: string, value: mixed}` + * is , , , type + * is one or more types alternated via `|`, like `int|bool[]|Collection` + */ + public const REGEX_TYPES = ' + (? + (? + (? + (?¬Array)(?: + \s*\[\s*\] + )+ + ) + | + (? + (? + \(\s*(? + (?&types) + )\s*\) + ) + | + (? + (? + (?&simple) + ) + \s*<\s* + (? + (?:(?&types)\s*,\s*)* + (?&types) + ) + \s*> + ) + | + (? + array\s*{\s* + (? + (?: + (? + (?:\w+\s*\??:\s*)? + (?&types) + ) + \s*,\s* + )* + (?&objectKeyValue) + ) + \s*} + ) + | + (? + \\\\?\w+(?:\\\\\w+)* + | + \$this + ) + ) + ) + (?: + \s*[\|&]\s*(?&type) + )* + ) + '; + /** * @param File $phpcsFile * @param int $stackPtr @@ -122,4 +186,20 @@ public static function isGlobalUse(File $phpcsFile, int $stackPtr): bool return true; } + + /** + * @param string $content + * + * @return array + */ + public static function parseTypeHint(string $content): array + { + preg_match( + '{^'.SniffHelper::REGEX_TYPES.'(?[\s\t]*)?(?.*)?$}six', + $content, + $matches + ); + + return [$matches['types'] ?? '', $matches['space'] ?? '', $matches['description'] ?? '']; + } } diff --git a/SymfonyCustom/Sniffs/Commenting/FunctionCommentSniff.php b/SymfonyCustom/Sniffs/Commenting/FunctionCommentSniff.php index 03f58c6..b1eaf8a 100644 --- a/SymfonyCustom/Sniffs/Commenting/FunctionCommentSniff.php +++ b/SymfonyCustom/Sniffs/Commenting/FunctionCommentSniff.php @@ -7,6 +7,7 @@ use PHP_CodeSniffer\Files\File; use PHP_CodeSniffer\Standards\PEAR\Sniffs\Commenting\FunctionCommentSniff as PEARFunctionCommentSniff; use PHP_CodeSniffer\Util\Tokens; +use SymfonyCustom\Helpers\SniffHelper; /** * SymfonyCustom standard customization to PEARs FunctionCommentSniff. @@ -144,6 +145,21 @@ protected function processReturn(File $phpcsFile, $stackPtr, $commentStart, $has $error = 'Return type missing for @return tag in function comment'; $phpcsFile->addError($error, $return, 'MissingReturnType'); } + + [$type, $space, $description] = SniffHelper::parseTypeHint($content); + if (preg_match('/^\$\S+/', $description)) { + $error = '@return annotations should not contain variable name'; + $fix = $phpcsFile->addFixableError($error, $return, 'NamedReturn'); + + if ($fix) { + $description = preg_replace('/^\$\S+/', '', $description); + if ('' !== $description) { + $phpcsFile->fixer->replaceToken($return + 2, $type.$space.$description); + } else { + $phpcsFile->fixer->replaceToken($return + 2, $type); + } + } + } } else { $error = 'Missing @return tag in function comment'; $phpcsFile->addError($error, $tokens[$commentStart]['comment_closer'], 'MissingReturn'); diff --git a/SymfonyCustom/Sniffs/Commenting/VariableCommentSniff.php b/SymfonyCustom/Sniffs/Commenting/VariableCommentSniff.php index 036b2d6..f1a82a9 100644 --- a/SymfonyCustom/Sniffs/Commenting/VariableCommentSniff.php +++ b/SymfonyCustom/Sniffs/Commenting/VariableCommentSniff.php @@ -6,6 +6,7 @@ use PHP_CodeSniffer\Files\File; use PHP_CodeSniffer\Sniffs\AbstractVariableSniff; +use SymfonyCustom\Helpers\SniffHelper; /** * Parses and verifies the variable doc comment. @@ -97,11 +98,8 @@ public function processMemberVar(File $phpcsFile, $stackPtr): void return; } - $content = explode(' ', $tokens[$string]['content']); - $newContent = array_filter($content, function ($value) use ($tokens, $stackPtr) { - return 0 === preg_match('/^\$/', $value); - }); - if (count($newContent) < count($content)) { + [$type, $space, $description] = SniffHelper::parseTypeHint($tokens[$string]['content']); + if (preg_match('/^\$\S+/', $description)) { $fix = $phpcsFile->addFixableError( '@var annotations should not contain variable name', $foundVar, @@ -109,7 +107,12 @@ public function processMemberVar(File $phpcsFile, $stackPtr): void ); if ($fix) { - $phpcsFile->fixer->replaceToken($string, implode(' ', $newContent)); + $description = preg_replace('/^\$\S+/', '', $description); + if ('' !== $description) { + $phpcsFile->fixer->replaceToken($string, $type.$space.$description); + } else { + $phpcsFile->fixer->replaceToken($string, $type); + } } } } diff --git a/SymfonyCustom/Sniffs/NamingConventions/ValidTypeHintSniff.php b/SymfonyCustom/Sniffs/NamingConventions/ValidTypeHintSniff.php index 0a4c11d..74e83a9 100644 --- a/SymfonyCustom/Sniffs/NamingConventions/ValidTypeHintSniff.php +++ b/SymfonyCustom/Sniffs/NamingConventions/ValidTypeHintSniff.php @@ -14,70 +14,6 @@ */ class ValidTypeHintSniff implements Sniff { - /** - * is any non-array, non-generic, non-alternated type, eg `int` or `\Foo` - * is array of , eg `int[]` or `\Foo[]` - * is generic collection type, like `array`, `Collection` or more complex` - * is array key => value type, like `array{type: string, name: string, value: mixed}` - * is , , , type - * is one or more types alternated via `|`, like `int|bool[]|Collection` - */ - private const REGEX_TYPES = ' - (? - (? - (? - (?¬Array)(?: - \s*\[\s*\] - )+ - ) - | - (? - (? - \(\s*(? - (?&types) - )\s*\) - ) - | - (? - (? - (?&simple) - ) - \s*<\s* - (? - (?:(?&types)\s*,\s*)* - (?&types) - ) - \s*> - ) - | - (? - array\s*{\s* - (? - (?: - (? - (?:\w+\s*\??:\s*)? - (?&types) - ) - \s*,\s* - )* - (?&objectKeyValue) - ) - \s*} - ) - | - (? - \\\\?\w+(?:\\\\\w+)* - | - \$this - ) - ) - ) - (?: - \s*[\|&]\s*(?&type) - )* - ) - '; - /** * False if the type is not a reserved keyword and the check can't be case insensitive **/ @@ -132,17 +68,10 @@ public function process(File $phpcsFile, $stackPtr): void return; } - $matchingResult = preg_match( - '{^'.self::REGEX_TYPES.'(?:[\s\t].*)?$}six', - $tokens[$stackPtr + 2]['content'], - $matches - ); - - $content = 1 === $matchingResult ? $matches['types'] : ''; - $endOfContent = substr($tokens[$stackPtr + 2]['content'], strlen($content)); + [$type, $space, $description] = SniffHelper::parseTypeHint($tokens[$stackPtr + 2]['content']); try { - $suggestedType = $this->getValidTypes($content); + $suggestedType = $this->getValidTypes($type); } catch (DeepExitException $exception) { $phpcsFile->addError( $exception->getMessage(), @@ -153,16 +82,16 @@ public function process(File $phpcsFile, $stackPtr): void return; } - if ($content !== $suggestedType) { + if ($type !== $suggestedType) { $fix = $phpcsFile->addFixableError( 'For type-hinting in PHPDocs, use %s instead of %s', $stackPtr + 2, 'Invalid', - [$suggestedType, $content] + [$suggestedType, $type] ); if ($fix) { - $phpcsFile->fixer->replaceToken($stackPtr + 2, $suggestedType.$endOfContent); + $phpcsFile->fixer->replaceToken($stackPtr + 2, $suggestedType.$space.$description); } } } @@ -181,7 +110,7 @@ private function getValidTypes(string $content): string $types = []; $separators = []; while ('' !== $content && false !== $content) { - preg_match('{^'.self::REGEX_TYPES.'$}ix', $content, $matches); + preg_match('{^'.SniffHelper::REGEX_TYPES.'$}ix', $content, $matches); if (isset($matches['array']) && '' !== $matches['array']) { $validType = $this->getValidTypes(substr($matches['array'], 0, -2)).'[]'; @@ -253,7 +182,7 @@ private function getValidGenericType(string $genericName, string $genericContent $validType = $this->getValidType($genericName).'<'; while ('' !== $genericContent && false !== $genericContent) { - preg_match('{^'.self::REGEX_TYPES.',?}ix', $genericContent, $matches); + preg_match('{^'.SniffHelper::REGEX_TYPES.',?}ix', $genericContent, $matches); $validType .= $this->getValidTypes($matches['types']).', '; $genericContent = substr($genericContent, strlen($matches['types']) + 1); @@ -281,7 +210,7 @@ private function getValidObjectType(string $objectContent): string $objectContent = $split[2]; } - preg_match('{^'.self::REGEX_TYPES.',?}ix', $objectContent, $matches); + preg_match('{^'.SniffHelper::REGEX_TYPES.',?}ix', $objectContent, $matches); $validType .= $this->getValidTypes($matches['types']).', '; $objectContent = substr($objectContent, strlen($matches['types']) + 1); diff --git a/SymfonyCustom/Tests/Commenting/FunctionCommentUnitTest.inc b/SymfonyCustom/Tests/Commenting/FunctionCommentUnitTest.inc index 40f5eb8..91dd593 100644 --- a/SymfonyCustom/Tests/Commenting/FunctionCommentUnitTest.inc +++ b/SymfonyCustom/Tests/Commenting/FunctionCommentUnitTest.inc @@ -127,3 +127,20 @@ function throwTest3() { throw new Exception(); } + +/** + * @return int + * @return int + */ +function multiReturn() +{ + return 1; +} + +/** + * @return int $foo + */ +function returnWithVariable() +{ + return 1; +} diff --git a/SymfonyCustom/Tests/Commenting/FunctionCommentUnitTest.inc.fixed b/SymfonyCustom/Tests/Commenting/FunctionCommentUnitTest.inc.fixed new file mode 100644 index 0000000..db581b3 --- /dev/null +++ b/SymfonyCustom/Tests/Commenting/FunctionCommentUnitTest.inc.fixed @@ -0,0 +1,146 @@ + 1, 95 => 1, 124 => 1, + 133 => 1, + 141 => 1, ]; } diff --git a/composer.json b/composer.json index 62e0ba4..7c8adbd 100644 --- a/composer.json +++ b/composer.json @@ -18,14 +18,17 @@ "bin": ["bin/twigcs"], "require": { "php": ">=7.2", - "squizlabs/php_codesniffer": "3.5.*", - "symfony/console": "^3.4 || ^4.3 || ^5.0", - "symfony/twig-bridge": "^3.4 || ^4.3 || ^5.0", - "twig/twig": "^2.7 || ^3.0" + "squizlabs/php_codesniffer": "^3.5", + "symfony/console": "^4.4 || ^5.0", + "symfony/twig-bridge": "^4.4 || ^5.0", + "twig/twig": "^2.12 || ^3.0" }, "require-dev": { "phpunit/phpunit": "^7.0" }, + "config": { + "sort-packages": true + }, "autoload": { "psr-4": { "TwigCS\\": "TwigCS/src/" From e08aca0ea93c262ceb5ced0c5e62ac0df240cfcb Mon Sep 17 00:00:00 2001 From: Vincent Langlet Date: Fri, 3 Apr 2020 23:29:26 +0200 Subject: [PATCH 4/5] :sparkles: Property declaration improvement --- .../Classes/PropertyDeclarationSniff.php | 22 ++++++++---- .../Classes/PropertyDeclarationUnitTest.inc | 36 +++++++++++++++++++ .../Classes/PropertyDeclarationUnitTest.php | 3 +- 3 files changed, 54 insertions(+), 7 deletions(-) diff --git a/SymfonyCustom/Sniffs/Classes/PropertyDeclarationSniff.php b/SymfonyCustom/Sniffs/Classes/PropertyDeclarationSniff.php index 0e13a14..ec73aa3 100644 --- a/SymfonyCustom/Sniffs/Classes/PropertyDeclarationSniff.php +++ b/SymfonyCustom/Sniffs/Classes/PropertyDeclarationSniff.php @@ -17,7 +17,7 @@ class PropertyDeclarationSniff implements Sniff */ public function register(): array { - return [T_CLASS]; + return [T_CLASS, T_ANON_CLASS]; } /** @@ -35,16 +35,26 @@ public function process(File $phpcsFile, $stackPtr): void $end = $tokens[$stackPtr]['scope_closer']; } - $scope = $phpcsFile->findNext(T_FUNCTION, $stackPtr, $end); + $function = $phpcsFile->findNext(T_FUNCTION, $stackPtr, $end); + if (false === $function) { + return; + } - $wantedTokens = [T_PUBLIC, T_PROTECTED, T_PRIVATE]; + $wantedTokens = [T_PUBLIC, T_PROTECTED, T_PRIVATE, T_ANON_CLASS]; + $scope = $phpcsFile->findNext($wantedTokens, $function + 1, $end); - while ($scope) { - $scope = $phpcsFile->findNext($wantedTokens, $scope + 1, $end); + while (false !== $scope) { + if (T_ANON_CLASS === $tokens[$scope]['code']) { + $scope = $tokens[$scope]['scope_closer']; + + continue; + } - if ($scope && T_VARIABLE === $tokens[$scope + 2]['code']) { + if (T_VARIABLE === $tokens[$scope + 2]['code']) { $phpcsFile->addError('Declare class properties before methods', $scope, 'Invalid'); } + + $scope = $phpcsFile->findNext($wantedTokens, $scope + 1, $end); } } } diff --git a/SymfonyCustom/Tests/Classes/PropertyDeclarationUnitTest.inc b/SymfonyCustom/Tests/Classes/PropertyDeclarationUnitTest.inc index 1b85d7a..98ba823 100644 --- a/SymfonyCustom/Tests/Classes/PropertyDeclarationUnitTest.inc +++ b/SymfonyCustom/Tests/Classes/PropertyDeclarationUnitTest.inc @@ -8,3 +8,39 @@ class ClassTest private $property; } + +class Bar +{ + public function doStuff() + { + $var1 = 'foo'; + $var2 = 'bar'; + + $anonClass = new class($var1, $var2) + { + private $property; + + public function thisIsAfterTheProperty() + { + } + }; + } +} + +class MoreBar +{ + public function doStuff() + { + $var1 = 'foo'; + $var2 = 'bar'; + + $anonClass = new class($var1, $var2) + { + public function thisShouldBeAfterTheProperty() + { + } + + private $property; + }; + } +} diff --git a/SymfonyCustom/Tests/Classes/PropertyDeclarationUnitTest.php b/SymfonyCustom/Tests/Classes/PropertyDeclarationUnitTest.php index dcd14e1..73ab9d3 100644 --- a/SymfonyCustom/Tests/Classes/PropertyDeclarationUnitTest.php +++ b/SymfonyCustom/Tests/Classes/PropertyDeclarationUnitTest.php @@ -17,7 +17,8 @@ class PropertyDeclarationUnitTest extends AbstractSniffUnitTest protected function getErrorList(): array { return [ - 9 => 1, + 9 => 1, + 43 => 1, ]; } From 187cc11c2a2e2cc904e4f4a62ff91ee5fae73674 Mon Sep 17 00:00:00 2001 From: Vincent Langlet Date: Sat, 4 Apr 2020 00:11:46 +0200 Subject: [PATCH 5/5] :sparkles: Declare const before property --- .../Classes/PropertyDeclarationSniff.php | 73 +++++++++++++++++-- .../Classes/PropertyDeclarationUnitTest.inc | 16 ++++ .../Classes/PropertyDeclarationUnitTest.php | 2 + 3 files changed, 83 insertions(+), 8 deletions(-) diff --git a/SymfonyCustom/Sniffs/Classes/PropertyDeclarationSniff.php b/SymfonyCustom/Sniffs/Classes/PropertyDeclarationSniff.php index ec73aa3..712a7f8 100644 --- a/SymfonyCustom/Sniffs/Classes/PropertyDeclarationSniff.php +++ b/SymfonyCustom/Sniffs/Classes/PropertyDeclarationSniff.php @@ -28,19 +28,27 @@ public function register(): array */ public function process(File $phpcsFile, $stackPtr): void { - $tokens = $phpcsFile->getTokens(); + $this->processProperty($phpcsFile, $stackPtr); + $this->processFunction($phpcsFile, $stackPtr); + } - $end = null; - if (isset($tokens[$stackPtr]['scope_closer'])) { - $end = $tokens[$stackPtr]['scope_closer']; - } + /** + * @param File $phpcsFile + * @param int $stackPtr + * + * @return void + */ + private function processFunction(File $phpcsFile, int $stackPtr): void + { + $tokens = $phpcsFile->getTokens(); + $end = $tokens[$stackPtr]['scope_closer'] ?? null; $function = $phpcsFile->findNext(T_FUNCTION, $stackPtr, $end); if (false === $function) { return; } - $wantedTokens = [T_PUBLIC, T_PROTECTED, T_PRIVATE, T_ANON_CLASS]; + $wantedTokens = [T_CONST, T_PUBLIC, T_PROTECTED, T_PRIVATE, T_ANON_CLASS]; $scope = $phpcsFile->findNext($wantedTokens, $function + 1, $end); while (false !== $scope) { @@ -50,8 +58,57 @@ public function process(File $phpcsFile, $stackPtr): void continue; } - if (T_VARIABLE === $tokens[$scope + 2]['code']) { - $phpcsFile->addError('Declare class properties before methods', $scope, 'Invalid'); + if (T_CONST === $tokens[$scope]['code']) { + $phpcsFile->addError('Declare class constants before methods', $scope, 'ConstBeforeFunction'); + } elseif (T_VARIABLE === $tokens[$scope + 2]['code']) { + $phpcsFile->addError('Declare class properties before methods', $scope, 'PropertyBeforeFunction'); + } + + $scope = $phpcsFile->findNext($wantedTokens, $scope + 1, $end); + } + } + + /** + * @param File $phpcsFile + * @param int $stackPtr + * + * @return void + */ + private function processProperty(File $phpcsFile, int $stackPtr): void + { + $tokens = $phpcsFile->getTokens(); + $end = $tokens[$stackPtr]['scope_closer'] ?? null; + + $wantedTokens = [T_PUBLIC, T_PROTECTED, T_PRIVATE, T_ANON_CLASS]; + $scope = $phpcsFile->findNext($wantedTokens, $stackPtr + 1, $end); + + while (false !== $scope && T_VARIABLE !== $tokens[$scope + 2]['code']) { + if (T_ANON_CLASS === $tokens[$scope]['code']) { + $scope = $tokens[$scope]['scope_closer']; + + continue; + } + + $scope = $phpcsFile->findNext($wantedTokens, $scope + 1, $end); + } + + if (false === $scope) { + return; + } + $property = $scope + 2; + + $wantedTokens = [T_CONST, T_ANON_CLASS]; + $scope = $phpcsFile->findNext($wantedTokens, $property + 1, $end); + + while (false !== $scope) { + if (T_ANON_CLASS === $tokens[$scope]['code']) { + $scope = $tokens[$scope]['scope_closer']; + + continue; + } + + if (T_CONST === $tokens[$scope]['code']) { + $phpcsFile->addError('Declare class property before const', $scope, 'ConstBeforeProperty'); } $scope = $phpcsFile->findNext($wantedTokens, $scope + 1, $end); diff --git a/SymfonyCustom/Tests/Classes/PropertyDeclarationUnitTest.inc b/SymfonyCustom/Tests/Classes/PropertyDeclarationUnitTest.inc index 98ba823..b52860e 100644 --- a/SymfonyCustom/Tests/Classes/PropertyDeclarationUnitTest.inc +++ b/SymfonyCustom/Tests/Classes/PropertyDeclarationUnitTest.inc @@ -44,3 +44,19 @@ class MoreBar }; } } + +class BarWithConst +{ + public function functionTest() { + + } + + const FOO = 1; +} + +class BarWithConst2 +{ + public $foo; + + const FOO = 1; +} diff --git a/SymfonyCustom/Tests/Classes/PropertyDeclarationUnitTest.php b/SymfonyCustom/Tests/Classes/PropertyDeclarationUnitTest.php index 73ab9d3..f19ca92 100644 --- a/SymfonyCustom/Tests/Classes/PropertyDeclarationUnitTest.php +++ b/SymfonyCustom/Tests/Classes/PropertyDeclarationUnitTest.php @@ -19,6 +19,8 @@ protected function getErrorList(): array return [ 9 => 1, 43 => 1, + 54 => 1, + 61 => 1, ]; }