diff --git a/composer.json b/composer.json index 951fc70..ac1cbc4 100644 --- a/composer.json +++ b/composer.json @@ -14,16 +14,16 @@ } ], "require-dev": { - "phpspec/phpspec": "^3.4", - "henrikbjorn/phpspec-code-coverage": "^3.0", - "squizlabs/php_codesniffer": "^3.4", - "phpmd/phpmd" : "^2.0", - "ciaranmcnulty/phpspec-typehintedmethods": "^2.0", - "phpunit/phpunit": "^5.7", - "symfony/console": "^2.7" + "phpspec/phpspec": "^7.0", + "friends-of-phpspec/phpspec-code-coverage": "^6.1", + "squizlabs/php_codesniffer": "^3.5", + "phpmd/phpmd" : "^2.8", + "phpunit/phpunit": "^9.5", + "symfony/console": "^5.0", + "vimeo/psalm": "^4.0" }, "require": { - "php": ">=5.6.0" + "php": ">=7.2" }, "autoload": { "files": [ diff --git a/composer.lock b/composer.lock index 1447838..8296005 100644 --- a/composer.lock +++ b/composer.lock @@ -4,35 +4,49 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "a344b2e43e6ad7d5efbd6d9e76622eee", + "content-hash": "6efec4c115ab366e1f86ea7bbff3837c", "packages": [], "packages-dev": [ { - "name": "ciaranmcnulty/phpspec-typehintedmethods", - "version": "2.0.0", + "name": "amphp/amp", + "version": "v2.6.1", "source": { "type": "git", - "url": "https://github.com/ciaranmcnulty/phpspec-typehintedmethods.git", - "reference": "3b0ae89c7717d7809516af4bb6c1faaf61f667e3" + "url": "https://github.com/amphp/amp.git", + "reference": "c5fc66a78ee38d7ac9195a37bacaf940eb3f65ae" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ciaranmcnulty/phpspec-typehintedmethods/zipball/3b0ae89c7717d7809516af4bb6c1faaf61f667e3", - "reference": "3b0ae89c7717d7809516af4bb6c1faaf61f667e3", + "url": "https://api.github.com/repos/amphp/amp/zipball/c5fc66a78ee38d7ac9195a37bacaf940eb3f65ae", + "reference": "c5fc66a78ee38d7ac9195a37bacaf940eb3f65ae", "shasum": "" }, "require": { - "phpspec/phpspec": "~3.0" + "php": ">=7.1" }, "require-dev": { - "behat/behat": "~3.0", - "symfony/filesystem": "~3.0" + "amphp/php-cs-fixer-config": "dev-master", + "amphp/phpunit-util": "^1", + "ext-json": "*", + "jetbrains/phpstorm-stubs": "^2019.3", + "phpunit/phpunit": "^7 | ^8 | ^9", + "psalm/phar": "^3.11@dev", + "react/promise": "^2" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.x-dev" + } + }, "autoload": { "psr-4": { - "Cjm\\PhpSpec\\": "src/" - } + "Amp\\": "lib" + }, + "files": [ + "lib/functions.php", + "lib/Internal/functions.php" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -40,55 +54,87 @@ ], "authors": [ { - "name": "Ciaran McNulty", - "email": "mail@ciaranmcnulty.com", - "homepage": "http://ciaranmcnulty.com", - "role": "Developer" + "name": "Daniel Lowrey", + "email": "rdlowrey@php.net" + }, + { + "name": "Aaron Piotrowski", + "email": "aaron@trowski.com" + }, + { + "name": "Bob Weinand", + "email": "bobwei9@hotmail.com" + }, + { + "name": "Niklas Keller", + "email": "me@kelunik.com" } ], - "description": "Extension for phpspec to enhance generated methods", - "homepage": "http://github.com/ciaranmcnulty/phpspec-typehintedmethods", + "description": "A non-blocking concurrency framework for PHP applications.", + "homepage": "http://amphp.org/amp", "keywords": [ - "BDD", - "TDD", - "phpspec" + "async", + "asynchronous", + "awaitable", + "concurrency", + "event", + "event-loop", + "future", + "non-blocking", + "promise" + ], + "support": { + "irc": "irc://irc.freenode.org/amphp", + "issues": "https://github.com/amphp/amp/issues", + "source": "https://github.com/amphp/amp/tree/v2.6.1" + }, + "funding": [ + { + "url": "https://github.com/amphp", + "type": "github" + } ], - "time": "2016-08-12T14:21:22+00:00" + "time": "2021-09-23T18:43:08+00:00" }, { - "name": "doctrine/instantiator", - "version": "1.0.5", + "name": "amphp/byte-stream", + "version": "v1.8.1", "source": { "type": "git", - "url": "https://github.com/doctrine/instantiator.git", - "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d" + "url": "https://github.com/amphp/byte-stream.git", + "reference": "acbd8002b3536485c997c4e019206b3f10ca15bd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d", - "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d", + "url": "https://api.github.com/repos/amphp/byte-stream/zipball/acbd8002b3536485c997c4e019206b3f10ca15bd", + "reference": "acbd8002b3536485c997c4e019206b3f10ca15bd", "shasum": "" }, "require": { - "php": ">=5.3,<8.0-DEV" + "amphp/amp": "^2", + "php": ">=7.1" }, "require-dev": { - "athletic/athletic": "~0.1.8", - "ext-pdo": "*", - "ext-phar": "*", - "phpunit/phpunit": "~4.0", - "squizlabs/php_codesniffer": "~2.0" + "amphp/php-cs-fixer-config": "dev-master", + "amphp/phpunit-util": "^1.4", + "friendsofphp/php-cs-fixer": "^2.3", + "jetbrains/phpstorm-stubs": "^2019.3", + "phpunit/phpunit": "^6 || ^7 || ^8", + "psalm/phar": "^3.11.4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.x-dev" } }, "autoload": { "psr-4": { - "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" - } + "Amp\\ByteStream\\": "lib" + }, + "files": [ + "lib/functions.php" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -96,178 +142,290 @@ ], "authors": [ { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com", - "homepage": "http://ocramius.github.com/" + "name": "Aaron Piotrowski", + "email": "aaron@trowski.com" + }, + { + "name": "Niklas Keller", + "email": "me@kelunik.com" } ], - "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", - "homepage": "https://github.com/doctrine/instantiator", + "description": "A stream abstraction to make working with non-blocking I/O simple.", + "homepage": "http://amphp.org/byte-stream", "keywords": [ - "constructor", - "instantiate" + "amp", + "amphp", + "async", + "io", + "non-blocking", + "stream" + ], + "support": { + "irc": "irc://irc.freenode.org/amphp", + "issues": "https://github.com/amphp/byte-stream/issues", + "source": "https://github.com/amphp/byte-stream/tree/v1.8.1" + }, + "funding": [ + { + "url": "https://github.com/amphp", + "type": "github" + } ], - "time": "2015-06-14T21:17:01+00:00" + "time": "2021-03-30T17:13:30+00:00" }, { - "name": "henrikbjorn/phpspec-code-coverage", - "version": "3.0.1", + "name": "composer/package-versions-deprecated", + "version": "1.11.99.5", "source": { "type": "git", - "url": "https://github.com/henrikbjorn/PhpSpecCodeCoverageExtension.git", - "reference": "4e878b81c0d28494882ecb7e9403ac5cbaa6cc1b" + "url": "https://github.com/composer/package-versions-deprecated.git", + "reference": "b4f54f74ef3453349c24a845d22392cd31e65f1d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/henrikbjorn/PhpSpecCodeCoverageExtension/zipball/4e878b81c0d28494882ecb7e9403ac5cbaa6cc1b", - "reference": "4e878b81c0d28494882ecb7e9403ac5cbaa6cc1b", + "url": "https://api.github.com/repos/composer/package-versions-deprecated/zipball/b4f54f74ef3453349c24a845d22392cd31e65f1d", + "reference": "b4f54f74ef3453349c24a845d22392cd31e65f1d", "shasum": "" }, "require": { - "php": "^5.5|^5.6|^7.0", - "phpspec/phpspec": "^3.0", - "phpunit/php-code-coverage": "^4.0" + "composer-plugin-api": "^1.1.0 || ^2.0", + "php": "^7 || ^8" }, - "require-dev": { - "bossa/phpspec2-expect": "dev-master" + "replace": { + "ocramius/package-versions": "1.11.99" }, - "suggest": { - "ext-xdebug": "To allow coverage generation when not using a recent version of phpdbg" + "require-dev": { + "composer/composer": "^1.9.3 || ^2.0@dev", + "ext-zip": "^1.13", + "phpunit/phpunit": "^6.5 || ^7" }, - "type": "library", + "type": "composer-plugin", "extra": { + "class": "PackageVersions\\Installer", "branch-alias": { - "dev-master": "3.0.x-dev" + "dev-master": "1.x-dev" } }, "autoload": { "psr-4": { - "PhpSpecCodeCoverage\\": "src/" + "PackageVersions\\": "src/PackageVersions" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "description": "Integrates CodeCoverage with PhpSpec", - "time": "2016-08-02T06:07:43+00:00" + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com" + }, + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be" + } + ], + "description": "Composer plugin that provides efficient querying for installed package versions (no runtime IO)", + "support": { + "issues": "https://github.com/composer/package-versions-deprecated/issues", + "source": "https://github.com/composer/package-versions-deprecated/tree/1.11.99.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": "2022-01-17T14:14:24+00:00" }, { - "name": "myclabs/deep-copy", - "version": "1.7.0", + "name": "composer/pcre", + "version": "1.0.1", "source": { "type": "git", - "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e" + "url": "https://github.com/composer/pcre.git", + "reference": "67a32d7d6f9f560b726ab25a061b38ff3a80c560" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e", - "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e", + "url": "https://api.github.com/repos/composer/pcre/zipball/67a32d7d6f9f560b726ab25a061b38ff3a80c560", + "reference": "67a32d7d6f9f560b726ab25a061b38ff3a80c560", "shasum": "" }, "require": { - "php": "^5.6 || ^7.0" + "php": "^5.3.2 || ^7.0 || ^8.0" }, "require-dev": { - "doctrine/collections": "^1.0", - "doctrine/common": "^2.6", - "phpunit/phpunit": "^4.1" + "phpstan/phpstan": "^1.3", + "phpstan/phpstan-strict-rules": "^1.1", + "symfony/phpunit-bridge": "^4.2 || ^5" }, "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.x-dev" + } + }, "autoload": { "psr-4": { - "DeepCopy\\": "src/DeepCopy/" - }, - "files": [ - "src/DeepCopy/deep_copy.php" - ] + "Composer\\Pcre\\": "src" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "description": "Create deep copies (clones) of your objects", + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "PCRE wrapping library that offers type-safe preg_* replacements.", "keywords": [ - "clone", - "copy", - "duplicate", - "object", - "object graph" + "PCRE", + "preg", + "regex", + "regular expression" + ], + "support": { + "issues": "https://github.com/composer/pcre/issues", + "source": "https://github.com/composer/pcre/tree/1.0.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": "2017-10-19T19:58:43+00:00" + "time": "2022-01-21T20:24:37+00:00" }, { - "name": "pdepend/pdepend", - "version": "2.2.4", + "name": "composer/semver", + "version": "3.2.7", "source": { "type": "git", - "url": "https://github.com/pdepend/pdepend.git", - "reference": "b086687f3a01dc6bb92d633aef071d2c5dd0db06" + "url": "https://github.com/composer/semver.git", + "reference": "deac27056b57e46faf136fae7b449eeaa71661ee" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pdepend/pdepend/zipball/b086687f3a01dc6bb92d633aef071d2c5dd0db06", - "reference": "b086687f3a01dc6bb92d633aef071d2c5dd0db06", + "url": "https://api.github.com/repos/composer/semver/zipball/deac27056b57e46faf136fae7b449eeaa71661ee", + "reference": "deac27056b57e46faf136fae7b449eeaa71661ee", "shasum": "" }, "require": { - "php": ">=5.3.7", - "symfony/config": "^2.3.0|^3", - "symfony/dependency-injection": "^2.3.0|^3", - "symfony/filesystem": "^2.3.0|^3" + "php": "^5.3.2 || ^7.0 || ^8.0" }, "require-dev": { - "phpunit/phpunit": "^4.4.0,<4.8", - "squizlabs/php_codesniffer": "^2.0.0" + "phpstan/phpstan": "^0.12.54", + "symfony/phpunit-bridge": "^4.2 || ^5" }, - "bin": [ - "src/bin/pdepend" - ], "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.x-dev" + } + }, "autoload": { "psr-4": { - "PDepend\\": "src/main/php/PDepend" + "Composer\\Semver\\": "src" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], - "description": "Official version of pdepend to be handled with Composer", - "time": "2016-03-10T15:15:04+00:00" + "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": "irc://irc.freenode.org/composer", + "issues": "https://github.com/composer/semver/issues", + "source": "https://github.com/composer/semver/tree/3.2.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": "2022-01-04T09:57:54+00:00" }, { - "name": "phpdocumentor/reflection-common", - "version": "1.0.1", + "name": "composer/xdebug-handler", + "version": "2.0.4", "source": { "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionCommon.git", - "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6" + "url": "https://github.com/composer/xdebug-handler.git", + "reference": "0c1a3925ec58a4ec98e992b9c7d171e9e184be0a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", - "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/0c1a3925ec58a4ec98e992b9c7d171e9e184be0a", + "reference": "0c1a3925ec58a4ec98e992b9c7d171e9e184be0a", "shasum": "" }, "require": { - "php": ">=5.5" + "composer/pcre": "^1", + "php": "^5.3.2 || ^7.0 || ^8.0", + "psr/log": "^1 || ^2 || ^3" }, "require-dev": { - "phpunit/phpunit": "^4.6" + "phpstan/phpstan": "^1.0", + "phpstan/phpstan-strict-rules": "^1.1", + "symfony/phpunit-bridge": "^4.2 || ^5.0 || ^6.0" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, "autoload": { "psr-4": { - "phpDocumentor\\Reflection\\": [ - "src" - ] + "Composer\\XdebugHandler\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -276,99 +434,103 @@ ], "authors": [ { - "name": "Jaap van Otterdijk", - "email": "opensource@ijaap.nl" + "name": "John Stevenson", + "email": "john-stevenson@blueyonder.co.uk" } ], - "description": "Common reflection classes used by phpdocumentor to reflect the code structure", - "homepage": "http://www.phpdoc.org", + "description": "Restarts a process without Xdebug.", "keywords": [ - "FQSEN", - "phpDocumentor", - "phpdoc", - "reflection", - "static analysis" + "Xdebug", + "performance" + ], + "support": { + "irc": "irc://irc.freenode.org/composer", + "issues": "https://github.com/composer/xdebug-handler/issues", + "source": "https://github.com/composer/xdebug-handler/tree/2.0.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": "2017-09-11T18:02:19+00:00" + "time": "2022-01-04T17:06:45+00:00" }, { - "name": "phpdocumentor/reflection-docblock", - "version": "3.3.2", + "name": "dnoegel/php-xdg-base-dir", + "version": "v0.1.1", "source": { "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "bf329f6c1aadea3299f08ee804682b7c45b326a2" + "url": "https://github.com/dnoegel/php-xdg-base-dir.git", + "reference": "8f8a6e48c5ecb0f991c2fdcf5f154a47d85f9ffd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/bf329f6c1aadea3299f08ee804682b7c45b326a2", - "reference": "bf329f6c1aadea3299f08ee804682b7c45b326a2", + "url": "https://api.github.com/repos/dnoegel/php-xdg-base-dir/zipball/8f8a6e48c5ecb0f991c2fdcf5f154a47d85f9ffd", + "reference": "8f8a6e48c5ecb0f991c2fdcf5f154a47d85f9ffd", "shasum": "" }, "require": { - "php": "^5.6 || ^7.0", - "phpdocumentor/reflection-common": "^1.0.0", - "phpdocumentor/type-resolver": "^0.4.0", - "webmozart/assert": "^1.0" + "php": ">=5.3.2" }, "require-dev": { - "mockery/mockery": "^0.9.4", - "phpunit/phpunit": "^4.4" + "phpunit/phpunit": "~7.0|~6.0|~5.0|~4.8.35" }, "type": "library", "autoload": { "psr-4": { - "phpDocumentor\\Reflection\\": [ - "src/" - ] + "XdgBaseDir\\": "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": "2017-11-10T14:09:06+00:00" + "description": "implementation of xdg base directory specification for php", + "support": { + "issues": "https://github.com/dnoegel/php-xdg-base-dir/issues", + "source": "https://github.com/dnoegel/php-xdg-base-dir/tree/v0.1.1" + }, + "time": "2019-12-04T15:06:13+00:00" }, { - "name": "phpdocumentor/type-resolver", - "version": "0.4.0", + "name": "doctrine/instantiator", + "version": "1.4.0", "source": { "type": "git", - "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7" + "url": "https://github.com/doctrine/instantiator.git", + "reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/9c977708995954784726e25d0cd1dddf4e65b0f7", - "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/d56bf6102915de5702778fe20f2de3b2fe570b5b", + "reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b", "shasum": "" }, "require": { - "php": "^5.5 || ^7.0", - "phpdocumentor/reflection-common": "^1.0" + "php": "^7.1 || ^8.0" }, "require-dev": { - "mockery/mockery": "^0.9.4", - "phpunit/phpunit": "^5.2||^4.8.24" + "doctrine/coding-standard": "^8.0", + "ext-pdo": "*", + "ext-phar": "*", + "phpbench/phpbench": "^0.13 || 1.0.0-alpha2", + "phpstan/phpstan": "^0.12", + "phpstan/phpstan-phpunit": "^0.12", + "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, "autoload": { "psr-4": { - "phpDocumentor\\Reflection\\": [ - "src/" - ] + "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" } }, "notification-url": "https://packagist.org/downloads/", @@ -377,164 +539,181 @@ ], "authors": [ { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" + "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.4.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": "2017-07-14T14:27:02+00:00" + "time": "2020-11-10T18:47:58+00:00" }, { - "name": "phpmd/phpmd", - "version": "2.4.3", + "name": "felixfbecker/advanced-json-rpc", + "version": "v3.2.1", "source": { "type": "git", - "url": "https://github.com/phpmd/phpmd.git", - "reference": "2b9c2417a18696dfb578b38c116cd0ddc19b256e" + "url": "https://github.com/felixfbecker/php-advanced-json-rpc.git", + "reference": "b5f37dbff9a8ad360ca341f3240dc1c168b45447" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpmd/phpmd/zipball/2b9c2417a18696dfb578b38c116cd0ddc19b256e", - "reference": "2b9c2417a18696dfb578b38c116cd0ddc19b256e", + "url": "https://api.github.com/repos/felixfbecker/php-advanced-json-rpc/zipball/b5f37dbff9a8ad360ca341f3240dc1c168b45447", + "reference": "b5f37dbff9a8ad360ca341f3240dc1c168b45447", "shasum": "" }, "require": { - "pdepend/pdepend": "^2.0.4", - "php": ">=5.3.0" + "netresearch/jsonmapper": "^1.0 || ^2.0 || ^3.0 || ^4.0", + "php": "^7.1 || ^8.0", + "phpdocumentor/reflection-docblock": "^4.3.4 || ^5.0.0" }, "require-dev": { - "phpunit/phpunit": "^4.0", - "squizlabs/php_codesniffer": "^2.0" + "phpunit/phpunit": "^7.0 || ^8.0" }, - "bin": [ - "src/bin/phpmd" - ], - "type": "project", + "type": "library", "autoload": { - "psr-0": { - "PHPMD\\": "src/main/php" + "psr-4": { + "AdvancedJsonRpc\\": "lib/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "ISC" ], "authors": [ { - "name": "Manuel Pichler", - "email": "github@manuel-pichler.de", - "homepage": "https://github.com/manuelpichler", - "role": "Project Founder" - }, - { - "name": "Other contributors", - "homepage": "https://github.com/phpmd/phpmd/graphs/contributors", - "role": "Contributors" - }, - { - "name": "Marc Würth", - "email": "ravage@bluewin.ch", - "homepage": "https://github.com/ravage84", - "role": "Project Maintainer" + "name": "Felix Becker", + "email": "felix.b@outlook.com" } ], - "description": "PHPMD is a spin-off project of PHP Depend and aims to be a PHP equivalent of the well known Java tool PMD.", - "homepage": "http://phpmd.org/", - "keywords": [ - "mess detection", - "mess detector", - "pdepend", - "phpmd", - "pmd" - ], - "time": "2016-04-04T11:52:04+00:00" + "description": "A more advanced JSONRPC implementation", + "support": { + "issues": "https://github.com/felixfbecker/php-advanced-json-rpc/issues", + "source": "https://github.com/felixfbecker/php-advanced-json-rpc/tree/v3.2.1" + }, + "time": "2021-06-11T22:34:44+00:00" }, { - "name": "phpspec/php-diff", - "version": "v1.1.0", + "name": "felixfbecker/language-server-protocol", + "version": "1.5.1", "source": { "type": "git", - "url": "https://github.com/phpspec/php-diff.git", - "reference": "0464787bfa7cd13576c5a1e318709768798bec6a" + "url": "https://github.com/felixfbecker/php-language-server-protocol.git", + "reference": "9d846d1f5cf101deee7a61c8ba7caa0a975cd730" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/php-diff/zipball/0464787bfa7cd13576c5a1e318709768798bec6a", - "reference": "0464787bfa7cd13576c5a1e318709768798bec6a", + "url": "https://api.github.com/repos/felixfbecker/php-language-server-protocol/zipball/9d846d1f5cf101deee7a61c8ba7caa0a975cd730", + "reference": "9d846d1f5cf101deee7a61c8ba7caa0a975cd730", "shasum": "" }, + "require": { + "php": ">=7.1" + }, + "require-dev": { + "phpstan/phpstan": "*", + "squizlabs/php_codesniffer": "^3.1", + "vimeo/psalm": "^4.0" + }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.x-dev" } }, "autoload": { - "psr-0": { - "Diff": "lib/" + "psr-4": { + "LanguageServerProtocol\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "ISC" ], "authors": [ { - "name": "Chris Boulton", - "homepage": "http://github.com/chrisboulton" + "name": "Felix Becker", + "email": "felix.b@outlook.com" } ], - "description": "A comprehensive library for generating differences between two hashable objects (strings or arrays).", - "time": "2016-04-07T12:29:16+00:00" + "description": "PHP classes for the Language Server Protocol", + "keywords": [ + "language", + "microsoft", + "php", + "server" + ], + "support": { + "issues": "https://github.com/felixfbecker/php-language-server-protocol/issues", + "source": "https://github.com/felixfbecker/php-language-server-protocol/tree/1.5.1" + }, + "time": "2021-02-22T14:02:09+00:00" }, { - "name": "phpspec/phpspec", - "version": "3.4.3", + "name": "friends-of-phpspec/phpspec-code-coverage", + "version": "v6.1.0", "source": { "type": "git", - "url": "https://github.com/phpspec/phpspec.git", - "reference": "8e72ed3576f6e26baebb2c214a8dba344508e3bd" + "url": "https://github.com/friends-of-phpspec/phpspec-code-coverage.git", + "reference": "cb6177eb8ce45cdde990ff3e6db3b44fbbb17364" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/phpspec/zipball/8e72ed3576f6e26baebb2c214a8dba344508e3bd", - "reference": "8e72ed3576f6e26baebb2c214a8dba344508e3bd", + "url": "https://api.github.com/repos/friends-of-phpspec/phpspec-code-coverage/zipball/cb6177eb8ce45cdde990ff3e6db3b44fbbb17364", + "reference": "cb6177eb8ce45cdde990ff3e6db3b44fbbb17364", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.0.1", - "ext-tokenizer": "*", - "php": "^5.6 || ^7.0", - "phpspec/php-diff": "^1.0.0", - "phpspec/prophecy": "^1.5", - "sebastian/exporter": "^1.0 || ^2.0 || ^3.0", - "symfony/console": "^2.7 || ^3.0", - "symfony/event-dispatcher": "^2.7 || ^3.0", - "symfony/finder": "^2.7 || ^3.0", - "symfony/process": "^2.7 || ^3.0", - "symfony/yaml": "^2.7 || ^3.0" + "php": ">= 7.3", + "phpspec/phpspec": "^6.0 || ^7.0", + "phpunit/php-code-coverage": "^9.0" + }, + "conflict": { + "sebastian/comparator": "< 2.0" }, "require-dev": { - "behat/behat": "^3.3", - "ciaranmcnulty/versionbasedtestskipper": "^0.2.1", - "phpunit/phpunit": "^5.5|^6.0", - "symfony/filesystem": "^3.0" + "drupol/php-conventions": "^3.0", + "vimeo/psalm": "^4.7" }, "suggest": { - "phpspec/nyan-formatters": "Adds Nyan formatters" + "ext-pcov": "Install PCov extension to generate code coverage.", + "ext-xdebug": "Install Xdebug to generate phpspec code coverage." }, - "bin": [ - "bin/phpspec" - ], "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0.x-dev" + "dev-master": "6.x-dev" } }, "autoload": { - "psr-0": { - "PhpSpec": "src/" - } + "psr-4": { + "FriendsOfPhpSpec\\PhpSpec\\CodeCoverage\\": "src/" + }, + "files": [ + "src/bootstrap.php" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -542,185 +721,187 @@ ], "authors": [ { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" + "name": "ek9", + "email": "dev@ek9.co", + "homepage": "https://ek9.co" }, { - "name": "Marcello Duarte", - "homepage": "http://marcelloduarte.net/" + "name": "Henrik Bjornskov" }, { - "name": "Ciaran McNulty", - "homepage": "https://ciaranmcnulty.com/" + "name": "Stéphane Hulard", + "email": "s.hulard@chstudio.fr", + "homepage": "https://chstudio.fr" + }, + { + "name": "Pol Dellaiera", + "email": "pol.dellaiera@protonmail.com", + "homepage": "https://not-a-number.io/" + }, + { + "name": "Jay Linski", + "homepage": "https://github.com/jaylinski" } ], - "description": "Specification-oriented BDD framework for PHP 5.6+", - "homepage": "http://phpspec.net/", + "description": "Generate Code Coverage reports for PhpSpec tests", + "homepage": "https://github.com/friends-of-phpspec/phpspec-code-coverage", "keywords": [ - "BDD", - "SpecBDD", - "TDD", + "code-coverage", + "coverage", + "phpspec", + "report", "spec", - "specification", - "testing", + "test", "tests" ], - "time": "2017-12-06T09:12:11+00:00" + "support": { + "docs": "https://github.com/friends-of-phpspec/phpspec-code-coverage#phpspec-code-coverage", + "issues": "https://github.com/friends-of-phpspec/phpspec-code-coverage/issues", + "source": "https://github.com/friends-of-phpspec/phpspec-code-coverage" + }, + "time": "2021-03-30T20:51:42+00:00" }, { - "name": "phpspec/prophecy", - "version": "1.8.0", + "name": "myclabs/deep-copy", + "version": "1.10.2", "source": { "type": "git", - "url": "https://github.com/phpspec/prophecy.git", - "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06" + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "776f831124e9c62e1a2c601ecc52e776d8bb7220" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/4ba436b55987b4bf311cb7c6ba82aa528aac0a06", - "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/776f831124e9c62e1a2c601ecc52e776d8bb7220", + "reference": "776f831124e9c62e1a2c601ecc52e776d8bb7220", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.0.2", - "php": "^5.3|^7.0", - "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0", - "sebastian/comparator": "^1.1|^2.0|^3.0", - "sebastian/recursion-context": "^1.0|^2.0|^3.0" + "php": "^7.1 || ^8.0" }, "require-dev": { - "phpspec/phpspec": "^2.5|^3.2", - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1" + "doctrine/collections": "^1.0", + "doctrine/common": "^2.6", + "phpunit/phpunit": "^7.1" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.8.x-dev" - } - }, "autoload": { - "psr-0": { - "Prophecy\\": "src/" - } + "psr-4": { + "DeepCopy\\": "src/DeepCopy/" + }, + "files": [ + "src/DeepCopy/deep_copy.php" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "authors": [ - { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - }, + "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.10.2" + }, + "funding": [ { - "name": "Marcello Duarte", - "email": "marcello.duarte@gmail.com" + "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", + "type": "tidelift" } ], - "description": "Highly opinionated mocking framework for PHP 5.3+", - "homepage": "https://github.com/phpspec/prophecy", - "keywords": [ - "Double", - "Dummy", - "fake", - "mock", - "spy", - "stub" - ], - "time": "2018-08-05T17:53:17+00:00" + "time": "2020-11-13T09:40:50+00:00" }, { - "name": "phpunit/php-code-coverage", - "version": "4.0.8", + "name": "netresearch/jsonmapper", + "version": "v4.0.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d" + "url": "https://github.com/cweiske/jsonmapper.git", + "reference": "8bbc021a8edb2e4a7ea2f8ad4fa9ec9dce2fcb8d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/ef7b2f56815df854e66ceaee8ebe9393ae36a40d", - "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d", + "url": "https://api.github.com/repos/cweiske/jsonmapper/zipball/8bbc021a8edb2e4a7ea2f8ad4fa9ec9dce2fcb8d", + "reference": "8bbc021a8edb2e4a7ea2f8ad4fa9ec9dce2fcb8d", "shasum": "" }, "require": { - "ext-dom": "*", - "ext-xmlwriter": "*", - "php": "^5.6 || ^7.0", - "phpunit/php-file-iterator": "^1.3", - "phpunit/php-text-template": "^1.2", - "phpunit/php-token-stream": "^1.4.2 || ^2.0", - "sebastian/code-unit-reverse-lookup": "^1.0", - "sebastian/environment": "^1.3.2 || ^2.0", - "sebastian/version": "^1.0 || ^2.0" + "ext-json": "*", + "ext-pcre": "*", + "ext-reflection": "*", + "ext-spl": "*", + "php": ">=7.1" }, "require-dev": { - "ext-xdebug": "^2.1.4", - "phpunit/phpunit": "^5.7" - }, - "suggest": { - "ext-xdebug": "^2.5.1" + "phpunit/phpunit": "~7.5 || ~8.0 || ~9.0", + "squizlabs/php_codesniffer": "~3.5" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.0.x-dev" - } - }, "autoload": { - "classmap": [ - "src/" - ] + "psr-0": { + "JsonMapper": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "OSL-3.0" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" + "name": "Christian Weiske", + "email": "cweiske@cweiske.de", + "homepage": "http://github.com/cweiske/jsonmapper/", + "role": "Developer" } ], - "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": "2017-04-02T07:44:40+00:00" + "description": "Map nested JSON structures onto PHP classes", + "support": { + "email": "cweiske@cweiske.de", + "issues": "https://github.com/cweiske/jsonmapper/issues", + "source": "https://github.com/cweiske/jsonmapper/tree/v4.0.0" + }, + "time": "2020-12-01T19:48:11+00:00" }, { - "name": "phpunit/php-file-iterator", - "version": "1.4.5", + "name": "nikic/php-parser", + "version": "v4.13.2", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4" + "url": "https://github.com/nikic/PHP-Parser.git", + "reference": "210577fe3cf7badcc5814d99455df46564f3c077" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4", - "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/210577fe3cf7badcc5814d99455df46564f3c077", + "reference": "210577fe3cf7badcc5814d99455df46564f3c077", "shasum": "" }, "require": { - "php": ">=5.3.3" + "ext-tokenizer": "*", + "php": ">=7.0" + }, + "require-dev": { + "ircmaxell/php-yacc": "^0.0.7", + "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0" }, + "bin": [ + "bin/php-parse" + ], "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4.x-dev" + "dev-master": "4.9-dev" } }, "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "PhpParser\\": "lib/PhpParser" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -728,134 +909,155 @@ ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" + "name": "Nikita Popov" } ], - "description": "FilterIterator implementation that filters files based on a list of suffixes.", - "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", + "description": "A PHP parser written in PHP", "keywords": [ - "filesystem", - "iterator" + "parser", + "php" ], - "time": "2017-11-27T13:52:08+00:00" + "support": { + "issues": "https://github.com/nikic/PHP-Parser/issues", + "source": "https://github.com/nikic/PHP-Parser/tree/v4.13.2" + }, + "time": "2021-11-30T19:35:32+00:00" }, { - "name": "phpunit/php-text-template", - "version": "1.2.1", + "name": "openlss/lib-array2xml", + "version": "1.0.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" + "url": "https://github.com/nullivex/lib-array2xml.git", + "reference": "a91f18a8dfc69ffabe5f9b068bc39bb202c81d90" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "url": "https://api.github.com/repos/nullivex/lib-array2xml/zipball/a91f18a8dfc69ffabe5f9b068bc39bb202c81d90", + "reference": "a91f18a8dfc69ffabe5f9b068bc39bb202c81d90", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=5.3.2" }, "type": "library", "autoload": { - "classmap": [ - "src/" - ] + "psr-0": { + "LSS": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "Apache-2.0" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" + "name": "Bryan Tong", + "email": "bryan@nullivex.com", + "homepage": "https://www.nullivex.com" + }, + { + "name": "Tony Butler", + "email": "spudz76@gmail.com", + "homepage": "https://www.nullivex.com" } ], - "description": "Simple template engine.", - "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "description": "Array2XML conversion library credit to lalit.org", + "homepage": "https://www.nullivex.com", "keywords": [ - "template" + "array", + "array conversion", + "xml", + "xml conversion" ], - "time": "2015-06-21T13:50:34+00:00" + "support": { + "issues": "https://github.com/nullivex/lib-array2xml/issues", + "source": "https://github.com/nullivex/lib-array2xml/tree/master" + }, + "time": "2019-03-29T20:06:56+00:00" }, { - "name": "phpunit/php-timer", - "version": "1.0.9", + "name": "pdepend/pdepend", + "version": "2.10.2", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f" + "url": "https://github.com/pdepend/pdepend.git", + "reference": "c8c1d2af43fb8c2b5387d50e9c42a9c56de13686" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", - "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "url": "https://api.github.com/repos/pdepend/pdepend/zipball/c8c1d2af43fb8c2b5387d50e9c42a9c56de13686", + "reference": "c8c1d2af43fb8c2b5387d50e9c42a9c56de13686", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0" + "php": ">=5.3.7", + "symfony/config": "^2.3.0|^3|^4|^5", + "symfony/dependency-injection": "^2.3.0|^3|^4|^5", + "symfony/filesystem": "^2.3.0|^3|^4|^5" }, "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + "easy-doc/easy-doc": "0.0.0|^1.2.3", + "gregwar/rst": "^1.0", + "phpunit/phpunit": "^4.8.36|^5.7.27", + "squizlabs/php_codesniffer": "^2.0.0" }, + "bin": [ + "src/bin/pdepend" + ], "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-master": "2.x-dev" } }, "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "PDepend\\": "src/main/php/PDepend" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], - "authors": [ + "description": "Official version of pdepend to be handled with Composer", + "support": { + "issues": "https://github.com/pdepend/pdepend/issues", + "source": "https://github.com/pdepend/pdepend/tree/2.10.2" + }, + "funding": [ { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" + "url": "https://tidelift.com/funding/github/packagist/pdepend/pdepend", + "type": "tidelift" } ], - "description": "Utility class for timing", - "homepage": "https://github.com/sebastianbergmann/php-timer/", - "keywords": [ - "timer" - ], - "time": "2017-02-26T11:10:40+00:00" + "time": "2021-11-16T20:05:32+00:00" }, { - "name": "phpunit/php-token-stream", - "version": "1.4.12", + "name": "phar-io/manifest", + "version": "2.0.3", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "1ce90ba27c42e4e44e6d8458241466380b51fa16" + "url": "https://github.com/phar-io/manifest.git", + "reference": "97803eca37d319dfa7826cc2437fc020857acb53" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/1ce90ba27c42e4e44e6d8458241466380b51fa16", - "reference": "1ce90ba27c42e4e44e6d8458241466380b51fa16", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/97803eca37d319dfa7826cc2437fc020857acb53", + "reference": "97803eca37d319dfa7826cc2437fc020857acb53", "shasum": "" }, "require": { - "ext-tokenizer": "*", - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.2" + "ext-dom": "*", + "ext-phar": "*", + "ext-xmlwriter": "*", + "phar-io/version": "^3.0.1", + "php": "^7.2 || ^8.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { @@ -868,75 +1070,47 @@ "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" + "email": "sebastian@phpunit.de", + "role": "Developer" } ], - "description": "Wrapper around PHP's tokenizer extension.", - "homepage": "https://github.com/sebastianbergmann/php-token-stream/", - "keywords": [ - "tokenizer" - ], - "time": "2017-12-04T08:55:13+00:00" + "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.3" + }, + "time": "2021-07-20T11:28:43+00:00" }, { - "name": "phpunit/phpunit", - "version": "5.7.27", + "name": "phar-io/version", + "version": "3.1.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c" + "url": "https://github.com/phar-io/version.git", + "reference": "bae7c545bef187884426f042434e561ab1ddb182" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c", - "reference": "b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c", + "url": "https://api.github.com/repos/phar-io/version/zipball/bae7c545bef187884426f042434e561ab1ddb182", + "reference": "bae7c545bef187884426f042434e561ab1ddb182", "shasum": "" }, "require": { - "ext-dom": "*", - "ext-json": "*", - "ext-libxml": "*", - "ext-mbstring": "*", - "ext-xml": "*", - "myclabs/deep-copy": "~1.3", - "php": "^5.6 || ^7.0", - "phpspec/prophecy": "^1.6.2", - "phpunit/php-code-coverage": "^4.0.4", - "phpunit/php-file-iterator": "~1.4", - "phpunit/php-text-template": "~1.2", - "phpunit/php-timer": "^1.0.6", - "phpunit/phpunit-mock-objects": "^3.2", - "sebastian/comparator": "^1.2.4", - "sebastian/diff": "^1.4.3", - "sebastian/environment": "^1.3.4 || ^2.0", - "sebastian/exporter": "~2.0", - "sebastian/global-state": "^1.1", - "sebastian/object-enumerator": "~2.0", - "sebastian/resource-operations": "~1.0", - "sebastian/version": "^1.0.6|^2.0.1", - "symfony/yaml": "~2.1|~3.0|~4.0" + "php": "^7.2 || ^8.0" }, - "conflict": { - "phpdocumentor/reflection-docblock": "3.0.2" - }, - "require-dev": { - "ext-pdo": "*" - }, - "suggest": { - "ext-xdebug": "*", - "phpunit/php-invoker": "~1.1" - }, - "bin": [ - "phpunit" - ], "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.7.x-dev" - } - }, "autoload": { "classmap": [ "src/" @@ -947,219 +1121,226 @@ "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": "lead" + "role": "Developer" } ], - "description": "The PHP Unit Testing framework.", - "homepage": "https://phpunit.de/", - "keywords": [ - "phpunit", - "testing", - "xunit" - ], - "time": "2018-02-01T05:50:59+00:00" + "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.1.0" + }, + "time": "2021-02-23T14:00:09+00:00" }, { - "name": "phpunit/phpunit-mock-objects", - "version": "3.4.4", + "name": "phpdocumentor/reflection-common", + "version": "2.2.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "a23b761686d50a560cc56233b9ecf49597cc9118" + "url": "https://github.com/phpDocumentor/ReflectionCommon.git", + "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/a23b761686d50a560cc56233b9ecf49597cc9118", - "reference": "a23b761686d50a560cc56233b9ecf49597cc9118", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/1d01c49d4ed62f25aa84a747ad35d5a16924662b", + "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.0.2", - "php": "^5.6 || ^7.0", - "phpunit/php-text-template": "^1.2", - "sebastian/exporter": "^1.2 || ^2.0" - }, - "conflict": { - "phpunit/phpunit": "<5.4.0" - }, - "require-dev": { - "phpunit/phpunit": "^5.4" - }, - "suggest": { - "ext-soap": "*" + "php": "^7.2 || ^8.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.2.x-dev" + "dev-2.x": "2.x-dev" } }, "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "phpDocumentor\\Reflection\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" + "name": "Jaap van Otterdijk", + "email": "opensource@ijaap.nl" } ], - "description": "Mock Object library for PHPUnit", - "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", + "description": "Common reflection classes used by phpdocumentor to reflect the code structure", + "homepage": "http://www.phpdoc.org", "keywords": [ - "mock", - "xunit" + "FQSEN", + "phpDocumentor", + "phpdoc", + "reflection", + "static analysis" ], - "time": "2017-06-30T09:13:00+00:00" + "support": { + "issues": "https://github.com/phpDocumentor/ReflectionCommon/issues", + "source": "https://github.com/phpDocumentor/ReflectionCommon/tree/2.x" + }, + "time": "2020-06-27T09:03:43+00:00" }, { - "name": "sebastian/code-unit-reverse-lookup", - "version": "1.0.1", + "name": "phpdocumentor/reflection-docblock", + "version": "5.3.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", - "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18" + "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", + "reference": "622548b623e81ca6d78b721c5e029f4ce664f170" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", - "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/622548b623e81ca6d78b721c5e029f4ce664f170", + "reference": "622548b623e81ca6d78b721c5e029f4ce664f170", "shasum": "" }, "require": { - "php": "^5.6 || ^7.0" + "ext-filter": "*", + "php": "^7.2 || ^8.0", + "phpdocumentor/reflection-common": "^2.2", + "phpdocumentor/type-resolver": "^1.3", + "webmozart/assert": "^1.9.1" }, "require-dev": { - "phpunit/phpunit": "^5.7 || ^6.0" + "mockery/mockery": "~1.3.2", + "psalm/phar": "^4.8" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "5.x-dev" } }, "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "phpDocumentor\\Reflection\\": "src" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + }, + { + "name": "Jaap van Otterdijk", + "email": "account@ijaap.nl" } ], - "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" + "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", + "support": { + "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", + "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.3.0" + }, + "time": "2021-10-19T17:43:47+00:00" }, { - "name": "sebastian/comparator", - "version": "1.2.4", + "name": "phpdocumentor/type-resolver", + "version": "1.6.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be" + "url": "https://github.com/phpDocumentor/TypeResolver.git", + "reference": "93ebd0014cab80c4ea9f5e297ea48672f1b87706" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", - "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/93ebd0014cab80c4ea9f5e297ea48672f1b87706", + "reference": "93ebd0014cab80c4ea9f5e297ea48672f1b87706", "shasum": "" }, "require": { - "php": ">=5.3.3", - "sebastian/diff": "~1.2", - "sebastian/exporter": "~1.2 || ~2.0" + "php": "^7.2 || ^8.0", + "phpdocumentor/reflection-common": "^2.0" }, "require-dev": { - "phpunit/phpunit": "~4.4" + "ext-tokenizer": "*", + "psalm/phar": "^4.8" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2.x-dev" + "dev-1.x": "1.x-dev" } }, "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "phpDocumentor\\Reflection\\": "src" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "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" + "name": "Mike van Riel", + "email": "me@mikevanriel.com" } ], - "description": "Provides the functionality to compare PHP values for equality", - "homepage": "http://www.github.com/sebastianbergmann/comparator", - "keywords": [ - "comparator", - "compare", - "equality" - ], - "time": "2017-01-29T09:50:25+00:00" + "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", + "support": { + "issues": "https://github.com/phpDocumentor/TypeResolver/issues", + "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.6.0" + }, + "time": "2022-01-04T19:58:01+00:00" }, { - "name": "sebastian/diff", - "version": "1.4.3", + "name": "phpmd/phpmd", + "version": "2.11.1", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4" + "url": "https://github.com/phpmd/phpmd.git", + "reference": "08b60a2eb7e14c23f46ff8865b510ae08b75d0fd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7f066a26a962dbe58ddea9f72a4e82874a3975a4", - "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4", + "url": "https://api.github.com/repos/phpmd/phpmd/zipball/08b60a2eb7e14c23f46ff8865b510ae08b75d0fd", + "reference": "08b60a2eb7e14c23f46ff8865b510ae08b75d0fd", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0" + "composer/xdebug-handler": "^1.0 || ^2.0", + "ext-xml": "*", + "pdepend/pdepend": "^2.10.2", + "php": ">=5.3.9" }, "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + "easy-doc/easy-doc": "0.0.0 || ^1.3.2", + "ext-json": "*", + "ext-simplexml": "*", + "gregwar/rst": "^1.0", + "mikey179/vfsstream": "^1.6.8", + "phpunit/phpunit": "^4.8.36 || ^5.7.27", + "squizlabs/php_codesniffer": "^2.0" }, + "bin": [ + "src/bin/phpmd" + ], "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4-dev" - } - }, "autoload": { - "classmap": [ - "src/" - ] + "psr-0": { + "PHPMD\\": "src/main/php" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1167,51 +1348,69 @@ ], "authors": [ { - "name": "Kore Nordmann", - "email": "mail@kore-nordmann.de" + "name": "Manuel Pichler", + "email": "github@manuel-pichler.de", + "homepage": "https://github.com/manuelpichler", + "role": "Project Founder" }, { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "name": "Marc Würth", + "email": "ravage@bluewin.ch", + "homepage": "https://github.com/ravage84", + "role": "Project Maintainer" + }, + { + "name": "Other contributors", + "homepage": "https://github.com/phpmd/phpmd/graphs/contributors", + "role": "Contributors" } ], - "description": "Diff implementation", - "homepage": "https://github.com/sebastianbergmann/diff", + "description": "PHPMD is a spin-off project of PHP Depend and aims to be a PHP equivalent of the well known Java tool PMD.", + "homepage": "https://phpmd.org/", "keywords": [ - "diff" + "mess detection", + "mess detector", + "pdepend", + "phpmd", + "pmd" + ], + "support": { + "irc": "irc://irc.freenode.org/phpmd", + "issues": "https://github.com/phpmd/phpmd/issues", + "source": "https://github.com/phpmd/phpmd/tree/2.11.1" + }, + "funding": [ + { + "url": "https://tidelift.com/funding/github/packagist/phpmd/phpmd", + "type": "tidelift" + } ], - "time": "2017-05-22T07:24:03+00:00" + "time": "2021-12-17T11:25:43+00:00" }, { - "name": "sebastian/environment", - "version": "2.0.0", + "name": "phpspec/php-diff", + "version": "v1.1.3", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac" + "url": "https://github.com/phpspec/php-diff.git", + "reference": "fc1156187f9f6c8395886fe85ed88a0a245d72e9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/5795ffe5dc5b02460c3e34222fee8cbe245d8fac", - "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac", + "url": "https://api.github.com/repos/phpspec/php-diff/zipball/fc1156187f9f6c8395886fe85ed88a0a245d72e9", + "reference": "fc1156187f9f6c8395886fe85ed88a0a245d72e9", "shasum": "" }, - "require": { - "php": "^5.6 || ^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^5.0" - }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "1.0.x-dev" } }, "autoload": { - "classmap": [ - "src/" - ] + "psr-0": { + "Diff": "lib/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1219,162 +1418,212 @@ ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "name": "Chris Boulton", + "homepage": "http://github.com/chrisboulton" } ], - "description": "Provides functionality to handle HHVM/PHP environments", - "homepage": "http://www.github.com/sebastianbergmann/environment", - "keywords": [ - "Xdebug", - "environment", - "hhvm" - ], - "time": "2016-11-26T07:53:53+00:00" + "description": "A comprehensive library for generating differences between two hashable objects (strings or arrays).", + "support": { + "source": "https://github.com/phpspec/php-diff/tree/v1.1.3" + }, + "time": "2020-09-18T13:47:07+00:00" }, { - "name": "sebastian/exporter", - "version": "2.0.0", + "name": "phpspec/phpspec", + "version": "7.1.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4" + "url": "https://github.com/phpspec/phpspec.git", + "reference": "30dc06a0f20642d9589bb644fbcfcb1692828699" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", - "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", + "url": "https://api.github.com/repos/phpspec/phpspec/zipball/30dc06a0f20642d9589bb644fbcfcb1692828699", + "reference": "30dc06a0f20642d9589bb644fbcfcb1692828699", "shasum": "" }, "require": { - "php": ">=5.3.3", - "sebastian/recursion-context": "~2.0" + "doctrine/instantiator": "^1.0.5", + "ext-tokenizer": "*", + "php": "^7.3 || 8.0.*", + "phpspec/php-diff": "^1.0.0", + "phpspec/prophecy": "^1.9", + "sebastian/exporter": "^3.0 || ^4.0", + "symfony/console": "^3.4 || ^4.4 || ^5.0", + "symfony/event-dispatcher": "^3.4 || ^4.4 || ^5.0", + "symfony/finder": "^3.4 || ^4.4 || ^5.0", + "symfony/process": "^3.4 || ^4.4 || ^5.0", + "symfony/yaml": "^3.4 || ^4.4 || ^5.0" + }, + "conflict": { + "sebastian/comparator": "<1.2.4" }, "require-dev": { - "ext-mbstring": "*", - "phpunit/phpunit": "~4.4" + "behat/behat": "^3.3", + "phpunit/phpunit": "^8.0 || ^9.0", + "symfony/filesystem": "^3.4 || ^4.0 || ^5.0", + "vimeo/psalm": "^4.3" + }, + "suggest": { + "phpspec/nyan-formatters": "Adds Nyan formatters" }, + "bin": [ + "bin/phpspec" + ], "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-main": "7.1.x-dev" } }, "autoload": { - "classmap": [ - "src/" - ] + "psr-0": { + "PhpSpec": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" }, { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "name": "Marcello Duarte", + "homepage": "http://marcelloduarte.net/" }, { - "name": "Adam Harvey", - "email": "aharvey@php.net" + "name": "Ciaran McNulty", + "homepage": "https://ciaranmcnulty.com/" } ], - "description": "Provides the functionality to export PHP variables for visualization", - "homepage": "http://www.github.com/sebastianbergmann/exporter", + "description": "Specification-oriented BDD framework for PHP 7.1+", + "homepage": "http://phpspec.net/", "keywords": [ - "export", - "exporter" + "BDD", + "SpecBDD", + "TDD", + "spec", + "specification", + "testing", + "tests" ], - "time": "2016-11-19T08:54:04+00:00" + "support": { + "issues": "https://github.com/phpspec/phpspec/issues", + "source": "https://github.com/phpspec/phpspec/tree/7.1.0" + }, + "time": "2021-06-19T16:10:14+00:00" }, { - "name": "sebastian/global-state", - "version": "1.1.1", + "name": "phpspec/prophecy", + "version": "v1.15.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4" + "url": "https://github.com/phpspec/prophecy.git", + "reference": "bbcd7380b0ebf3961ee21409db7b38bc31d69a13" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4", - "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/bbcd7380b0ebf3961ee21409db7b38bc31d69a13", + "reference": "bbcd7380b0ebf3961ee21409db7b38bc31d69a13", "shasum": "" }, "require": { - "php": ">=5.3.3" + "doctrine/instantiator": "^1.2", + "php": "^7.2 || ~8.0, <8.2", + "phpdocumentor/reflection-docblock": "^5.2", + "sebastian/comparator": "^3.0 || ^4.0", + "sebastian/recursion-context": "^3.0 || ^4.0" }, "require-dev": { - "phpunit/phpunit": "~4.2" - }, - "suggest": { - "ext-uopz": "*" + "phpspec/phpspec": "^6.0 || ^7.0", + "phpunit/phpunit": "^8.0 || ^9.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-master": "1.x-dev" } }, "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "Prophecy\\": "src/Prophecy" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + }, + { + "name": "Marcello Duarte", + "email": "marcello.duarte@gmail.com" } ], - "description": "Snapshotting of global state", - "homepage": "http://www.github.com/sebastianbergmann/global-state", + "description": "Highly opinionated mocking framework for PHP 5.3+", + "homepage": "https://github.com/phpspec/prophecy", "keywords": [ - "global state" + "Double", + "Dummy", + "fake", + "mock", + "spy", + "stub" ], - "time": "2015-10-12T03:26:01+00:00" + "support": { + "issues": "https://github.com/phpspec/prophecy/issues", + "source": "https://github.com/phpspec/prophecy/tree/v1.15.0" + }, + "time": "2021-12-08T12:19:24+00:00" }, { - "name": "sebastian/object-enumerator", - "version": "2.0.1", + "name": "phpunit/php-code-coverage", + "version": "9.2.10", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7" + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "d5850aaf931743067f4bfc1ae4cbd06468400687" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/1311872ac850040a79c3c058bea3e22d0f09cbb7", - "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/d5850aaf931743067f4bfc1ae4cbd06468400687", + "reference": "d5850aaf931743067f4bfc1ae4cbd06468400687", "shasum": "" }, "require": { - "php": ">=5.6", - "sebastian/recursion-context": "~2.0" + "ext-dom": "*", + "ext-libxml": "*", + "ext-xmlwriter": "*", + "nikic/php-parser": "^4.13.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": "~5" + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-pcov": "*", + "ext-xdebug": "*" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "9.2-dev" } }, "autoload": { @@ -1389,235 +1638,2452 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "email": "sebastian@phpunit.de", + "role": "lead" } ], - "description": "Traverses array structures and object graphs to enumerate all referenced objects", - "homepage": "https://github.com/sebastianbergmann/object-enumerator/", - "time": "2017-02-18T15:18:39+00:00" + "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", + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.10" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2021-12-05T09:12:13+00:00" }, { - "name": "sebastian/recursion-context", - "version": "2.0.0", + "name": "phpunit/php-file-iterator", + "version": "3.0.6", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a" + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/2c3ba150cbec723aa057506e73a8d33bdb286c9a", - "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", + "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "~4.4" + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "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.5.13", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "597cb647654ede35e43b137926dfdfef0fb11743" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/597cb647654ede35e43b137926dfdfef0fb11743", + "reference": "597cb647654ede35e43b137926dfdfef0fb11743", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.3.1", + "ext-dom": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xml": "*", + "ext-xmlwriter": "*", + "myclabs/deep-copy": "^1.10.1", + "phar-io/manifest": "^2.0.3", + "phar-io/version": "^3.0.2", + "php": ">=7.3", + "phpspec/prophecy": "^1.12.1", + "phpunit/php-code-coverage": "^9.2.7", + "phpunit/php-file-iterator": "^3.0.5", + "phpunit/php-invoker": "^3.1.1", + "phpunit/php-text-template": "^2.0.3", + "phpunit/php-timer": "^5.0.2", + "sebastian/cli-parser": "^1.0.1", + "sebastian/code-unit": "^1.0.6", + "sebastian/comparator": "^4.0.5", + "sebastian/diff": "^4.0.3", + "sebastian/environment": "^5.1.3", + "sebastian/exporter": "^4.0.3", + "sebastian/global-state": "^5.0.1", + "sebastian/object-enumerator": "^4.0.3", + "sebastian/resource-operations": "^3.0.3", + "sebastian/type": "^2.3.4", + "sebastian/version": "^3.0.2" + }, + "require-dev": { + "ext-pdo": "*", + "phpspec/prophecy-phpunit": "^2.0.1" + }, + "suggest": { + "ext-soap": "*", + "ext-xdebug": "*" + }, + "bin": [ + "phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "9.5-dev" } }, "autoload": { "classmap": [ "src/" + ], + "files": [ + "src/Framework/Assert/Functions.php" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], - "authors": [ + "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", + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.13" + }, + "funding": [ + { + "url": "https://phpunit.de/sponsors.html", + "type": "custom" + }, + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2022-01-24T07:33:35+00:00" + }, + { + "name": "psr/container", + "version": "1.1.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "513e0666f7216c7459170d56df27dfcefe1689ea" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/513e0666f7216c7459170d56df27dfcefe1689ea", + "reference": "513e0666f7216c7459170d56df27dfcefe1689ea", + "shasum": "" + }, + "require": { + "php": ">=7.4.0" + }, + "type": "library", + "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/1.1.2" + }, + "time": "2021-11-05T16:50:12+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/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": "sebastian/cli-parser", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/cli-parser.git", + "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/442e7c7e687e42adc03470c7b668bc4b2402c0b2", + "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2", + "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.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T06:08:49+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.6", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "55f4261989e546dc112258c7a75935a81a7ce382" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/55f4261989e546dc112258c7a75935a81a7ce382", + "reference": "55f4261989e546dc112258c7a75935a81a7ce382", + "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.6" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T15:49:45+00:00" + }, + { + "name": "sebastian/complexity", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/complexity.git", + "reference": "739b35e53379900cc9ac327b2147867b8b6efd88" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/739b35e53379900cc9ac327b2147867b8b6efd88", + "reference": "739b35e53379900cc9ac327b2147867b8b6efd88", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^4.7", + "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.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T15:52:27+00:00" + }, + { + "name": "sebastian/diff", + "version": "4.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/3461e3fccc7cfdfc2720be910d3bd73c69be590d", + "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d", + "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.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:10:38+00:00" + }, + { + "name": "sebastian/environment", + "version": "5.1.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "388b6ced16caa751030f6a69e588299fa09200ac" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/388b6ced16caa751030f6a69e588299fa09200ac", + "reference": "388b6ced16caa751030f6a69e588299fa09200ac", + "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.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:52:38+00:00" + }, + { + "name": "sebastian/exporter", + "version": "4.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "65e8b7db476c5dd267e65eea9cab77584d3cfff9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/65e8b7db476c5dd267e65eea9cab77584d3cfff9", + "reference": "65e8b7db476c5dd267e65eea9cab77584d3cfff9", + "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.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2021-11-11T14:18:36+00:00" + }, + { + "name": "sebastian/global-state", + "version": "5.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "23bd5951f7ff26f12d4e3242864df3e08dec4e49" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/23bd5951f7ff26f12d4e3242864df3e08dec4e49", + "reference": "23bd5951f7ff26f12d4e3242864df3e08dec4e49", + "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.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2021-06-11T13:31:12+00:00" + }, + { + "name": "sebastian/lines-of-code", + "version": "1.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/lines-of-code.git", + "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/c1c2e997aa3146983ed888ad08b15470a2e22ecc", + "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^4.6", + "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.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-11-28T06:42:11+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.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "cd9d8cf3c5804de4341c283ed787f099f5506172" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/cd9d8cf3c5804de4341c283ed787f099f5506172", + "reference": "cd9d8cf3c5804de4341c283ed787f099f5506172", + "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": "http://www.github.com/sebastianbergmann/recursion-context", + "support": { + "issues": "https://github.com/sebastianbergmann/recursion-context/issues", + "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:17:30+00:00" + }, + { + "name": "sebastian/resource-operations", + "version": "3.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/resource-operations.git", + "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", + "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.0" + }, + "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" + } + ], + "description": "Provides a list of PHP built-in functions that operate on resources", + "homepage": "https://www.github.com/sebastianbergmann/resource-operations", + "support": { + "issues": "https://github.com/sebastianbergmann/resource-operations/issues", + "source": "https://github.com/sebastianbergmann/resource-operations/tree/3.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T06:45:17+00:00" + }, + { + "name": "sebastian/type", + "version": "2.3.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/type.git", + "reference": "b8cd8a1c753c90bc1a0f5372170e3e489136f914" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/b8cd8a1c753c90bc1a0f5372170e3e489136f914", + "reference": "b8cd8a1c753c90bc1a0f5372170e3e489136f914", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3-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/2.3.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2021-06-15T12:49:02+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": "squizlabs/php_codesniffer", + "version": "3.6.2", + "source": { + "type": "git", + "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", + "reference": "5e4e71592f69da17871dba6e80dd51bce74a351a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/5e4e71592f69da17871dba6e80dd51bce74a351a", + "reference": "5e4e71592f69da17871dba6e80dd51bce74a351a", + "shasum": "" + }, + "require": { + "ext-simplexml": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": ">=5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" + }, + "bin": [ + "bin/phpcs", + "bin/phpcbf" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Greg Sherwood", + "role": "lead" + } + ], + "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", + "homepage": "https://github.com/squizlabs/PHP_CodeSniffer", + "keywords": [ + "phpcs", + "standards" + ], + "support": { + "issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues", + "source": "https://github.com/squizlabs/PHP_CodeSniffer", + "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki" + }, + "time": "2021-12-12T21:44:58+00:00" + }, + { + "name": "symfony/config", + "version": "v5.4.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/config.git", + "reference": "d65e1bd990c740e31feb07d2b0927b8d4df9956f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/config/zipball/d65e1bd990c740e31feb07d2b0927b8d4df9956f", + "reference": "d65e1bd990c740e31feb07d2b0927b8d4df9956f", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/filesystem": "^4.4|^5.0|^6.0", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-php80": "^1.16", + "symfony/polyfill-php81": "^1.22" + }, + "conflict": { + "symfony/finder": "<4.4" + }, + "require-dev": { + "symfony/event-dispatcher": "^4.4|^5.0|^6.0", + "symfony/finder": "^4.4|^5.0|^6.0", + "symfony/messenger": "^4.4|^5.0|^6.0", + "symfony/service-contracts": "^1.1|^2|^3", + "symfony/yaml": "^4.4|^5.0|^6.0" + }, + "suggest": { + "symfony/yaml": "To use the yaml reference dumper" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Config\\": "" + }, + "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": "Helps you find, load, combine, autofill and validate configuration values of any kind", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/config/tree/v5.4.3" + }, + "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-03T09:50:52+00:00" + }, + { + "name": "symfony/console", + "version": "v5.4.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "a2a86ec353d825c75856c6fd14fac416a7bdb6b8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/a2a86ec353d825c75856c6fd14fac416a7bdb6b8", + "reference": "a2a86ec353d825c75856c6fd14fac416a7bdb6b8", + "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.3" + }, + "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-26T16:28:35+00:00" + }, + { + "name": "symfony/dependency-injection", + "version": "v5.4.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/dependency-injection.git", + "reference": "974580fd67f14d65b045c11b09eb149cd4b13df5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/974580fd67f14d65b045c11b09eb149cd4b13df5", + "reference": "974580fd67f14d65b045c11b09eb149cd4b13df5", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "psr/container": "^1.1.1", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/polyfill-php80": "^1.16", + "symfony/polyfill-php81": "^1.22", + "symfony/service-contracts": "^1.1.6|^2" + }, + "conflict": { + "ext-psr": "<1.1|>=2", + "symfony/config": "<5.3", + "symfony/finder": "<4.4", + "symfony/proxy-manager-bridge": "<4.4", + "symfony/yaml": "<4.4" + }, + "provide": { + "psr/container-implementation": "1.0", + "symfony/service-implementation": "1.0|2.0" + }, + "require-dev": { + "symfony/config": "^5.3|^6.0", + "symfony/expression-language": "^4.4|^5.0|^6.0", + "symfony/yaml": "^4.4|^5.0|^6.0" + }, + "suggest": { + "symfony/config": "", + "symfony/expression-language": "For using expressions in service container configuration", + "symfony/finder": "For using double-star glob patterns or when GLOB_BRACE portability is required", + "symfony/proxy-manager-bridge": "Generate service proxies to lazy load them", + "symfony/yaml": "" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\DependencyInjection\\": "" + }, + "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": "Allows you to standardize and centralize the way objects are constructed in your application", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/dependency-injection/tree/v5.4.3" + }, + "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-26T16:28:35+00:00" + }, + { + "name": "symfony/deprecation-contracts", + "version": "v3.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "c726b64c1ccfe2896cb7df2e1331c357ad1c8ced" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/c726b64c1ccfe2896cb7df2e1331c357ad1c8ced", + "reference": "c726b64c1ccfe2896cb7df2e1331c357ad1c8ced", + "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.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": "2021-11-01T23:48:49+00:00" + }, + { + "name": "symfony/event-dispatcher", + "version": "v5.4.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher.git", + "reference": "dec8a9f58d20df252b9cd89f1c6c1530f747685d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/dec8a9f58d20df252b9cd89f1c6c1530f747685d", + "reference": "dec8a9f58d20df252b9cd89f1c6c1530f747685d", + "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.3" + }, + "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:53:40+00:00" + }, + { + "name": "symfony/event-dispatcher-contracts", + "version": "v3.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher-contracts.git", + "reference": "aa5422287b75594b90ee9cd807caf8f0df491385" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/aa5422287b75594b90ee9cd807caf8f0df491385", + "reference": "aa5422287b75594b90ee9cd807caf8f0df491385", + "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.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": "2021-07-15T12:33:35+00:00" + }, + { + "name": "symfony/filesystem", + "version": "v5.4.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/filesystem.git", + "reference": "0f0c4bf1840420f4aef3f32044a9dbb24682731b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/0f0c4bf1840420f4aef3f32044a9dbb24682731b", + "reference": "0f0c4bf1840420f4aef3f32044a9dbb24682731b", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-mbstring": "~1.8", + "symfony/polyfill-php80": "^1.16" + }, + "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/v5.4.3" + }, + "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:53:40+00:00" + }, + { + "name": "symfony/finder", + "version": "v5.4.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/finder.git", + "reference": "231313534dded84c7ecaa79d14bc5da4ccb69b7d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/finder/zipball/231313534dded84c7ecaa79d14bc5da4ccb69b7d", + "reference": "231313534dded84c7ecaa79d14bc5da4ccb69b7d", + "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.3" + }, + "funding": [ { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" + "url": "https://symfony.com/sponsor", + "type": "custom" }, { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "url": "https://github.com/fabpot", + "type": "github" }, { - "name": "Adam Harvey", - "email": "aharvey@php.net" + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" } ], - "description": "Provides functionality to recursively process PHP variables", - "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2016-11-19T07:33:16+00:00" + "time": "2022-01-26T16:34:36+00:00" }, { - "name": "sebastian/resource-operations", - "version": "1.0.0", + "name": "symfony/polyfill-ctype", + "version": "v1.24.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/resource-operations.git", - "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52" + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "30885182c981ab175d4d034db0f6f469898070ab" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", - "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/30885182c981ab175d4d034db0f6f469898070ab", + "reference": "30885182c981ab175d4d034db0f6f469898070ab", "shasum": "" }, "require": { - "php": ">=5.6.0" + "php": ">=7.1" + }, + "provide": { + "ext-ctype": "*" + }, + "suggest": { + "ext-ctype": "For best performance" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } }, "autoload": { - "classmap": [ - "src/" + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + }, + "files": [ + "bootstrap.php" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Provides a list of PHP built-in functions that operate on resources", - "homepage": "https://www.github.com/sebastianbergmann/resource-operations", - "time": "2015-07-28T20:34:47+00:00" + "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.24.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": "2021-10-20T20:35:02+00:00" }, { - "name": "sebastian/version", - "version": "2.0.1", + "name": "symfony/polyfill-intl-grapheme", + "version": "v1.24.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/version.git", - "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019" + "url": "https://github.com/symfony/polyfill-intl-grapheme.git", + "reference": "81b86b50cf841a64252b439e738e97f4a34e2783" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019", - "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/81b86b50cf841a64252b439e738e97f4a34e2783", + "reference": "81b86b50cf841a64252b439e738e97f4a34e2783", "shasum": "" }, "require": { - "php": ">=5.6" + "php": ">=7.1" + }, + "suggest": { + "ext-intl": "For best performance" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } }, "autoload": { - "classmap": [ - "src/" + "psr-4": { + "Symfony\\Polyfill\\Intl\\Grapheme\\": "" + }, + "files": [ + "bootstrap.php" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "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" + "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.24.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": "2021-11-23T21:10:46+00:00" }, { - "name": "squizlabs/php_codesniffer", - "version": "3.4.0", + "name": "symfony/polyfill-intl-normalizer", + "version": "v1.24.0", "source": { "type": "git", - "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "379deb987e26c7cd103a7b387aea178baec96e48" + "url": "https://github.com/symfony/polyfill-intl-normalizer.git", + "reference": "8590a5f561694770bdcd3f9b5c69dde6945028e8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/379deb987e26c7cd103a7b387aea178baec96e48", - "reference": "379deb987e26c7cd103a7b387aea178baec96e48", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/8590a5f561694770bdcd3f9b5c69dde6945028e8", + "reference": "8590a5f561694770bdcd3f9b5c69dde6945028e8", "shasum": "" }, "require": { - "ext-simplexml": "*", - "ext-tokenizer": "*", - "ext-xmlwriter": "*", - "php": ">=5.4.0" + "php": ">=7.1" }, - "require-dev": { - "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" + "suggest": { + "ext-intl": "For best performance" }, - "bin": [ - "bin/phpcs", - "bin/phpcbf" - ], "type": "library", "extra": { "branch-alias": { - "dev-master": "3.x-dev" + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Intl\\Normalizer\\": "" + }, + "files": [ + "bootstrap.php" + ], + "classmap": [ + "Resources/stubs" + ] + }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Greg Sherwood", - "role": "lead" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", - "homepage": "http://www.squizlabs.com/php-codesniffer", + "description": "Symfony polyfill for intl's Normalizer class and related functions", + "homepage": "https://symfony.com", "keywords": [ - "phpcs", - "standards" + "compatibility", + "intl", + "normalizer", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.24.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": "2018-12-19T23:57:18+00:00" + "time": "2021-02-19T12:13:01+00:00" }, { - "name": "symfony/config", - "version": "v3.1.0", + "name": "symfony/polyfill-mbstring", + "version": "v1.24.0", "source": { "type": "git", - "url": "https://github.com/symfony/config.git", - "reference": "048dc47e07f92333203c3b7045868bbc864fc40e" + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "0abb51d2f102e00a4eefcf46ba7fec406d245825" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/048dc47e07f92333203c3b7045868bbc864fc40e", - "reference": "048dc47e07f92333203c3b7045868bbc864fc40e", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/0abb51d2f102e00a4eefcf46ba7fec406d245825", + "reference": "0abb51d2f102e00a4eefcf46ba7fec406d245825", "shasum": "" }, "require": { - "php": ">=5.5.9", - "symfony/filesystem": "~2.8|~3.0" + "php": ">=7.1" + }, + "provide": { + "ext-mbstring": "*" }, "suggest": { - "symfony/yaml": "To use the yaml reference dumper" + "ext-mbstring": "For best performance" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1-dev" + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } }, "autoload": { "psr-4": { - "Symfony\\Component\\Config\\": "" + "Symfony\\Polyfill\\Mbstring\\": "" }, - "exclude-from-classmap": [ - "/Tests/" + "files": [ + "bootstrap.php" ] }, "notification-url": "https://packagist.org/downloads/", @@ -1626,58 +4092,78 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony Config Component", + "description": "Symfony polyfill for the Mbstring extension", "homepage": "https://symfony.com", - "time": "2016-05-20T11:48:17+00:00" + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.24.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": "2021-11-30T18:21:41+00:00" }, { - "name": "symfony/console", - "version": "v2.8.6", + "name": "symfony/polyfill-php73", + "version": "v1.24.0", "source": { "type": "git", - "url": "https://github.com/symfony/console.git", - "reference": "48221d3de4dc22d2cd57c97e8b9361821da86609" + "url": "https://github.com/symfony/polyfill-php73.git", + "reference": "cc5db0e22b3cb4111010e48785a97f670b350ca5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/48221d3de4dc22d2cd57c97e8b9361821da86609", - "reference": "48221d3de4dc22d2cd57c97e8b9361821da86609", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/cc5db0e22b3cb4111010e48785a97f670b350ca5", + "reference": "cc5db0e22b3cb4111010e48785a97f670b350ca5", "shasum": "" }, "require": { - "php": ">=5.3.9", - "symfony/polyfill-mbstring": "~1.0" - }, - "require-dev": { - "psr/log": "~1.0", - "symfony/event-dispatcher": "~2.1|~3.0.0", - "symfony/process": "~2.1|~3.0.0" - }, - "suggest": { - "psr/log": "For using the console logger", - "symfony/event-dispatcher": "", - "symfony/process": "" + "php": ">=7.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.8-dev" + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } }, "autoload": { "psr-4": { - "Symfony\\Component\\Console\\": "" + "Symfony\\Polyfill\\Php73\\": "" }, - "exclude-from-classmap": [ - "/Tests/" + "files": [ + "bootstrap.php" + ], + "classmap": [ + "Resources/stubs" ] }, "notification-url": "https://packagist.org/downloads/", @@ -1686,58 +4172,77 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony Console Component", + "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", "homepage": "https://symfony.com", - "time": "2016-04-26T12:00:47+00:00" + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php73/tree/v1.24.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": "2021-06-05T21:20:04+00:00" }, { - "name": "symfony/dependency-injection", - "version": "v3.1.0", + "name": "symfony/polyfill-php80", + "version": "v1.24.0", "source": { "type": "git", - "url": "https://github.com/symfony/dependency-injection.git", - "reference": "383110341e8f47ae972da3a29503b099831549e1" + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "57b712b08eddb97c762a8caa32c84e037892d2e9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/383110341e8f47ae972da3a29503b099831549e1", - "reference": "383110341e8f47ae972da3a29503b099831549e1", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/57b712b08eddb97c762a8caa32c84e037892d2e9", + "reference": "57b712b08eddb97c762a8caa32c84e037892d2e9", "shasum": "" }, "require": { - "php": ">=5.5.9" - }, - "require-dev": { - "symfony/config": "~2.8|~3.0", - "symfony/expression-language": "~2.8|~3.0", - "symfony/yaml": "~2.8|~3.0" - }, - "suggest": { - "symfony/config": "", - "symfony/expression-language": "For using expressions in service container configuration", - "symfony/proxy-manager-bridge": "Generate service proxies to lazy load them", - "symfony/yaml": "" + "php": ">=7.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1-dev" + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } }, "autoload": { "psr-4": { - "Symfony\\Component\\DependencyInjection\\": "" + "Symfony\\Polyfill\\Php80\\": "" }, - "exclude-from-classmap": [ - "/Tests/" + "files": [ + "bootstrap.php" + ], + "classmap": [ + "Resources/stubs" ] }, "notification-url": "https://packagist.org/downloads/", @@ -1746,58 +4251,81 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" + "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 DependencyInjection Component", - "homepage": "https://symfony.com", - "time": "2016-05-24T10:06:56+00:00" + "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.24.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": "2021-09-13T13:58:33+00:00" }, { - "name": "symfony/event-dispatcher", - "version": "v3.2.14", + "name": "symfony/polyfill-php81", + "version": "v1.24.0", "source": { "type": "git", - "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "b8de6ee252af19330dd72ad5fc0dd4658a1d6325" + "url": "https://github.com/symfony/polyfill-php81.git", + "reference": "5de4ba2d41b15f9bd0e19b2ab9674135813ec98f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/b8de6ee252af19330dd72ad5fc0dd4658a1d6325", - "reference": "b8de6ee252af19330dd72ad5fc0dd4658a1d6325", + "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/5de4ba2d41b15f9bd0e19b2ab9674135813ec98f", + "reference": "5de4ba2d41b15f9bd0e19b2ab9674135813ec98f", "shasum": "" }, "require": { - "php": ">=5.5.9" - }, - "require-dev": { - "psr/log": "~1.0", - "symfony/config": "~2.8|~3.0", - "symfony/dependency-injection": "~2.8|~3.0", - "symfony/expression-language": "~2.8|~3.0", - "symfony/stopwatch": "~2.8|~3.0" - }, - "suggest": { - "symfony/dependency-injection": "", - "symfony/http-kernel": "" + "php": ">=7.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.2-dev" + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } }, "autoload": { "psr-4": { - "Symfony\\Component\\EventDispatcher\\": "" + "Symfony\\Polyfill\\Php81\\": "" }, - "exclude-from-classmap": [ - "/Tests/" + "files": [ + "bootstrap.php" + ], + "classmap": [ + "Resources/stubs" ] }, "notification-url": "https://packagist.org/downloads/", @@ -1806,44 +4334,63 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony EventDispatcher Component", + "description": "Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions", "homepage": "https://symfony.com", - "time": "2017-06-02T08:26:05+00:00" + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php81/tree/v1.24.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": "2021-09-13T13:58:11+00:00" }, { - "name": "symfony/filesystem", - "version": "v3.1.0", + "name": "symfony/process", + "version": "v5.4.3", "source": { "type": "git", - "url": "https://github.com/symfony/filesystem.git", - "reference": "5751e80d6f94b7c018f338a4a7be0b700d6f3058" + "url": "https://github.com/symfony/process.git", + "reference": "553f50487389a977eb31cf6b37faae56da00f753" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/5751e80d6f94b7c018f338a4a7be0b700d6f3058", - "reference": "5751e80d6f94b7c018f338a4a7be0b700d6f3058", + "url": "https://api.github.com/repos/symfony/process/zipball/553f50487389a977eb31cf6b37faae56da00f753", + "reference": "553f50487389a977eb31cf6b37faae56da00f753", "shasum": "" }, "require": { - "php": ">=5.5.9" + "php": ">=7.2.5", + "symfony/polyfill-php80": "^1.16" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.1-dev" - } - }, "autoload": { "psr-4": { - "Symfony\\Component\\Filesystem\\": "" + "Symfony\\Component\\Process\\": "" }, "exclude-from-classmap": [ "/Tests/" @@ -1863,40 +4410,65 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony Filesystem Component", + "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", - "time": "2016-04-12T18:27:47+00:00" + "support": { + "source": "https://github.com/symfony/process/tree/v5.4.3" + }, + "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-26T16:28:35+00:00" }, { - "name": "symfony/finder", - "version": "v3.4.21", + "name": "symfony/service-contracts", + "version": "v2.4.1", "source": { "type": "git", - "url": "https://github.com/symfony/finder.git", - "reference": "3f2a2ab6315dd7682d4c16dcae1e7b95c8b8555e" + "url": "https://github.com/symfony/service-contracts.git", + "reference": "d664541b99d6fb0247ec5ff32e87238582236204" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/3f2a2ab6315dd7682d4c16dcae1e7b95c8b8555e", - "reference": "3f2a2ab6315dd7682d4c16dcae1e7b95c8b8555e", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/d664541b99d6fb0247ec5ff32e87238582236204", + "reference": "d664541b99d6fb0247ec5ff32e87238582236204", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8" + "php": ">=7.2.5", + "psr/container": "^1.1" + }, + "conflict": { + "ext-psr": "<1.1|>=2" + }, + "suggest": { + "symfony/service-implementation": "" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.4-dev" + "dev-main": "2.4-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" } }, "autoload": { "psr-4": { - "Symfony\\Component\\Finder\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] + "Symfony\\Contracts\\Service\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1904,50 +4476,83 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony Finder Component", + "description": "Generic abstractions related to writing services", "homepage": "https://symfony.com", - "time": "2019-01-01T13:45:19+00:00" + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/service-contracts/tree/v2.4.1" + }, + "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": "2021-11-04T16:37:19+00:00" }, { - "name": "symfony/polyfill-ctype", - "version": "v1.10.0", + "name": "symfony/string", + "version": "v6.0.3", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "e3d826245268269cd66f8326bd8bc066687b4a19" + "url": "https://github.com/symfony/string.git", + "reference": "522144f0c4c004c80d56fa47e40e17028e2eefc2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/e3d826245268269cd66f8326bd8bc066687b4a19", - "reference": "e3d826245268269cd66f8326bd8bc066687b4a19", + "url": "https://api.github.com/repos/symfony/string/zipball/522144f0c4c004c80d56fa47e40e17028e2eefc2", + "reference": "522144f0c4c004c80d56fa47e40e17028e2eefc2", "shasum": "" }, "require": { - "php": ">=5.3.3" + "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" }, - "suggest": { - "ext-ctype": "For best performance" + "conflict": { + "symfony/translation-contracts": "<2.0" }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.9-dev" - } + "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": { "psr-4": { - "Symfony\\Polyfill\\Ctype\\": "" + "Symfony\\Component\\String\\": "" }, "files": [ - "bootstrap.php" + "Resources/functions.php" + ], + "exclude-from-classmap": [ + "/Tests/" ] }, "notification-url": "https://packagist.org/downloads/", @@ -1956,56 +4561,81 @@ ], "authors": [ { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" }, { - "name": "Gert de Pagter", - "email": "BackEndTea@gmail.com" + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill for ctype functions", + "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": [ - "compatibility", - "ctype", - "polyfill", - "portable" + "grapheme", + "i18n", + "string", + "unicode", + "utf-8", + "utf8" + ], + "support": { + "source": "https://github.com/symfony/string/tree/v6.0.3" + }, + "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": "2018-08-06T14:22:27+00:00" + "time": "2022-01-02T09:55:41+00:00" }, { - "name": "symfony/polyfill-mbstring", - "version": "v1.2.0", + "name": "symfony/yaml", + "version": "v5.4.3", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "dff51f72b0706335131b00a7f49606168c582594" + "url": "https://github.com/symfony/yaml.git", + "reference": "e80f87d2c9495966768310fc531b487ce64237a2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/dff51f72b0706335131b00a7f49606168c582594", - "reference": "dff51f72b0706335131b00a7f49606168c582594", + "url": "https://api.github.com/repos/symfony/yaml/zipball/e80f87d2c9495966768310fc531b487ce64237a2", + "reference": "e80f87d2c9495966768310fc531b487ce64237a2", "shasum": "" }, "require": { - "php": ">=5.3.3" + "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": { - "ext-mbstring": "For best performance" + "symfony/console": "For validating YAML files using the lint command" }, + "bin": [ + "Resources/bin/yaml-lint" + ], "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2-dev" - } - }, "autoload": { "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" + "Symfony\\Component\\Yaml\\": "" }, - "files": [ - "bootstrap.php" + "exclude-from-classmap": [ + "/Tests/" ] }, "notification-url": "https://packagist.org/downloads/", @@ -2014,109 +4644,168 @@ ], "authors": [ { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill for the Mbstring extension", + "description": "Loads and dumps YAML files", "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "mbstring", - "polyfill", - "portable", - "shim" + "support": { + "source": "https://github.com/symfony/yaml/tree/v5.4.3" + }, + "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": "2016-05-18T14:26:46+00:00" + "time": "2022-01-26T16:32:32+00:00" }, { - "name": "symfony/process", - "version": "v3.4.21", + "name": "theseer/tokenizer", + "version": "1.2.1", "source": { "type": "git", - "url": "https://github.com/symfony/process.git", - "reference": "0d41dd7d95ed179aed6a13393b0f4f97bfa2d25c" + "url": "https://github.com/theseer/tokenizer.git", + "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/0d41dd7d95ed179aed6a13393b0f4f97bfa2d25c", - "reference": "0d41dd7d95ed179aed6a13393b0f4f97bfa2d25c", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/34a41e998c2183e22995f158c581e7b5e755ab9e", + "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8" + "ext-dom": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": "^7.2 || ^8.0" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.4-dev" - } - }, "autoload": { - "psr-4": { - "Symfony\\Component\\Process\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" + "classmap": [ + "src/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, + "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.1" + }, + "funding": [ { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "url": "https://github.com/theseer", + "type": "github" } ], - "description": "Symfony Process Component", - "homepage": "https://symfony.com", - "time": "2019-01-02T21:24:08+00:00" + "time": "2021-07-28T10:34:58+00:00" }, { - "name": "symfony/yaml", - "version": "v3.3.18", + "name": "vimeo/psalm", + "version": "4.19.0", "source": { "type": "git", - "url": "https://github.com/symfony/yaml.git", - "reference": "af615970e265543a26ee712c958404eb9b7ac93d" + "url": "https://github.com/vimeo/psalm.git", + "reference": "a2ad69ae4f5ab1f7d225a8dc4e2ec2d9415ed599" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/af615970e265543a26ee712c958404eb9b7ac93d", - "reference": "af615970e265543a26ee712c958404eb9b7ac93d", + "url": "https://api.github.com/repos/vimeo/psalm/zipball/a2ad69ae4f5ab1f7d225a8dc4e2ec2d9415ed599", + "reference": "a2ad69ae4f5ab1f7d225a8dc4e2ec2d9415ed599", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8" + "amphp/amp": "^2.4.2", + "amphp/byte-stream": "^1.5", + "composer/package-versions-deprecated": "^1.8.0", + "composer/semver": "^1.4 || ^2.0 || ^3.0", + "composer/xdebug-handler": "^1.1 || ^2.0 || ^3.0", + "dnoegel/php-xdg-base-dir": "^0.1.1", + "ext-ctype": "*", + "ext-dom": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-simplexml": "*", + "ext-tokenizer": "*", + "felixfbecker/advanced-json-rpc": "^3.0.3", + "felixfbecker/language-server-protocol": "^1.5", + "netresearch/jsonmapper": "^1.0 || ^2.0 || ^3.0 || ^4.0", + "nikic/php-parser": "^4.13", + "openlss/lib-array2xml": "^1.0", + "php": "^7.1|^8", + "sebastian/diff": "^3.0 || ^4.0", + "symfony/console": "^3.4.17 || ^4.1.6 || ^5.0 || ^6.0", + "webmozart/path-util": "^2.3" + }, + "provide": { + "psalm/psalm": "self.version" }, "require-dev": { - "symfony/console": "~2.8|~3.0" + "bamarni/composer-bin-plugin": "^1.2", + "brianium/paratest": "^4.0||^6.0", + "ext-curl": "*", + "php-parallel-lint/php-parallel-lint": "^1.2", + "phpdocumentor/reflection-docblock": "^5", + "phpmyadmin/sql-parser": "5.1.0||dev-master", + "phpspec/prophecy": ">=1.9.0", + "phpunit/phpunit": "^9.0", + "psalm/plugin-phpunit": "^0.16", + "slevomat/coding-standard": "^7.0", + "squizlabs/php_codesniffer": "^3.5", + "symfony/process": "^4.3 || ^5.0 || ^6.0", + "weirdan/prophecy-shim": "^1.0 || ^2.0" }, "suggest": { - "symfony/console": "For validating YAML files using the lint command" + "ext-curl": "In order to send data to shepherd", + "ext-igbinary": "^2.0.5 is required, used to serialize caching data" }, + "bin": [ + "psalm", + "psalm-language-server", + "psalm-plugin", + "psalm-refactor", + "psalter" + ], "type": "library", "extra": { "branch-alias": { - "dev-master": "3.3-dev" + "dev-master": "4.x-dev", + "dev-3.x": "3.x-dev", + "dev-2.x": "2.x-dev", + "dev-1.x": "1.x-dev" } }, "autoload": { "psr-4": { - "Symfony\\Component\\Yaml\\": "" + "Psalm\\": "src/Psalm/" }, - "exclude-from-classmap": [ - "/Tests/" + "files": [ + "src/functions.php", + "src/spl_object_id.php" ] }, "notification-url": "https://packagist.org/downloads/", @@ -2125,44 +4814,50 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "Matthew Brown" } ], - "description": "Symfony Yaml Component", - "homepage": "https://symfony.com", - "time": "2018-01-20T15:04:53+00:00" + "description": "A static analysis tool for finding errors in PHP applications", + "keywords": [ + "code", + "inspection", + "php" + ], + "support": { + "issues": "https://github.com/vimeo/psalm/issues", + "source": "https://github.com/vimeo/psalm/tree/4.19.0" + }, + "time": "2022-01-27T19:00:37+00:00" }, { "name": "webmozart/assert", - "version": "1.4.0", + "version": "1.10.0", "source": { "type": "git", - "url": "https://github.com/webmozart/assert.git", - "reference": "83e253c8e0be5b0257b881e1827274667c5c17a9" + "url": "https://github.com/webmozarts/assert.git", + "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozart/assert/zipball/83e253c8e0be5b0257b881e1827274667c5c17a9", - "reference": "83e253c8e0be5b0257b881e1827274667c5c17a9", + "url": "https://api.github.com/repos/webmozarts/assert/zipball/6964c76c7804814a842473e0c8fd15bab0f18e25", + "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0", + "php": "^7.2 || ^8.0", "symfony/polyfill-ctype": "^1.8" }, + "conflict": { + "phpstan/phpstan": "<0.12.20", + "vimeo/psalm": "<4.6.1 || 4.6.2" + }, "require-dev": { - "phpunit/phpunit": "^4.6", - "sebastian/version": "^1.0.1" + "phpunit/phpunit": "^8.5.13" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3-dev" + "dev-master": "1.10-dev" } }, "autoload": { @@ -2186,7 +4881,62 @@ "check", "validate" ], - "time": "2018-12-25T11:19:39+00:00" + "support": { + "issues": "https://github.com/webmozarts/assert/issues", + "source": "https://github.com/webmozarts/assert/tree/1.10.0" + }, + "time": "2021-03-09T10:59:23+00:00" + }, + { + "name": "webmozart/path-util", + "version": "2.3.0", + "source": { + "type": "git", + "url": "https://github.com/webmozart/path-util.git", + "reference": "d939f7edc24c9a1bb9c0dee5cb05d8e859490725" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozart/path-util/zipball/d939f7edc24c9a1bb9c0dee5cb05d8e859490725", + "reference": "d939f7edc24c9a1bb9c0dee5cb05d8e859490725", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "webmozart/assert": "~1.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.6", + "sebastian/version": "^1.0.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3-dev" + } + }, + "autoload": { + "psr-4": { + "Webmozart\\PathUtil\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "A robust cross-platform utility for normalizing, comparing and modifying file paths.", + "support": { + "issues": "https://github.com/webmozart/path-util/issues", + "source": "https://github.com/webmozart/path-util/tree/2.3.0" + }, + "abandoned": "symfony/filesystem", + "time": "2015-12-17T08:42:14+00:00" } ], "aliases": [], @@ -2195,7 +4945,8 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": ">=5.6.0" + "php": ">=7.2" }, - "platform-dev": [] + "platform-dev": [], + "plugin-api-version": "2.2.0" } diff --git a/phpspec.yml b/phpspec.yml index 3e14869..af2c4c1 100644 --- a/phpspec.yml +++ b/phpspec.yml @@ -1,6 +1,3 @@ -extensions: - Cjm\PhpSpec\Extension\TypeHintedMethodsExtension: ~ - suites: default: spec_path: tests diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 592ae2e..4196bd7 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -2,7 +2,7 @@ - + tests/scenarios diff --git a/psalm.xml b/psalm.xml new file mode 100644 index 0000000..d6c2a02 --- /dev/null +++ b/psalm.xml @@ -0,0 +1,16 @@ + + + + + + + + + diff --git a/src/Collection.php b/src/Collection.php index f8037a0..25260ef 100644 --- a/src/Collection.php +++ b/src/Collection.php @@ -8,22 +8,31 @@ use IteratorAggregate; use Traversable; +/** + * @template TKey + * @template TVal + * @implements CollectionInterface + * @implements IteratorAggregate + */ class Collection implements IteratorAggregate, \Serializable, CollectionInterface { + /** + * @use CollectionTrait + */ use CollectionTrait; /** - * @var Traversable + * @var Traversable */ protected $input; /** - * @var callable + * @var callable():iterable|null */ - private $inputFactory; + private $inputFactory = null; /** - * @param callable|array|Traversable $input If callable is passed, it must return an array|Traversable. + * @param callable(): iterable|iterable $input */ public function __construct($input) { @@ -44,12 +53,14 @@ public function __construct($input) /** * Static alias of normal constructor. * - * @param callable|array|Traversable $input - * @return Collection + * @template CKey + * @template CVal + * @param callable():iterable|iterable $input + * @return static */ public static function from($input) { - return new self($input); + return new static($input); } /** @@ -58,24 +69,25 @@ public static function from($input) * end the collection by throwing a NoMoreItems exception. * * @param mixed $input - * @param callable $function - * @return Collection + * @param callable(mixed):mixed $function + * @return static */ public static function iterate($input, callable $function) { - return iterate($input, $function); + return static::from(iterate($input, $function)); } /** * Returns a lazy collection of $value repeated $times times. If $times is not provided the collection is infinite. * - * @param mixed $value + * @template TItem + * @param TItem $value * @param int $times - * @return Collection + * @return static */ - public static function repeat($value, $times = -1) + public static function repeat($value, int $times = -1) { - return repeat($value, $times); + return static::from(repeat($value, $times)); } /** @@ -84,16 +96,17 @@ public static function repeat($value, $times = -1) * @param int $start * @param int|null $end * @param int $step - * @return Collection + * @return static */ public static function range($start = 0, $end = null, $step = 1) { - return \DusanKasan\Knapsack\range($start, $end, $step); + return static::from(\DusanKasan\Knapsack\range($start, $end, $step)); } /** * {@inheritdoc} * @throws InvalidReturnValue + * @return Traversable */ public function getIterator() { @@ -123,7 +136,12 @@ public function serialize() toArray( map( $this->input, - function ($value, $key) { + /** + * @param mixed $value + * @param mixed $key + * @return array + */ + function ($value, $key): array { return [$key, $value]; } ) @@ -138,4 +156,13 @@ public function unserialize($serialized) { $this->input = dereferenceKeyValue(unserialize($serialized)); } + + + /** + * @return iterable + */ + protected function getItems(): iterable + { + return $this; + } } diff --git a/src/CollectionInterface.php b/src/CollectionInterface.php index 98d3d33..636a01a 100644 --- a/src/CollectionInterface.php +++ b/src/CollectionInterface.php @@ -3,8 +3,13 @@ namespace DusanKasan\Knapsack; use DusanKasan\Knapsack\Exceptions\InvalidReturnValue; +use Traversable; -interface CollectionInterface +/** + * @template TKey + * @template TVal + */ +interface CollectionInterface extends Traversable { /** * Converts $collection to array. If there are multiple items with the same key, only the last will be preserved. @@ -16,31 +21,32 @@ public function toArray(); /** * Returns a lazy collection of items for which $function returned true. * - * @param callable|null $function ($value, $key) - * @return Collection + * @param callable(TVal, TKey): bool|null $function + * @return static */ public function filter(callable $function = null); /** * Returns a lazy collection of distinct items. The comparison is the same as in in_array. * - * @return Collection + * @return static */ public function distinct(); /** * Returns a lazy collection with items from all $collections passed as argument appended together * - * @param array|\Traversable ...$collections - * @return Collection + * @param iterable ...$collections + * @return static */ public function concat(...$collections); /** * Returns collection where each item is changed to the output of executing $function on each key/item. * - * @param callable $function - * @return Collection + * @template TRes + * @param callable(TVal, TKey):TRes $function + * @return static */ public function map(callable $function); @@ -48,7 +54,7 @@ public function map(callable $function); * Reduces the collection to single value by iterating over the collection and calling $function while * passing $startValue and current key/item as parameters. The output of $function is used as $startValue in * next iteration. The output of $function on last element is the return value of this function. If - * $convertToCollection is true and the return value is a collection (array|Traversable) an instance of Collection + * $convertToCollection is true and the return value is a collection (iterable) an instance of Collection * is returned. * * @param callable $function ($tmpValue, $value, $key) @@ -63,7 +69,7 @@ public function reduce(callable $function, $startValue, $convertToCollection = f * is passed. * * @param int $depth How many levels should be flatten, default (-1) is infinite. - * @return Collection + * @return CollectionInterface */ public function flatten($depth = -1); @@ -71,8 +77,8 @@ public function flatten($depth = -1); * Returns a non-lazy collection sorted using $function($item1, $item2, $key1, $key2 ). $function should * return true if first item is larger than the second and false otherwise. * - * @param callable $function ($value1, $value2, $key1, $key2) - * @return Collection + * @param callable(TVal, TVal, TKey, TKey): bool $function + * @return static */ public function sort(callable $function); @@ -81,32 +87,33 @@ public function sort(callable $function); * number $to. The items before $from are also iterated over, just not returned. * * @param int $from - * @param int $to If omitted, will slice until end - * @return Collection + * @param int $to -1 to slice until end + * @return static */ - public function slice($from, $to = -1); + public function slice(int $from, int $to = -1); /** * Returns collection which items are separated into groups indexed by the return value of $function. * - * @param callable $function ($value, $key) - * @return Collection + * @template TRes + * @param callable(TVal, TKey): TRes $function + * @return CollectionInterface> */ - public function groupBy(callable $function); + public function groupBy(callable $function): CollectionInterface; /** * Returns collection where items are separated into groups indexed by the value at given key. * * @param mixed $key - * @return Collection + * @return CollectionInterface */ - public function groupByKey($key); + public function groupByKey($key): CollectionInterface; /** * Returns a lazy collection in which $function is executed for each item. * - * @param callable $function ($value, $key) - * @return Collection + * @param callable(TVal, TKey): void $function + * @return static */ public function each(callable $function); @@ -119,7 +126,7 @@ public function size(); /** * Returns value at the key $key. If multiple values have this key, return first. If no value has this key, throw - * ItemNotFound. If $convertToCollection is true and the return value is a collection (array|Traversable) an + * ItemNotFound. If $convertToCollection is true and the return value is a collection (iterable) an * instance of Collection will be returned. * * @param mixed $key @@ -132,7 +139,7 @@ public function get($key, $convertToCollection = false); /** * Returns item at the key $key. If multiple items have this key, return first. If no item has this key, return * $ifNotFound. If no value has this key, throw ItemNotFound. If $convertToCollection is true and the return value - * is a collection (array|Traversable) an instance of Collection will be returned. + * is a collection (iterable) an instance of Collection will be returned. * * @param mixed $key * @param mixed $default @@ -144,12 +151,12 @@ public function getOrDefault($key, $default = null, $convertToCollection = false /** * Returns first value matched by $function. If no value matches, return $default. If $convertToCollection is true - * and the return value is a collection (array|Traversable) an instance of Collection will be returned. + * and the return value is a collection (iterable) an instance of Collection will be returned. * - * @param callable $function - * @param mixed|null $default + * @param callable(TVal, TKey): bool $function + * @param TVal|null $default * @param bool $convertToCollection - * @return mixed|Collection + * @return TVal|CollectionInterface */ public function find(callable $function, $default = null, $convertToCollection = false); @@ -157,24 +164,26 @@ public function find(callable $function, $default = null, $convertToCollection = * Returns a non-lazy collection of items whose keys are the return values of $function and values are the number of * items in this collection for which the $function returned this value. * - * @param callable $function - * @return Collection + * @template TRes + * @param callable(TVal, TKey): TRes $function + * @return CollectionInterface */ - public function countBy(callable $function); + public function countBy(callable $function): CollectionInterface; /** * Returns a lazy collection by changing keys of this collection for each item to the result of $function for * that item. * - * @param callable $function - * @return Collection + * @template TNewKey + * @param callable(TVal, TKey): TNewKey $function + * @return static */ public function indexBy(callable $function); /** * Returns true if $function returns true for every item in this collection, false otherwise. * - * @param callable $function + * @param callable(TVal, TKey): bool $function * @return bool */ public function every(callable $function); @@ -182,7 +191,7 @@ public function every(callable $function); /** * Returns true if $function returns true for at least one item in this collection, false otherwise. * - * @param callable $function + * @param callable(TVal, TKey): bool $function * @return bool */ public function some(callable $function); @@ -190,7 +199,7 @@ public function some(callable $function); /** * Returns true if $value is present in the collection. * - * @param mixed $value + * @param TVal $value * @return bool */ public function contains($value); @@ -198,18 +207,19 @@ public function contains($value); /** * Returns collection of items in this collection in reverse order. * - * @return Collection + * @return static */ public function reverse(); /** * Reduce the collection to single value. Walks from right to left. If $convertToCollection is true and the return - * value is a collection (array|Traversable) an instance of Collection is returned. + * value is a collection (iterable) an instance of Collection is returned. * - * @param callable $function Must take 2 arguments, intermediate value and item from the iterator. - * @param mixed $startValue + * @template TRes + * @param callable $function + * @param TRes $startValue * @param bool $convertToCollection - * @return mixed|Collection + * @return TRes|CollectionInterface */ public function reduceRight(callable $function, $startValue, $convertToCollection = false); @@ -217,45 +227,45 @@ public function reduceRight(callable $function, $startValue, $convertToCollectio * A form of slice that returns first $numberOfItems items. * * @param int $numberOfItems - * @return Collection + * @return static */ - public function take($numberOfItems); + public function take(int $numberOfItems); /** * A form of slice that returns all but first $numberOfItems items. * * @param int $numberOfItems - * @return Collection + * @return static */ - public function drop($numberOfItems); + public function drop(int $numberOfItems); /** * Returns collection of values from this collection but with keys being numerical from 0 upwards. * - * @return Collection + * @return static */ public function values(); /** * Returns a lazy collection without elements matched by $function. * - * @param callable $function - * @return Collection + * @param callable(TVal, TKey): bool $function + * @return static */ public function reject(callable $function); /** * Returns a lazy collection of the keys of this collection. * - * @return Collection + * @return CollectionInterface */ public function keys(); /** * Returns a lazy collection of items of this collection separated by $separator * - * @param mixed $separator - * @return Collection + * @param TVal $separator + * @return static */ public function interpose($separator); @@ -263,23 +273,23 @@ public function interpose($separator); * Returns a lazy collection with last $numberOfItems items skipped. These are still iterated over, just skipped. * * @param int $numberOfItems - * @return Collection + * @return static */ - public function dropLast($numberOfItems = 1); + public function dropLast(int $numberOfItems = 1); /** * Returns a lazy collection of first item from first collection, first item from second, second from first and * so on. Accepts any number of collections. * - * @param array|\Traversable ...$collections - * @return Collection + * @param iterable ...$collections + * @return static */ public function interleave(...$collections); /** * Returns an infinite lazy collection of items in this collection repeated infinitely. * - * @return Collection + * @return static */ public function cycle(); @@ -287,9 +297,9 @@ public function cycle(); * Returns a lazy collection of items of this collection with $value added as first element. If $key is not provided * it will be next integer index. * - * @param mixed $value - * @param mixed|null $key - * @return Collection + * @param TVal $value + * @param TKey|null $key + * @return static */ public function prepend($value, $key = null); @@ -297,9 +307,9 @@ public function prepend($value, $key = null); * Returns a lazy collection of items of this collection with $value added as last element. If $key is not provided * it will be next integer index. * - * @param mixed $value - * @param mixed $key - * @return Collection + * @param TVal $value + * @param TKey|null $key + * @return static */ public function append($value, $key = null); @@ -307,8 +317,8 @@ public function append($value, $key = null); * Returns a lazy collection by removing items from this collection until first item for which $function returns * false. * - * @param callable $function - * @return Collection + * @param callable(TVal, TKey): bool $function + * @return static */ public function dropWhile(callable $function); @@ -316,7 +326,7 @@ public function dropWhile(callable $function); * Returns a lazy collection which is a result of calling map($function) and then flatten(1) * * @param callable $function - * @return Collection + * @return CollectionInterface */ public function mapcat(callable $function); @@ -325,7 +335,7 @@ public function mapcat(callable $function); * returns false. * * @param callable $function - * @return Collection + * @return CollectionInterface */ public function takeWhile(callable $function); @@ -333,7 +343,7 @@ public function takeWhile(callable $function); * Returns a collection of [take($position), drop($position)] * * @param int $position - * @return Collection + * @return CollectionInterface */ public function splitAt($position); @@ -341,7 +351,7 @@ public function splitAt($position); * Returns a collection of [takeWhile($predicament), dropWhile($predicament] * * @param callable $function - * @return Collection + * @return CollectionInterface */ public function splitWith(callable $function); @@ -349,8 +359,8 @@ public function splitWith(callable $function); * Returns a lazy collection with items from this collection but values that are found in keys of $replacementMap * are replaced by their values. * - * @param array|\Traversable $replacementMap - * @return Collection + * @param iterable $replacementMap + * @return CollectionInterface */ public function replace($replacementMap); @@ -359,7 +369,7 @@ public function replace($replacementMap); * * @param callable $function * @param mixed $startValue - * @return Collection + * @return CollectionInterface */ public function reductions(callable $function, $startValue); @@ -367,14 +377,14 @@ public function reductions(callable $function, $startValue); * Returns a lazy collection of every nth item in this collection * * @param int $step - * @return Collection + * @return CollectionInterface */ public function takeNth($step); /** * Returns a non-collection of shuffled items from this collection * - * @return Collection + * @return CollectionInterface */ public function shuffle(); @@ -387,8 +397,8 @@ public function shuffle(); * * @param int $numberOfItems * @param int $step - * @param array|\Traversable $padding - * @return Collection + * @param iterable $padding + * @return CollectionInterface */ public function partition($numberOfItems, $step = 0, $padding = []); @@ -397,7 +407,7 @@ public function partition($numberOfItems, $step = 0, $padding = []); * return different result. * * @param callable $function - * @return Collection + * @return CollectionInterface */ public function partitionBy(callable $function); @@ -419,13 +429,13 @@ public function isNotEmpty(); * Returns a collection where keys are distinct items from this collection and their values are number of * occurrences of each value. * - * @return Collection + * @return CollectionInterface */ public function frequencies(); /** * Returns first item of this collection. If the collection is empty, throws ItemNotFound. If $convertToCollection - * is true and the return value is a collection (array|Traversable) an instance of Collection is returned. + * is true and the return value is a collection (iterable) an instance of Collection is returned. * * @param bool $convertToCollection * @return mixed|Collection @@ -435,7 +445,7 @@ public function first($convertToCollection = false); /** * Returns last item of this collection. If the collection is empty, throws ItemNotFound. If $convertToCollection - * is true and the return value is a collection (array|Traversable) it is converted to Collection. + * is true and the return value is a collection (iterable) it is converted to Collection. * * @param bool $convertToCollection * @return mixed|Collection @@ -446,13 +456,13 @@ public function last($convertToCollection = false); /** * Realizes collection - turns lazy collection into non-lazy one by iterating over it and storing the key/values. * - * @return Collection + * @return CollectionInterface */ public function realize(); /** * Returns the second item in this collection or throws ItemNotFound if the collection is empty or has 1 item. If - * $convertToCollection is true and the return value is a collection (array|Traversable) it is converted to + * $convertToCollection is true and the return value is a collection (iterable) it is converted to * Collection. * * @param bool $convertToCollection @@ -465,41 +475,41 @@ public function second($convertToCollection = false); * Combines the values of this collection as keys, with values of $collection as values. The resulting collection * has length equal to the size of smaller collection. * - * @param array|\Traversable $collection - * @return Collection + * @param iterable $collection + * @return CollectionInterface * @throws \DusanKasan\Knapsack\Exceptions\ItemNotFound */ - public function combine($collection); + public function combine(iterable $collection); /** * Returns a lazy collection without the items associated to any of the keys from $keys. * - * @param array|\Traversable $keys - * @return Collection + * @param iterable $keys + * @return CollectionInterface */ - public function except($keys); + public function except(iterable $keys); /** * Returns a lazy collection of items associated to any of the keys from $keys. * - * @param array|\Traversable $keys - * @return Collection + * @param iterable $keys + * @return CollectionInterface */ - public function only($keys); + public function only(iterable $keys); /** * Returns a lazy collection of items that are in $this but are not in any of the other arguments, indexed by the * keys from the first collection. Note that the ...$collections are iterated non-lazily. * - * @param array|\Traversable ...$collections - * @return Collection + * @param iterable ...$collections + * @return CollectionInterface */ public function diff(...$collections); /** * Returns a lazy collection where keys and values are flipped. * - * @return Collection + * @return CollectionInterface */ public function flip(); @@ -515,16 +525,16 @@ public function has($key); * Returns a lazy collection of non-lazy collections of items from nth position from this collection and each * passed collection. Stops when any of the collections don't have an item at the nth position. * - * @param array|\Traversable ...$collections - * @return Collection + * @param iterable ...$collections + * @return CollectionInterface */ - public function zip(...$collections); + public function zip(iterable ...$collections); /** * Uses a $transformer callable that takes a Collection and returns Collection on itself. * * @param callable $transformer Collection => Collection - * @return Collection + * @return CollectionInterface * @throws InvalidReturnValue */ public function transform(callable $transformer); @@ -533,7 +543,7 @@ public function transform(callable $transformer); * Transpose each item in a collection, interchanging the row and column indexes. * Can only transpose collections of collections. Otherwise an InvalidArgument is raised. * - * @return Collection + * @return CollectionInterface */ public function transpose(); @@ -542,7 +552,7 @@ public function transpose(); * it must be escaped using \ character. * * @param mixed $keyPath - * @return Collection + * @return CollectionInterface */ public function extract($keyPath); @@ -550,10 +560,10 @@ public function extract($keyPath); * Returns a lazy collection of items that are in $this and all the other arguments, indexed by the keys from * the first collection. Note that the ...$collections are iterated non-lazily. * - * @param array|\Traversable ...$collections - * @return Collection + * @param iterable ...$collections + * @return CollectionInterface */ - public function intersect(...$collections); + public function intersect(iterable ...$collections); /** * Checks whether this collection has exactly $size items. @@ -561,7 +571,7 @@ public function intersect(...$collections); * @param int $size * @return bool */ - public function sizeIs($size); + public function sizeIs(int $size): bool; /** * Checks whether this collection has less than $size items. @@ -569,7 +579,7 @@ public function sizeIs($size); * @param int $size * @return bool */ - public function sizeIsLessThan($size); + public function sizeIsLessThan(int $size): bool; /** * Checks whether this collection has more than $size items. @@ -577,7 +587,7 @@ public function sizeIsLessThan($size); * @param int $size * @return bool */ - public function sizeIsGreaterThan($size); + public function sizeIsGreaterThan(int $size): bool; /** * Checks whether this collection has between $fromSize to $toSize items. $toSize can be @@ -587,7 +597,7 @@ public function sizeIsGreaterThan($size); * @param int $toSize * @return bool */ - public function sizeIsBetween($fromSize, $toSize); + public function sizeIsBetween(int $fromSize, int $toSize): bool; /** * Returns a sum of all values in this collection. @@ -628,10 +638,10 @@ public function toString(); * Returns a lazy collection with items from $collection, but items with keys that are found in keys of * $replacementMap are replaced by their values. * - * @param array|\Traversable $replacementMap - * @return Collection + * @param iterable $replacementMap + * @return CollectionInterface */ - public function replaceByKeys($replacementMap); + public function replaceByKeys(iterable $replacementMap); /** * /** @@ -657,14 +667,14 @@ public function replaceByKeys($replacementMap); * @param int|null $maxDepth * @return array */ - public function dump($maxItemsPerCollection = null, $maxDepth = null); + public function dump(int $maxItemsPerCollection = null, int $maxDepth = null): array; /** * Calls dump on this collection and then prints it using the var_export. * * @param int|null $maxItemsPerCollection * @param int|null $maxDepth - * @return Collection + * @return CollectionInterface */ - public function printDump($maxItemsPerCollection = null, $maxDepth = null); + public function printDump(int $maxItemsPerCollection = null, int $maxDepth = null); } \ No newline at end of file diff --git a/src/CollectionTrait.php b/src/CollectionTrait.php index 7ce1f11..71a3e53 100644 --- a/src/CollectionTrait.php +++ b/src/CollectionTrait.php @@ -3,7 +3,13 @@ namespace DusanKasan\Knapsack; use DusanKasan\Knapsack\Exceptions\InvalidReturnValue; +use DusanKasan\Knapsack\Exceptions\ItemNotFound; +use Generator; +/** + * @template TKey + * @template TVal + */ trait CollectionTrait { /** @@ -19,87 +25,90 @@ public function toArray() /** * Returns a lazy collection of items for which $function returned true. * - * @param callable|null $function ($value, $key) - * @return Collection + * @param callable(TVal, TKey): bool|null $function + * @return static */ public function filter(callable $function = null) { - return filter($this->getItems(), $function); + return static::from(filter($this->getItems(), $function)); } /** * Returns a lazy collection of distinct items. The comparison is the same as in in_array. * - * @return Collection + * @return static */ public function distinct() { - return distinct($this->getItems()); + return static::from(distinct($this->getItems())); } /** * Returns a lazy collection with items from all $collections passed as argument appended together * - * @param array|\Traversable ...$collections - * @return Collection + * @param iterable ...$collections + * @return static */ public function concat(...$collections) { - return concat($this, ...$collections); + return static::from(concat($this, ...$collections)); } /** * Returns collection where each item is changed to the output of executing $function on each key/item. * - * @param callable $function - * @return Collection + * @template TRes + * @param callable(TVal, TKey):TRes $function + * @return static */ public function map(callable $function) { - return map($this->getItems(), $function); + return static::from(map($this->getItems(), $function)); } /** * Reduces the collection to single value by iterating over the collection and calling $function while * passing $startValue and current key/item as parameters. The output of $function is used as $startValue in * next iteration. The output of $function on last element is the return value of this function. If - * $convertToCollection is true and the return value is a collection (array|Traversable) an instance of Collection + * $convertToCollection is true and the return value is a collection (iterable) an instance of Collection * is returned. * - * @param callable $function ($tmpValue, $value, $key) - * @param mixed $startValue + * @template TRes + * @param callable $function + * @param TRes $startValue * @param bool $convertToCollection - * @return mixed|Collection + * @return TRes|CollectionInterface */ public function reduce(callable $function, $startValue, $convertToCollection = false) { $result = reduce($this->getItems(), $function, $startValue); - return ($convertToCollection && isCollection($result)) ? new Collection($result) : $result; + return ($convertToCollection && is_iterable($result)) ? new Collection($result) : $result; } /** * Returns a lazy collection with one or multiple levels of nesting flattened. Removes all nesting when no value * is passed. * - * @param int $depth How many levels should be flatten, default (-1) is infinite. - * @return Collection + * @param int $depth -1 to flatten everything + * @return CollectionInterface */ public function flatten($depth = -1) { - return flatten($this->getItems(), $depth); + return new Collection(flatten($this->getItems(), $depth)); } /** - * Returns a non-lazy collection sorted using $function($item1, $item2, $key1, $key2 ). $function should - * return true if first item is larger than the second and false otherwise. + * Returns a non-lazy collection sorted using $function($item1, $item2, $key1, $key2). $function should + * return true if first item is larger than the second and false otherwise. In PHP8 and forward, $function + * must return int as described by https://www.php.net/manual/en/function.usort.php. * - * @param callable $function ($value1, $value2, $key1, $key2) - * @return Collection + * @param callable(TVal, TVal, TKey, TKey): bool|int $function + * @return static */ public function sort(callable $function) { - return \DusanKasan\Knapsack\sort($this->getItems(), $function); + return static::from(\DusanKasan\Knapsack\sort($this->getItems(), $function)); } /** @@ -107,45 +116,54 @@ public function sort(callable $function) * number $to. The items before $from are also iterated over, just not returned. * * @param int $from - * @param int $to If omitted, will slice until end - * @return Collection + * @param int $to -1 to slice until end + * @return static */ - public function slice($from, $to = -1) + public function slice(int $from, int $to = -1) { - return slice($this->getItems(), $from, $to); + return static::from(slice($this->getItems(), $from, $to)); } /** * Returns collection which items are separated into groups indexed by the return value of $function. * - * @param callable $function ($value, $key) - * @return Collection + * @template TRes + * @param callable(TVal, TKey): TRes $function + * @return CollectionInterface> */ - public function groupBy(callable $function) + public function groupBy(callable $function): CollectionInterface { - return groupBy($this->getItems(), $function); + return new Collection(function () use ($function): iterable { + foreach (groupBy($this->getItems(), $function) as $k => $v) { + yield $k => static::from($v); + } + }); } /** * Returns collection where items are separated into groups indexed by the value at given key. * * @param mixed $key - * @return Collection + * @return CollectionInterface */ - public function groupByKey($key) + public function groupByKey($key): CollectionInterface { - return groupByKey($this->getItems(), $key); + return new Collection(function () use ($key): iterable { + foreach (groupByKey($this->getItems(), $key) as $k => $v) { + yield $k => static::from($v); + } + }); } /** * Returns a lazy collection in which $function is executed for each item. * - * @param callable $function ($value, $key) - * @return Collection + * @param callable(TVal, TKey): void $function + * @return static */ public function each(callable $function) { - return \DusanKasan\Knapsack\each($this->getItems(), $function); + return static::from(each($this->getItems(), $function)); } /** @@ -153,93 +171,94 @@ public function each(callable $function) * * @return int */ - public function size() + public function size(): int { return size($this->getItems()); } /** * Returns value at the key $key. If multiple values have this key, return first. If no value has this key, throw - * ItemNotFound. If $convertToCollection is true and the return value is a collection (array|Traversable) an + * ItemNotFound. If $convertToCollection is true and the return value is a collection (iterable) an * instance of Collection will be returned. * - * @param mixed $key + * @param TKey $key * @param bool $convertToCollection - * @return mixed|Collection - * @throws \DusanKasan\Knapsack\Exceptions\ItemNotFound + * @return TVal|CollectionInterface + * @throws ItemNotFound */ public function get($key, $convertToCollection = false) { $result = get($this->getItems(), $key); - return ($convertToCollection && isCollection($result)) ? new Collection($result) : $result; + return ($convertToCollection && is_iterable($result)) ? new Collection($result) : $result; } /** * Returns item at the key $key. If multiple items have this key, return first. If no item has this key, return * $ifNotFound. If no value has this key, throw ItemNotFound. If $convertToCollection is true and the return value - * is a collection (array|Traversable) an instance of Collection will be returned. + * is a collection (iterable) an instance of Collection will be returned. * - * @param mixed $key - * @param mixed $default + * @param TKey $key + * @param TVal $default * @param bool $convertToCollection - * @return mixed|Collection - * @throws \DusanKasan\Knapsack\Exceptions\ItemNotFound + * @return TVal|CollectionInterface */ public function getOrDefault($key, $default = null, $convertToCollection = false) { $result = getOrDefault($this->getItems(), $key, $default); - return ($convertToCollection && isCollection($result)) ? new Collection($result) : $result; + return ($convertToCollection && is_iterable($result)) ? new Collection($result) : $result; } /** * Returns first value matched by $function. If no value matches, return $default. If $convertToCollection is true - * and the return value is a collection (array|Traversable) an instance of Collection will be returned. + * and the return value is a collection (iterable) an instance of Collection will be returned. * - * @param callable $function - * @param mixed|null $default + * @param callable(TVal, TKey): bool $function + * @param TVal|null $default * @param bool $convertToCollection - * @return mixed|Collection + * @return TVal|CollectionInterface */ public function find(callable $function, $default = null, $convertToCollection = false) { $result = find($this->getItems(), $function, $default); - return ($convertToCollection && isCollection($result)) ? new Collection($result) : $result; + return ($convertToCollection && is_iterable($result)) ? new Collection($result) : $result; } /** * Returns a non-lazy collection of items whose keys are the return values of $function and values are the number of * items in this collection for which the $function returned this value. * - * @param callable $function - * @return Collection + * @template TRes + * @param callable(TVal, TKey): TRes $function + * @return CollectionInterface */ - public function countBy(callable $function) + public function countBy(callable $function): CollectionInterface { - return countBy($this->getItems(), $function); + return new Collection(countBy($this->getItems(), $function)); } /** * Returns a lazy collection by changing keys of this collection for each item to the result of $function for * that item. * - * @param callable $function - * @return Collection + * @template TNewKey + * @param callable(TVal, TKey): TNewKey $function + * @return static */ public function indexBy(callable $function) { - return indexBy($this->getItems(), $function); + return static::from(indexBy($this->getItems(), $function)); } /** * Returns true if $function returns true for every item in this collection, false otherwise. * - * @param callable $function + * @param callable(TVal, TKey): bool $function * @return bool */ - public function every(callable $function) + public function every(callable $function): bool { return every($this->getItems(), $function); } @@ -247,10 +266,10 @@ public function every(callable $function) /** * Returns true if $function returns true for at least one item in this collection, false otherwise. * - * @param callable $function + * @param callable(TVal, TKey): bool $function * @return bool */ - public function some(callable $function) + public function some(callable $function): bool { return some($this->getItems(), $function); } @@ -258,7 +277,7 @@ public function some(callable $function) /** * Returns true if $value is present in the collection. * - * @param mixed $value + * @param TVal $value * @return bool */ public function contains($value) @@ -269,173 +288,174 @@ public function contains($value) /** * Returns collection of items in this collection in reverse order. * - * @return Collection + * @return static */ public function reverse() { - return reverse($this->getItems()); + return static::from(reverse($this->getItems())); } /** * Reduce the collection to single value. Walks from right to left. If $convertToCollection is true and the return - * value is a collection (array|Traversable) an instance of Collection is returned. + * value is a collection (iterable) an instance of Collection is returned. * - * @param callable $function Must take 2 arguments, intermediate value and item from the iterator. - * @param mixed $startValue + * @template TRes + * @param callable $function + * @param TRes $startValue * @param bool $convertToCollection - * @return mixed|Collection + * @return TRes|CollectionInterface */ public function reduceRight(callable $function, $startValue, $convertToCollection = false) { $result = reduceRight($this->getItems(), $function, $startValue); - return ($convertToCollection && isCollection($result)) ? new Collection($result) : $result; + return ($convertToCollection && is_iterable($result)) ? new Collection($result) : $result; } /** * A form of slice that returns first $numberOfItems items. * * @param int $numberOfItems - * @return Collection + * @return static */ - public function take($numberOfItems) + public function take(int $numberOfItems) { - return take($this->getItems(), $numberOfItems); + return static::from(take($this->getItems(), $numberOfItems)); } /** * A form of slice that returns all but first $numberOfItems items. * * @param int $numberOfItems - * @return Collection + * @return static */ - public function drop($numberOfItems) + public function drop(int $numberOfItems) { - return drop($this->getItems(), $numberOfItems); + return static::from(drop($this->getItems(), $numberOfItems)); } /** * Returns collection of values from this collection but with keys being numerical from 0 upwards. * - * @return Collection + * @return static */ public function values() { - return values($this->getItems()); + return static::from(values($this->getItems())); } /** * Returns a lazy collection without elements matched by $function. * - * @param callable $function - * @return Collection + * @param callable(TVal, TKey): bool $function + * @return static */ public function reject(callable $function) { - return reject($this->getItems(), $function); + return static::from(reject($this->getItems(), $function)); } /** * Returns a lazy collection of the keys of this collection. * - * @return Collection + * @return CollectionInterface */ public function keys() { - return keys($this->getItems()); + return new Collection(keys($this->getItems())); } /** * Returns a lazy collection of items of this collection separated by $separator * - * @param mixed $separator - * @return Collection + * @param TVal $separator + * @return static */ public function interpose($separator) { - return interpose($this->getItems(), $separator); + return static::from(interpose($this->getItems(), $separator)); } /** * Returns a lazy collection with last $numberOfItems items skipped. These are still iterated over, just skipped. * * @param int $numberOfItems - * @return Collection + * @return static */ - public function dropLast($numberOfItems = 1) + public function dropLast(int $numberOfItems = 1) { - return dropLast($this->getItems(), $numberOfItems); + return static::from(dropLast($this->getItems(), $numberOfItems)); } /** * Returns a lazy collection of first item from first collection, first item from second, second from first and * so on. Accepts any number of collections. * - * @param array|\Traversable ...$collections - * @return Collection + * @param iterable ...$collections + * @return static */ public function interleave(...$collections) { - return interleave($this->getItems(), ...$collections); + return static::from(interleave($this->getItems(), ...$collections)); } /** * Returns an infinite lazy collection of items in this collection repeated infinitely. * - * @return Collection + * @return static */ public function cycle() { - return cycle($this->getItems()); + return static::from(cycle($this->getItems())); } /** * Returns a lazy collection of items of this collection with $value added as first element. If $key is not provided * it will be next integer index. * - * @param mixed $value - * @param mixed|null $key - * @return Collection + * @param TVal $value + * @param TKey|null $key + * @return static */ public function prepend($value, $key = null) { - return prepend($this->getItems(), $value, $key); + return static::from(prepend($this->getItems(), $value, $key)); } /** * Returns a lazy collection of items of this collection with $value added as last element. If $key is not provided * it will be next integer index. * - * @param mixed $value - * @param mixed $key - * @return Collection + * @param TVal $value + * @param TKey|null $key + * @return static */ public function append($value, $key = null) { - return append($this->getItems(), $value, $key); + return static::from(append($this->getItems(), $value, $key)); } /** * Returns a lazy collection by removing items from this collection until first item for which $function returns * false. * - * @param callable $function - * @return Collection + * @param callable(TVal, TKey): bool $function + * @return static */ public function dropWhile(callable $function) { - return dropWhile($this->getItems(), $function); + return static::from(dropWhile($this->getItems(), $function)); } /** * Returns a lazy collection which is a result of calling map($function) and then flatten(1) * * @param callable $function - * @return Collection + * @return static */ public function mapcat(callable $function) { - return mapcat($this->getItems(), $function); + return static::from(mapcat($this->getItems(), $function)); } /** @@ -443,45 +463,53 @@ public function mapcat(callable $function) * returns false. * * @param callable $function - * @return Collection + * @return static */ public function takeWhile(callable $function) { - return takeWhile($this->getItems(), $function); + return static::from(takeWhile($this->getItems(), $function)); } /** * Returns a collection of [take($position), drop($position)] * * @param int $position - * @return Collection + * @return static */ public function splitAt($position) { - return splitAt($this->getItems(), $position); + return static::from(function () use ($position): Generator { + foreach (splitAt($this->getItems(), $position) as $k => $v) { + yield $k => static::from($v); + } + }); } /** * Returns a collection of [takeWhile($predicament), dropWhile($predicament] * * @param callable $function - * @return Collection + * @return static */ public function splitWith(callable $function) { - return splitWith($this->getItems(), $function); + return static::from(function () use ($function): Generator { + foreach (splitWith($this->getItems(), $function) as $k => $v) { + yield $k => static::from($v); + } + }); } /** * Returns a lazy collection with items from this collection but values that are found in keys of $replacementMap * are replaced by their values. * - * @param array|\Traversable $replacementMap - * @return Collection + * @param iterable $replacementMap + * @return static */ public function replace($replacementMap) { - return replace($this->getItems(), $replacementMap); + return static::from(replace($this->getItems(), $replacementMap)); } /** @@ -489,32 +517,32 @@ public function replace($replacementMap) * * @param callable $function * @param mixed $startValue - * @return Collection + * @return static */ public function reductions(callable $function, $startValue) { - return reductions($this->getItems(), $function, $startValue); + return static::from(reductions($this->getItems(), $function, $startValue)); } /** * Returns a lazy collection of every nth item in this collection * * @param int $step - * @return Collection + * @return static */ public function takeNth($step) { - return takeNth($this->getItems(), $step); + return static::from(takeNth($this->getItems(), $step)); } /** * Returns a non-collection of shuffled items from this collection * - * @return Collection + * @return CollectionInterface */ public function shuffle() { - return \DusanKasan\Knapsack\shuffle($this->getItems()); + return static::from(\DusanKasan\Knapsack\shuffle($this->getItems())); } /** @@ -526,12 +554,17 @@ public function shuffle() * * @param int $numberOfItems * @param int $step - * @param array|\Traversable $padding - * @return Collection + * @param iterable $padding + * @return static */ public function partition($numberOfItems, $step = 0, $padding = []) { - return partition($this->getItems(), $numberOfItems, $step, $padding); + return static::from(function() use ($numberOfItems, $step, $padding) { + $c = partition($this->getItems(), $numberOfItems, $step, $padding); + foreach($c as $k => $v) { + yield $k => static::from($v); + } + }); } /** @@ -539,11 +572,16 @@ public function partition($numberOfItems, $step = 0, $padding = []) * return different result. * * @param callable $function - * @return Collection + * @return static */ public function partitionBy(callable $function) { - return partitionBy($this->getItems(), $function); + return static::from(function() use ($function) { + $c = partitionBy($this->getItems(), $function); + foreach($c as $k => $v) { + yield $k => static::from($v); + } + }); } /** @@ -570,124 +608,125 @@ public function isNotEmpty() * Returns a collection where keys are distinct items from this collection and their values are number of * occurrences of each value. * - * @return Collection + * @return static */ public function frequencies() { - return frequencies($this->getItems()); + return static::from(frequencies($this->getItems())); } /** * Returns first item of this collection. If the collection is empty, throws ItemNotFound. If $convertToCollection - * is true and the return value is a collection (array|Traversable) an instance of Collection is returned. + * is true and the return value is a collection (iterable) an instance of Collection is returned. * * @param bool $convertToCollection * @return mixed|Collection - * @throws \DusanKasan\Knapsack\Exceptions\ItemNotFound + * @throws ItemNotFound */ public function first($convertToCollection = false) { $result = first($this->getItems()); - return ($convertToCollection && isCollection($result)) ? new Collection($result) : $result; + return ($convertToCollection && is_iterable($result)) ? new Collection($result) : $result; } /** * Returns last item of this collection. If the collection is empty, throws ItemNotFound. If $convertToCollection - * is true and the return value is a collection (array|Traversable) it is converted to Collection. + * is true and the return value is a collection (iterable) it is converted to Collection. * * @param bool $convertToCollection * @return mixed|Collection - * @throws \DusanKasan\Knapsack\Exceptions\ItemNotFound + * @throws ItemNotFound */ public function last($convertToCollection = false) { $result = last($this->getItems()); - return ($convertToCollection && isCollection($result)) ? new Collection($result) : $result; + return ($convertToCollection && is_iterable($result)) ? new Collection($result) : $result; } /** * Realizes collection - turns lazy collection into non-lazy one by iterating over it and storing the key/values. * - * @return Collection + * @return static */ public function realize() { - return realize($this->getItems()); + return static::from(realize($this->getItems())); } /** * Returns the second item in this collection or throws ItemNotFound if the collection is empty or has 1 item. If - * $convertToCollection is true and the return value is a collection (array|Traversable) it is converted to + * $convertToCollection is true and the return value is a collection (iterable) it is converted to * Collection. * * @param bool $convertToCollection * @return mixed|Collection - * @throws \DusanKasan\Knapsack\Exceptions\ItemNotFound + * @throws ItemNotFound */ public function second($convertToCollection = false) { $result = second($this->getItems()); - return ($convertToCollection && isCollection($result)) ? new Collection($result) : $result; + return ($convertToCollection && is_iterable($result)) ? new Collection($result) : $result; } /** * Combines the values of this collection as keys, with values of $collection as values. The resulting collection * has length equal to the size of smaller collection. * - * @param array|\Traversable $collection - * @return Collection - * @throws \DusanKasan\Knapsack\Exceptions\ItemNotFound + * @template TNewVal + * @param iterable $collection + * @return static + * @throws ItemNotFound */ - public function combine($collection) + public function combine(iterable $collection) { - return combine($this->getItems(), $collection); + return static::from(combine($this->getItems(), $collection)); } /** * Returns a lazy collection without the items associated to any of the keys from $keys. * - * @param array|\Traversable $keys - * @return Collection + * @param iterable $keys + * @return static */ - public function except($keys) + public function except(iterable $keys) { - return except($this->getItems(), $keys); + return static::from(except($this->getItems(), $keys)); } /** * Returns a lazy collection of items associated to any of the keys from $keys. * - * @param array|\Traversable $keys - * @return Collection + * @param iterable $keys + * @return static */ - public function only($keys) + public function only(iterable $keys) { - return only($this->getItems(), $keys); + return static::from(only($this->getItems(), $keys)); } /** * Returns a lazy collection of items that are in $this but are not in any of the other arguments, indexed by the * keys from the first collection. Note that the ...$collections are iterated non-lazily. * - * @param array|\Traversable ...$collections - * @return Collection + * @param iterable ...$collections + * @return static */ public function diff(...$collections) { - return diff($this->getItems(), ...$collections); + return static::from(diff($this->getItems(), ...$collections)); } /** * Returns a lazy collection where keys and values are flipped. * - * @return Collection + * @return static */ public function flip() { - return flip($this->getItems()); + return static::from(flip($this->getItems())); } /** @@ -705,30 +744,29 @@ public function has($key) * Returns a lazy collection of non-lazy collections of items from nth position from this collection and each * passed collection. Stops when any of the collections don't have an item at the nth position. * - * @param array|\Traversable ...$collections - * @return Collection + * @param iterable ...$collections + * @return static> */ - public function zip(...$collections) + public function zip(iterable ...$collections) { array_unshift($collections, $this->getItems()); - - return zip(...$collections); + return static::from(zip(...$collections)); } /** * Uses a $transformer callable that takes a Collection and returns Collection on itself. * * @param callable $transformer Collection => Collection - * @return Collection + * @return CollectionInterface * @throws InvalidReturnValue */ public function transform(callable $transformer) { $items = $this->getItems(); - $transformed = $transformer($items instanceof Collection ? $items : new Collection($items)); + $transformed = $transformer($items instanceof CollectionInterface ? $items : new Collection($items)); - if (!($transformed instanceof Collection)) { + if (!($transformed instanceof CollectionInterface)) { throw new InvalidReturnValue; } @@ -739,11 +777,16 @@ public function transform(callable $transformer) * Transpose each item in a collection, interchanging the row and column indexes. * Can only transpose collections of collections. Otherwise an InvalidArgument is raised. * - * @return Collection + * @TODO: TVal must be iterable + * @return static */ public function transpose() { - return transpose($this->getItems()); + return static::from(function (): Generator { + foreach (transpose($this->getItems()) as $k => $v) { + yield $k => static::from($v); + } + }); } /** @@ -751,23 +794,23 @@ public function transpose() * it must be escaped using \ character. * * @param mixed $keyPath - * @return Collection + * @return CollectionInterface */ public function extract($keyPath) { - return \DusanKasan\Knapsack\extract($this->getItems(), $keyPath); + return Collection::from(extract($this->getItems(), $keyPath)); } /** * Returns a lazy collection of items that are in $this and all the other arguments, indexed by the keys from * the first collection. Note that the ...$collections are iterated non-lazily. * - * @param array|\Traversable ...$collections - * @return Collection + * @param iterable ...$collections + * @return static */ - public function intersect(...$collections) + public function intersect(iterable ...$collections) { - return intersect($this->getItems(), ...$collections); + return static::from(intersect($this->getItems(), ...$collections)); } /** @@ -776,7 +819,7 @@ public function intersect(...$collections) * @param int $size * @return bool */ - public function sizeIs($size) + public function sizeIs(int $size): bool { return sizeIs($this->getItems(), $size); } @@ -787,7 +830,7 @@ public function sizeIs($size) * @param int $size * @return bool */ - public function sizeIsLessThan($size) + public function sizeIsLessThan(int $size): bool { return sizeIsLessThan($this->getItems(), $size); } @@ -798,7 +841,7 @@ public function sizeIsLessThan($size) * @param int $size * @return bool */ - public function sizeIsGreaterThan($size) + public function sizeIsGreaterThan(int $size): bool { return sizeIsGreaterThan($this->getItems(), $size); } @@ -811,7 +854,7 @@ public function sizeIsGreaterThan($size) * @param int $toSize * @return bool */ - public function sizeIsBetween($fromSize, $toSize) + public function sizeIsBetween(int $fromSize, int $toSize): bool { return sizeIsBetween($this->getItems(), $fromSize, $toSize); } @@ -839,21 +882,21 @@ public function average() /** * Returns maximal value from this collection. * - * @return mixed + * @return TVal */ public function max() { - return \DusanKasan\Knapsack\max($this->getItems()); + return max($this->getItems()); } /** * Returns minimal value from this collection. * - * @return mixed + * @return TVal */ public function min() { - return \DusanKasan\Knapsack\min($this->getItems()); + return min($this->getItems()); } /** @@ -861,7 +904,7 @@ public function min() * * @return string */ - public function toString() + public function toString(): string { return toString($this->getItems()); } @@ -870,12 +913,12 @@ public function toString() * Returns a lazy collection with items from $collection, but items with keys that are found in keys of * $replacementMap are replaced by their values. * - * @param array|\Traversable $replacementMap - * @return Collection + * @param iterable $replacementMap + * @return static */ - public function replaceByKeys($replacementMap) + public function replaceByKeys(iterable $replacementMap) { - return replaceByKeys($this->getItems(), $replacementMap); + return static::from(replaceByKeys($this->getItems(), $replacementMap)); } /** @@ -902,7 +945,7 @@ public function replaceByKeys($replacementMap) * @param int|null $maxDepth * @return array */ - public function dump($maxItemsPerCollection = null, $maxDepth = null) + public function dump(int $maxItemsPerCollection = null, int $maxDepth = null): array { return dump($this->getItems(), $maxItemsPerCollection, $maxDepth); } @@ -912,18 +955,24 @@ public function dump($maxItemsPerCollection = null, $maxDepth = null) * * @param int|null $maxItemsPerCollection * @param int|null $maxDepth - * @return Collection + * @return static */ - public function printDump($maxItemsPerCollection = null, $maxDepth = null) + public function printDump(int $maxItemsPerCollection = null, int $maxDepth = null) { - return printDump($this->getItems(), $maxItemsPerCollection, $maxDepth); + printDump($this->getItems(), $maxItemsPerCollection, $maxDepth); + return $this; } /** - * @return array|\Traversable + * @return iterable */ - protected function getItems() - { - return $this; - } + protected abstract function getItems(): iterable; + + /** + * @template CKey + * @template CVal + * @param callable():iterable|iterable $input + * @return static + */ + protected abstract static function from($input); } diff --git a/src/RewindableIterable.php b/src/RewindableIterable.php new file mode 100644 index 0000000..535f6f2 --- /dev/null +++ b/src/RewindableIterable.php @@ -0,0 +1,41 @@ + + */ + private $factory; + + /** + * @param callable(): iterable $factory + */ + public function __construct(callable $factory) + { + $this->factory = function() use ($factory): Traversable { + $iterable = $factory(); + if (is_array($iterable)) { + $iterable = new ArrayIterator($iterable); + } + return $iterable; + }; + } + + /** + * @return Traversable + */ + public function getIterator(): Traversable + { + return ($this->factory)(); + } +} \ No newline at end of file diff --git a/src/collection_functions.php b/src/collection_functions.php index cdd797e..8b36e92 100644 --- a/src/collection_functions.php +++ b/src/collection_functions.php @@ -5,17 +5,20 @@ use DusanKasan\Knapsack\Exceptions\InvalidArgument; use DusanKasan\Knapsack\Exceptions\ItemNotFound; use DusanKasan\Knapsack\Exceptions\NoMoreItems; +use Generator; use Iterator; -use IteratorIterator; +use ReflectionObject; use Traversable; /** * Converts $collection to array. If there are multiple items with the same key, only the last will be preserved. * - * @param array|Traversable $collection - * @return array + * @template TKey + * @template TVal + * @param iterable $collection + * @return array */ -function toArray($collection) +function toArray(iterable $collection) { return is_array($collection) ? $collection : iterator_to_array($collection); } @@ -23,14 +26,15 @@ function toArray($collection) /** * Returns a lazy collection of distinct items in $collection. * - * @param array|Traversable $collection - * @return Collection + * @template TKey + * @template TVal + * @param iterable $collection + * @return iterable */ -function distinct($collection) +function distinct(iterable $collection): iterable { - $generatorFactory = function () use ($collection) { + $factory = function () use ($collection): Generator { $distinctValues = []; - foreach ($collection as $key => $value) { if (!in_array($value, $distinctValues)) { $distinctValues[] = $value; @@ -39,19 +43,19 @@ function distinct($collection) } }; - return new Collection($generatorFactory); + return new RewindableIterable($factory); } /** * Returns number of items in $collection. * - * @param array|Traversable $collection + * @param iterable $collection * @return int */ -function size($collection) +function size($collection): int { $result = 0; - foreach ($collection as $value) { + foreach ($collection as $_) { $result++; } @@ -61,76 +65,74 @@ function size($collection) /** * Returns a non-lazy collection with items from $collection in reversed order. * - * @param array|Traversable $collection - * @return Collection + * @template TKey + * @template TVal + * @param iterable $collection + * @return iterable */ -function reverse($collection) +function reverse(iterable $collection): iterable { - $generatorFactory = function () use ($collection) { + $factory = function () use ($collection): Generator { $array = []; foreach ($collection as $key => $value) { $array[] = [$key, $value]; } - return map( - indexBy( - array_reverse($array), - function ($item) { - return $item[0]; - } - ), - function ($item) { - return $item[1]; - } - ); + foreach (array_reverse($array) as $item) { + yield $item[0] => $item[1]; + } }; - return new Collection($generatorFactory); + return new RewindableIterable($factory); } /** * Returns a lazy collection of values from $collection (i.e. the keys are reset). * - * @param array|Traversable $collection - * @return Collection + * @template TVal + * @param iterable $collection + * @return iterable */ -function values($collection) +function values(iterable $collection): iterable { - $generatorFactory = function () use ($collection) { + $factory = function () use ($collection): iterable { foreach ($collection as $value) { yield $value; } }; - return new Collection($generatorFactory); + return new RewindableIterable($factory); } /** * Returns a lazy collection of keys from $collection. * - * @param array|Traversable $collection - * @return Collection + * @template TKey + * @param iterable $collection + * @return iterable */ -function keys($collection) +function keys(iterable $collection): iterable { - $generatorFactory = function () use ($collection) { + $factory = function () use ($collection): Generator { foreach ($collection as $key => $value) { yield $key; } }; - return new Collection($generatorFactory); + return new RewindableIterable($factory); } /** * Returns a lazy collection of items from $collection repeated infinitely. * - * @param array|Traversable $collection - * @return Collection + * @template TKey + * @template TVal + * @param iterable $collection + * @return iterable */ -function cycle($collection) +function cycle(iterable $collection): iterable { - $generatorFactory = function () use ($collection) { + $factory = function () use ($collection): Generator { while (true) { foreach ($collection as $key => $value) { yield $key => $value; @@ -138,36 +140,42 @@ function cycle($collection) } }; - return new Collection($generatorFactory); + return new RewindableIterable($factory); } /** * Returns a non-lazy collection of shuffled items from $collection. * - * @param array|Traversable $collection - * @return Collection + * @template TKey + * @template TVal + * @param iterable $collection + * @return iterable */ -function shuffle($collection) +function shuffle(iterable $collection): iterable { - $buffer = []; - foreach ($collection as $key => $value) { - $buffer[] = [$key, $value]; - } + $factory = function () use ($collection): Traversable { + $buffer = []; + foreach ($collection as $key => $value) { + $buffer[] = [$key, $value]; + } - \shuffle($buffer); + \shuffle($buffer); - return dereferenceKeyValue($buffer); + return dereferenceKeyValue($buffer); + }; + + return new RewindableIterable($factory); } /** * Returns true if $collection does not contain any items. * - * @param array|Traversable $collection + * @param iterable $collection * @return bool */ -function isEmpty($collection) +function isEmpty(iterable $collection): bool { - foreach ($collection as $value) { + foreach ($collection as $_) { return false; } @@ -177,10 +185,10 @@ function isEmpty($collection) /** * Returns true if $collection does contain any items. * - * @param array|Traversable $collection + * @param iterable $collection * @return bool */ -function isNotEmpty($collection) +function isNotEmpty(iterable $collection) { return !isEmpty($collection); } @@ -189,21 +197,32 @@ function isNotEmpty($collection) * Returns a collection where keys are distinct values from $collection and values are number of occurrences of each * value. * - * @param array|Traversable $collection - * @return Collection + * @template TVal + * @param iterable $collection + * @return iterable */ -function frequencies($collection) +function frequencies(iterable $collection): iterable { - return countBy($collection, '\DusanKasan\Knapsack\identity'); + return countBy( + $collection, + /** + * @param mixed $item + * @return mixed + */ + function ($item) { + return $item; + } + ); } /** * Returns the first item of $collection or throws ItemNotFound if #collection is empty. * - * @param array|Traversable $collection - * @return mixed + * @template TVal + * @param iterable $collection + * @return TVal */ -function first($collection) +function first(iterable $collection) { return get(values($collection), 0); } @@ -211,8 +230,9 @@ function first($collection) /** * Returns the last item of $collection or throws ItemNotFound if #collection is empty. * - * @param array|Traversable $collection - * @return mixed + * @template TVal + * @param iterable $collection + * @return TVal */ function last($collection) { @@ -223,37 +243,48 @@ function last($collection) * Returns a lazy collection of items of $collection where value of each item is set to the return value of calling * $function on its value and key. * - * @param array|Traversable $collection - * @param callable $function ($value, $key) - * @return Collection + * @template TKey + * @template TVal + * @template TRes + * @param iterable $collection + * @param callable(TVal, TKey):TRes $function + * @return iterable */ -function map($collection, callable $function) +function map(iterable $collection, callable $function): iterable { - $generatorFactory = function () use ($collection, $function) { + $factory = function () use ($collection, $function): iterable { foreach ($collection as $key => $value) { yield $key => $function($value, $key); } }; - return new Collection($generatorFactory); + return new RewindableIterable($factory); } /** * Returns a lazy collection of items from $collection for which $function returns true. * - * @param array|Traversable $collection - * @param callable|null $function ($value, $key) - * @return Collection + * @template TKey + * @template TVal + * @param iterable $collection + * @param callable(TVal, TKey): bool|null $function + * @return iterable */ function filter($collection, callable $function = null) { if (null === $function) { - $function = function ($value) { - return (bool) $value; - }; + $function = + /** + * @param mixed $value + * @param mixed $_ + * @return bool + */ + function ($value, $_): bool { + return (bool)$value; + }; } - $generatorFactory = function () use ($collection, $function) { + $factory = function () use ($collection, $function): iterable { foreach ($collection as $key => $value) { if ($function($value, $key)) { yield $key => $value; @@ -261,18 +292,20 @@ function filter($collection, callable $function = null) } }; - return new Collection($generatorFactory); + return new RewindableIterable($factory); } /** * Returns a lazy collection with items from all $collections passed as argument appended together * - * @param array|Traversable ...$collections - * @return Collection + * @template TKey + * @template TVal + * @param iterable ...$collections + * @return iterable */ -function concat(...$collections) +function concat(iterable ...$collections): iterable { - $generatorFactory = function () use ($collections) { + $factory = function () use ($collections): iterable { foreach ($collections as $collection) { foreach ($collection as $key => $value) { yield $key => $value; @@ -280,7 +313,7 @@ function concat(...$collections) } }; - return new Collection($generatorFactory); + return new RewindableIterable($factory); } /** @@ -288,12 +321,15 @@ function concat(...$collections) * passing $startValue and current key/item as parameters. The output of $function is used as $startValue in * next iteration. The output of $function on last element is the return value of this function. * - * @param array|Traversable $collection - * @param callable $function ($value, $key) - * @param mixed $startValue - * @return mixed + * @template TKey + * @template TVal + * @template TRes + * @param iterable $collection + * @param callable(TRes, TVal, TKey): TRes $function + * @param TRes $startValue + * @return TRes */ -function reduce($collection, callable $function, $startValue) +function reduce(iterable $collection, callable $function, $startValue) { $tmp = duplicate($startValue); @@ -308,13 +344,13 @@ function reduce($collection, callable $function, $startValue) * Flattens multiple levels of nesting in collection. If $levelsToFlatten is not specified, flattens all levels of * nesting. * - * @param array|Traversable $collection + * @param iterable $collection * @param int $levelsToFlatten -1 to flatten everything - * @return Collection + * @return iterable */ -function flatten($collection, $levelsToFlatten = -1) +function flatten(iterable $collection, int $levelsToFlatten = -1): iterable { - $generatorFactory = function () use ($collection, $levelsToFlatten) { + $factory = function () use ($collection, $levelsToFlatten): Generator { $flattenNextLevel = $levelsToFlatten < 0 || $levelsToFlatten > 0; $childLevelsToFlatten = $levelsToFlatten > 0 ? $levelsToFlatten - 1 : $levelsToFlatten; @@ -329,38 +365,54 @@ function flatten($collection, $levelsToFlatten = -1) } }; - return new Collection($generatorFactory); + return new RewindableIterable($factory); } /** - * Returns a non-lazy collection sorted using $collection($item1, $item2, $key1, $key2 ). $collection should + * Returns a non-lazy collection sorted using $function($item1, $item2, $key1, $key2). $function should * return true if first item is larger than the second and false otherwise. * - * @param array|Traversable $collection - * @param callable $function ($value1, $value2, $key1, $key2) - * @return Collection + * @template TKey + * @template TVal + * @param iterable $collection + * @param callable(TVal, TVal, TKey, TKey): bool|int $function + * @return iterable */ -function sort($collection, callable $function) +function sort(iterable $collection, callable $function): iterable { - $array = iterator_to_array( - values( - map( - $collection, - function ($value, $key) { - return [$key, $value]; - } + $factory = function () use ($collection, $function): Traversable { + $array = toArray( + values( + map( + $collection, + /** + * @param mixed $value + * @param mixed $key + * @return array + */ + function ($value, $key): array { + return [$key, $value]; + } + ) ) - ) - ); + ); - uasort( - $array, - function ($a, $b) use ($function) { - return $function($a[1], $b[1], $a[0], $b[0]); - } - ); + usort( + $array, + /** + * @param mixed $a + * @param mixed $b + * @return int + */ + function ($a, $b) use ($function): int { + return (int)$function($a[1], $b[1], $a[0], $b[0]); + } + ); + + return dereferenceKeyValue($array); + }; - return dereferenceKeyValue($array); + return new RewindableIterable($factory); } /** @@ -368,14 +420,16 @@ function ($a, $b) use ($function) { * If $to is not provided, the returned collection is contains all items from $from until end of $collection. All items * before $from are iterated over, but not included in result. * - * @param array|Traversable $collection + * @template TKey + * @template TVal + * @param iterable $collection * @param int $from * @param int $to -1 to slice until end - * @return Collection + * @return iterable */ -function slice($collection, $from, $to = -1) +function slice(iterable $collection, int $from, int $to = -1): iterable { - $generatorFactory = function () use ($collection, $from, $to) { + $factory = function () use ($collection, $from, $to): iterable { $index = 0; foreach ($collection as $key => $value) { if ($index >= $from && ($index < $to || $to == -1)) { @@ -388,69 +442,84 @@ function slice($collection, $from, $to = -1) } }; - return new Collection($generatorFactory); + return new RewindableIterable($factory); } /** * Returns a non-lazy collection of items grouped by the result of $function. * - * @param array|Traversable $collection - * @param callable $function ($value, $key) - * @return Collection + * @template TKey + * @template TVal + * @template TRes + * @param iterable $collection + * @param callable(TVal, TKey): TRes $function + * @return iterable> */ -function groupBy($collection, callable $function) +function groupBy(iterable $collection, callable $function): iterable { - $result = []; + $factory = function () use ($collection, $function): array { + $result = []; - foreach ($collection as $key => $value) { - $newKey = $function($value, $key); + foreach ($collection as $key => $value) { + $newKey = $function($value, $key); + $result[$newKey][] = $value; + } - $result[$newKey][] = $value; - } + return $result; + }; - return Collection::from($result) - ->map(function ($entry) { - return new Collection($entry); - }); + return new RewindableIterable($factory); } /** * Returns a non-lazy collection of items grouped by the value at given key. Ignores non-collection items and items * without the given keys * - * @param array|Traversable $collection - * @param mixed $key - * @return Collection + * @template TKey + * @template TVal + * @param iterable> $collection + * @param TKey $key + * @return iterable> */ -function groupByKey($collection, $key) +function groupByKey(iterable $collection, $key): iterable { - $generatorFactory = function () use ($collection, $key) { - + $generatorFactory = function () use ($collection, $key): iterable { return groupBy( filter( $collection, - function ($item) use ($key) { - return isCollection($item) && has($item, $key); + /** + * @param mixed $item + * @return bool + */ + function ($item) use ($key): bool { + return is_iterable($item) && has($item, $key); } ), + /** + * @param mixed $value + * @return mixed + */ function ($value) use ($key) { return get($value, $key); } ); }; - return new Collection($generatorFactory); + return new RewindableIterable($generatorFactory); } + /** * Executes $function for each item in $collection * - * @param array|Traversable $collection - * @param callable $function ($value, $key) - * @return Collection + * @template TKey + * @template TVal + * @param iterable $collection + * @param callable(TVal, TKey): void $function + * @return iterable */ -function each($collection, callable $function) +function each(iterable $collection, callable $function): iterable { - $generatorFactory = function () use ($collection, $function) { + $factory = function () use ($collection, $function): iterable { foreach ($collection as $key => $value) { $function($value, $key); @@ -458,17 +527,19 @@ function each($collection, callable $function) } }; - return new Collection($generatorFactory); + return new RewindableIterable($factory); } /** * Returns an item with $key key from $collection. If that key is not present, throws ItemNotFound. * - * @param array|Traversable $collection - * @param mixed $key - * @return mixed + * @template TKey + * @template TVal + * @param iterable $collection + * @param TKey $key + * @return TVal */ -function get($collection, $key) +function get(iterable $collection, $key) { foreach ($collection as $valueKey => $value) { if ($key === $valueKey) { @@ -482,12 +553,14 @@ function get($collection, $key) /** * Returns an item with $key key from $collection. If that key is not present, returns $default. * - * @param array|Traversable $collection - * @param mixed $key - * @param mixed $default value returned if key is not found - * @return mixed + * @template TKey + * @template TVal + * @param iterable $collection + * @param TKey $key + * @param TVal $default value returned if key is not found + * @return TVal */ -function getOrDefault($collection, $key, $default) +function getOrDefault(iterable $collection, $key, $default) { try { return get($collection, $key); @@ -500,12 +573,14 @@ function getOrDefault($collection, $key, $default) * Returns the first item from $collection for which $function returns true. If item like that is not present, returns * $default. * - * @param array|Traversable $collection - * @param callable $function ($value, $key) - * @param mixed $default - * @return mixed + * @template TKey + * @template TVal + * @param iterable $collection + * @param callable(TVal, TKey): bool $function + * @param TVal|null $default + * @return TVal|null */ -function find($collection, callable $function, $default = null) +function find(iterable $collection, callable $function, $default = null) { foreach ($collection as $key => $value) { if ($function($value, $key)) { @@ -520,42 +595,56 @@ function find($collection, callable $function, $default = null) * Returns a lazy collection by changing keys of $collection for each item to the result of $function for * that item. * - * @param array|Traversable $collection - * @param callable $function ($value, $key) - * @return Collection + * @template TKey + * @template TVal + * @template TNewKey + * @param iterable $collection + * @param callable(TVal, TKey): TNewKey $function + * @return iterable */ function indexBy($collection, callable $function) { - $generatorFactory = function () use ($collection, $function) { + $factory = function () use ($collection, $function): iterable { foreach ($collection as $key => $value) { yield $function($value, $key) => $value; } }; - return new Collection($generatorFactory); + return new RewindableIterable($factory); } /** * Returns a non-lazy collection of items whose keys are the return values of $function and values are the number of * items in this collection for which the $function returned this value. * - * @param array|Traversable $collection - * @param callable $function ($value, $key) - * @return Collection + * @template TKey + * @template TVal + * @template TRes + * @param iterable $collection + * @param callable(TVal, TKey): TRes $function + * @return iterable */ function countBy($collection, callable $function) { return map( groupBy($collection, $function), - '\DusanKasan\Knapsack\size' + /** + * @param mixed $c + * @return int + */ + function ($c): int { + return size($c); + } ); } /** * Returns true if $function returns true for every item in $collection * - * @param array|Traversable $collection - * @param callable $function ($value, $key) + * @template TKey + * @template TVal + * @param iterable $collection + * @param callable(TVal, TKey): bool $function * @return bool */ function every($collection, callable $function) @@ -572,8 +661,10 @@ function every($collection, callable $function) /** * Returns true if $function returns true for at least one item in $collection. * - * @param array|Traversable $collection - * @param callable $function ($value, $key) + * @template TKey + * @template TVal + * @param iterable $collection + * @param callable(TVal, TKey): bool $function * @return bool */ function some($collection, callable $function) @@ -590,7 +681,7 @@ function some($collection, callable $function) /** * Returns true if $needle is found in $collection values. * - * @param array|Traversable $collection + * @param iterable $collection * @param mixed $needle * @return bool */ @@ -608,12 +699,15 @@ function contains($collection, $needle) /** * Reduce that walks from right to the left. * - * @param array|Traversable $collection - * @param callable $function - * @param mixed $startValue - * @return mixed + * @template TKey + * @template TVal + * @template TRes + * @param iterable $collection + * @param callable(TRes, TVal, TKey): TRes $function + * @param TRes $startValue + * @return TRes */ -function reduceRight($collection, callable $function, $startValue) +function reduceRight(iterable $collection, callable $function, $startValue) { return reduce(reverse($collection), $function, $startValue); } @@ -621,11 +715,13 @@ function reduceRight($collection, callable $function, $startValue) /** * Returns a lazy collection of first $numberOfItems items of $collection. * - * @param array|Traversable $collection + * @template TKey + * @template TVal + * @param iterable $collection * @param int $numberOfItems - * @return Collection + * @return iterable */ -function take($collection, $numberOfItems) +function take(iterable $collection, int $numberOfItems): iterable { return slice($collection, 0, $numberOfItems); } @@ -633,11 +729,13 @@ function take($collection, $numberOfItems) /** * Returns a lazy collection of all but first $numberOfItems items of $collection. * - * @param array|Traversable $collection + * @template TKey + * @template TVal + * @param iterable $collection * @param int $numberOfItems - * @return Collection + * @return iterable */ -function drop($collection, $numberOfItems) +function drop(iterable $collection, int $numberOfItems): iterable { return slice($collection, $numberOfItems); } @@ -647,14 +745,15 @@ function drop($collection, $numberOfItems) * $function to the last value in the collection. By default this produces an infinite collection. However you can * end the collection by throwing a NoMoreItems exception. * - * @param mixed $value - * @param callable $function ($value, $key) - * @return Collection + * @template TVal + * @param TVal $value + * @param callable(TVal): TVal $function + * @return iterable */ function iterate($value, callable $function) { $duplicated = duplicate($value); - $generatorFactory = function () use ($duplicated, $function) { + $factory = function () use ($duplicated, $function): iterable { $value = $duplicated; yield $value; @@ -669,21 +768,28 @@ function iterate($value, callable $function) } }; - return new Collection($generatorFactory); + return new RewindableIterable($factory); } /** * Returns a lazy collection of items from $collection for which $function returned true. * - * @param array|Traversable $collection - * @param callable $function ($value, $key) - * @return Collection + * @template TKey + * @template TVal + * @param iterable $collection + * @param callable(TVal, TKey): bool $function + * @return iterable */ -function reject($collection, callable $function) +function reject(iterable $collection, callable $function): iterable { return filter( $collection, - function ($value, $key) use ($function) { + /** + * @param mixed $value + * @param mixed $key + * @return bool + */ + function ($value, $key) use ($function): bool { return !$function($value, $key); } ); @@ -692,13 +798,15 @@ function ($value, $key) use ($function) { /** * Returns a lazy collection of items in $collection without the last $numberOfItems items. * - * @param array|Traversable $collection + * @template TKey + * @template TVal + * @param iterable $collection * @param int $numberOfItems - * @return Collection + * @return iterable */ -function dropLast($collection, $numberOfItems = 1) +function dropLast(iterable $collection, $numberOfItems = 1): iterable { - $generatorFactory = function () use ($collection, $numberOfItems) { + $factory = function () use ($collection, $numberOfItems): iterable { $buffer = []; foreach ($collection as $key => $value) { @@ -711,19 +819,21 @@ function dropLast($collection, $numberOfItems = 1) } }; - return new Collection($generatorFactory); + return new RewindableIterable($factory); } /** * Returns a lazy collection of items from $collection separated by $separator. * - * @param array|Traversable $collection - * @param mixed $separator - * @return Collection + * @template TKey + * @template TVal + * @param iterable $collection + * @param TVal $separator + * @return iterable */ -function interpose($collection, $separator) +function interpose(iterable $collection, $separator): iterable { - $generatorFactory = function () use ($collection, $separator) { + $factory = function () use ($collection, $separator): iterable { foreach (take($collection, 1) as $key => $value) { yield $key => $value; } @@ -734,23 +844,25 @@ function interpose($collection, $separator) } }; - return new Collection($generatorFactory); + return new RewindableIterable($factory); } /** * Returns a lazy collection of first item from first collection, first item from second, second from first and * so on. Accepts any number of collections. * - * @param array|Traversable ...$collections - * @return Collection + * @template TKey + * @template TVal + * @param iterable ...$collections + * @return iterable */ -function interleave(...$collections) +function interleave(iterable ...$collections): iterable { - $generatorFactory = function () use ($collections) { + $generatorFactory = function () use ($collections): iterable { /* @var Iterator[] $iterators */ $iterators = array_map( function ($collection) { - $it = new IteratorIterator(new Collection($collection)); + $it = iterableToIterator($collection); $it->rewind(); return $it; }, @@ -769,21 +881,23 @@ function ($collection) { } while ($valid); }; - return new Collection($generatorFactory); + return new RewindableIterable($generatorFactory); } /** * Returns a lazy collection of items in $collection with $value added as first element. If $key is not provided * it will be next integer index. * - * @param array|Traversable $collection - * @param mixed $value - * @param mixed|null $key - * @return Collection + * @template TKey + * @template TVal + * @param iterable $collection + * @param TVal $value + * @param TKey|null $key + * @return iterable */ -function prepend($collection, $value, $key = null) +function prepend(iterable $collection, $value, $key = null): iterable { - $generatorFactory = function () use ($collection, $value, $key) { + $generatorFactory = function () use ($collection, $value, $key): iterable { if ($key === null) { yield $value; } else { @@ -795,21 +909,23 @@ function prepend($collection, $value, $key = null) } }; - return new Collection($generatorFactory); + return new RewindableIterable($generatorFactory); } /** * Returns a lazy collection of items in $collection with $value added as last element. If $key is not provided * it will be next integer index. * - * @param array|Traversable $collection - * @param mixed $value - * @param mixed|null $key - * @return Collection + * @template TKey + * @template TVal + * @param iterable $collection + * @param TVal $value + * @param TKey|null $key + * @return iterable */ -function append($collection, $value, $key = null) +function append(iterable $collection, $value, $key = null): iterable { - $generatorFactory = function () use ($collection, $value, $key) { + $generatorFactory = function () use ($collection, $value, $key): iterable { foreach ($collection as $k => $v) { yield $k => $v; } @@ -821,19 +937,21 @@ function append($collection, $value, $key = null) } }; - return new Collection($generatorFactory); + return new RewindableIterable($generatorFactory); } /** * Returns a lazy collection by removing items from $collection until first item for which $function returns false. * - * @param array|Traversable $collection - * @param callable $function ($value, $key) - * @return Collection + * @template TKey + * @template TVal + * @param iterable $collection + * @param callable(TVal, TKey): bool $function + * @return iterable */ -function dropWhile($collection, callable $function) +function dropWhile(iterable $collection, callable $function): iterable { - $generatorFactory = function () use ($collection, $function) { + $factory = function () use ($collection, $function): iterable { $shouldDrop = true; foreach ($collection as $key => $value) { if ($shouldDrop) { @@ -846,19 +964,21 @@ function dropWhile($collection, callable $function) } }; - return new Collection($generatorFactory); + return new RewindableIterable($factory); } /** * Returns a lazy collection of items from $collection until first item for which $function returns false. * - * @param array|Traversable $collection - * @param callable $function ($value, $key) - * @return Collection + * @template TKey + * @template TVal + * @param iterable $collection + * @param callable(TVal, TKey): bool $function + * @return iterable */ function takeWhile($collection, callable $function) { - $generatorFactory = function () use ($collection, $function) { + $factory = function () use ($collection, $function): iterable { $shouldTake = true; foreach ($collection as $key => $value) { if ($shouldTake) { @@ -871,17 +991,20 @@ function takeWhile($collection, callable $function) } }; - return new Collection($generatorFactory); + return new RewindableIterable($factory); } /** * Returns a lazy collection. A result of calling map and flatten(1) * - * @param array|Traversable $collection - * @param callable $function ($value, $key) - * @return Collection + * @template TKey + * @template TVal + * @template TRes + * @param iterable $collection + * @param callable(TVal, TKey): iterable $function + * @return iterable */ -function mapcat($collection, callable $function) +function mapcat(iterable $collection, callable $function): iterable { return flatten(map($collection, $function), 1); } @@ -889,68 +1012,76 @@ function mapcat($collection, callable $function) /** * Returns a lazy collection [take($collection, $position), drop($collection, $position)] * - * @param array|Traversable $collection + * @template TKey + * @template TVal + * @param iterable $collection * @param int $position - * @return Collection + * @return iterable> */ -function splitAt($collection, $position) +function splitAt(iterable $collection, int $position): iterable { - $generatorFactory = function () use ($collection, $position) { + $factory = function () use ($collection, $position): Generator { yield take($collection, $position); yield drop($collection, $position); }; - return new Collection($generatorFactory); + return new RewindableIterable($factory); } /** * Returns a lazy collection [takeWhile($collection, $function), dropWhile($collection, $function)] * - * @param array|Traversable $collection - * @param callable $function ($value, $key) - * @return Collection + * @template TKey + * @template TVal + * @param iterable $collection + * @param callable(TVal, TKey): bool $function + * @return iterable> */ -function splitWith($collection, callable $function) +function splitWith($collection, callable $function): iterable { - $generatorFactory = function () use ($collection, $function) { + $factory = function () use ($collection, $function): iterable { yield takeWhile($collection, $function); yield dropWhile($collection, $function); }; - return new Collection($generatorFactory); + return new RewindableIterable($factory); } /** * Returns a lazy collection with items from $collection but values that are found in keys of $replacementMap * are replaced by their values. * - * @param array|Traversable $collection - * @param array|Traversable $replacementMap - * @return Collection + * @template TKey + * @template TVal + * @param iterable $collection + * @param iterable $replacementMap + * @return iterable */ -function replace($collection, $replacementMap) +function replace(iterable $collection, iterable $replacementMap): iterable { - $generatorFactory = function () use ($collection, $replacementMap) { + $factory = function () use ($collection, $replacementMap): iterable { foreach ($collection as $key => $value) { - $newValue = getOrDefault($replacementMap, $value, $value); - yield $key => $newValue; + yield $key => getOrDefault($replacementMap, $value, $value); } }; - return new Collection($generatorFactory); + return new RewindableIterable($factory); } /** * Returns a lazy collection of reduction steps. * - * @param array|Traversable $collection - * @param callable $function - * @param mixed $startValue - * @return Collection + * @template TKey + * @template TVal + * @template TRes + * @param iterable $collection + * @param callable(TRes, TVal, TKey): TRes $function + * @param TRes $startValue + * @return iterable */ -function reductions($collection, callable $function, $startValue) +function reductions(iterable $collection, callable $function, $startValue): iterable { - $generatorFactory = function () use ($collection, $function, $startValue) { + $factory = function () use ($collection, $function, $startValue): iterable { $tmp = duplicate($startValue); yield $tmp; @@ -960,19 +1091,21 @@ function reductions($collection, callable $function, $startValue) } }; - return new Collection($generatorFactory); + return new RewindableIterable($factory); } /** * Returns a lazy collection of every nth ($step) item in $collection. * - * @param array|Traversable $collection + * @template TKey + * @template TVal + * @param iterable $collection * @param int $step - * @return Collection + * @return iterable */ -function takeNth($collection, $step) +function takeNth(iterable $collection, int $step) { - $generatorFactory = function () use ($collection, $step) { + $factory = function () use ($collection, $step): iterable { $index = 0; foreach ($collection as $key => $value) { if ($index % $step == 0) { @@ -983,7 +1116,7 @@ function takeNth($collection, $step) } }; - return new Collection($generatorFactory); + return new RewindableIterable($factory); } /** @@ -993,15 +1126,17 @@ function takeNth($collection, $step) * necessary to complete last partition up to $numberOfItems items. In case there are * not enough padding elements, return a partition with less than $numberOfItems items. * - * @param array|Traversable $collection + * @template TKey + * @template TVal + * @param iterable $collection * @param int $numberOfItems * @param int $step - * @param array|Traversable $padding - * @return Collection + * @param iterable $padding + * @return iterable> */ -function partition($collection, $numberOfItems, $step = -1, $padding = []) +function partition(iterable $collection, int $numberOfItems, int $step = -1, iterable $padding = []): iterable { - $generatorFactory = function () use ($collection, $numberOfItems, $step, $padding) { + $generator = function () use ($collection, $numberOfItems, $step, $padding): Generator { $buffer = []; $itemsToSkip = 0; $tmpStep = $step ?: $numberOfItems; @@ -1021,25 +1156,24 @@ function partition($collection, $numberOfItems, $step = -1, $padding = []) } } - yield take( - concat(dereferenceKeyValue($buffer), $padding), - $numberOfItems - ); + yield take(concat(dereferenceKeyValue($buffer), $padding), $numberOfItems); }; - return new Collection($generatorFactory); + return new RewindableIterable($generator); } /** * Returns a lazy collection created by partitioning $collection each time $function returned a different value. * - * @param array|Traversable $collection - * @param callable $function - * @return Collection + * @template TKey + * @template TVal + * @param iterable $collection + * @param callable(TVal, TKey=): mixed $function + * @return iterable> */ -function partitionBy($collection, callable $function) +function partitionBy(iterable $collection, callable $function): iterable { - $generatorFactory = function () use ($collection, $function) { + $factory = function () use ($collection, $function): iterable { $result = null; $buffer = []; @@ -1060,19 +1194,20 @@ function partitionBy($collection, callable $function) } }; - return new Collection($generatorFactory); + return new RewindableIterable($factory); } /** * Returns a lazy collection of $value repeated $times times. If $times is not provided the collection is infinite. * - * @param mixed $value + * @template TVal + * @param TVal $value * @param int $times - * @return Collection + * @return iterable */ -function repeat($value, $times = -1) +function repeat($value, int $times = -1): iterable { - $generatorFactory = function () use ($value, $times) { + $factory = function () use ($value, $times): iterable { $tmpTimes = $times; while ($tmpTimes != 0) { @@ -1082,7 +1217,7 @@ function repeat($value, $times = -1) } }; - return new Collection($generatorFactory); + return new RewindableIterable($factory); } /** @@ -1091,14 +1226,14 @@ function repeat($value, $times = -1) * @param int $start * @param int|null $end * @param int $step - * @return Collection + * @return iterable */ -function range($start = 0, $end = null, $step = 1) +function range(int $start = 0, int $end = null, int $step = 1): iterable { - $generatorFactory = function () use ($start, $end, $step) { + $factory = function () use ($start, $end, $step): iterable { return iterate( $start, - function ($value) use ($step, $end) { + function (int $value) use ($step, $end): int { $result = $value + $step; if ($end !== null && $result > $end) { @@ -1110,26 +1245,16 @@ function ($value) use ($step, $end) { ); }; - return new Collection($generatorFactory); -} - -/** - * Returns true if $input is array or Traversable object. - * - * @param mixed $input - * @return bool - */ -function isCollection($input) -{ - return is_array($input) || $input instanceof Traversable; + return new RewindableIterable($factory); } /** * Returns duplicated/cloned $input that has no relation to the original one. Used for making sure there are no side * effect in functions. * - * @param mixed $input - * @return mixed + * @template TVal + * @param TVal $input + * @return TVal */ function duplicate($input) { @@ -1137,6 +1262,10 @@ function duplicate($input) return toArray( map( $input, + /** + * @param mixed $i + * @return mixed + */ function ($i) { return duplicate($i); } @@ -1152,33 +1281,37 @@ function ($i) { /** * Transforms [[$key, $value], [$key2, $value2]] into [$key => $value, $key2 => $value2]. Used as a helper * - * @param array|Traversable $collection - * @return Collection + * @TODO: types + * @param iterable $collection + * @return Traversable */ -function dereferenceKeyValue($collection) +function dereferenceKeyValue(iterable $collection): Traversable { - $generatorFactory = function () use ($collection) { - foreach ($collection as $value) { - yield $value[0] => $value[1]; - } - }; - - return new Collection($generatorFactory); + foreach ($collection as $value) { + yield $value[0] => $value[1]; + } } /** * Realizes collection - turns lazy collection into non-lazy one by iterating over it and storing the key/values. * - * @param array|Traversable $collection - * @return Collection + * @template TKey + * @template TVal + * @param iterable $collection + * @return iterable */ -function realize($collection) +function realize(iterable $collection): iterable { return dereferenceKeyValue( toArray( map( $collection, - function ($value, $key) { + /** + * @param mixed $value + * @param mixed $key + * @return array + */ + function ($value, $key): array { return [$key, $value]; } ) @@ -1189,8 +1322,11 @@ function ($value, $key) { /** * Returns the second item of $collection or throws ItemNotFound if $collection is empty or has 1 item. * - * @param array|Traversable $collection - * @return mixed + * @template TKey + * @template TVal + * @param iterable $collection + * @return TVal + * @throws ItemNotFound */ function second($collection) { @@ -1201,44 +1337,50 @@ function second($collection) * Combines $keys and $values into a lazy collection. The resulting collection has length equal to the size of smaller * argument. * - * @param array|Traversable $keys - * @param array|Traversable $values - * @return Collection + * @template TKey + * @template TVal + * @param iterable $keys + * @param iterable $values + * @return iterable */ -function combine($keys, $values) +function combine(iterable $keys, iterable $values): iterable { - $generatorFactory = function () use ($keys, $values) { - $keyCollection = new Collection($keys); - $valueIt = new IteratorIterator(new Collection($values)); - $valueIt->rewind(); - - foreach ($keyCollection as $key) { - if (!$valueIt->valid()) { + $values = iterableToIterator($values); + $factory = function () use ($keys, $values): iterable { + foreach ($keys as $key) { + if (!$values->valid()) { break; } - yield $key => $valueIt->current(); - $valueIt->next(); + yield $key => $values->current(); + $values->next(); } }; - return new Collection($generatorFactory); + return new RewindableIterable($factory); } /** * Returns a lazy collection without the items associated to any of the keys from $keys. * - * @param array|Traversable $collection - * @param array|Traversable $keys - * @return Collection + * @template TKey + * @template TVal + * @param iterable $collection + * @param iterable $keys + * @return iterable */ -function except($collection, $keys) +function except(iterable $collection, iterable $keys): iterable { $keys = toArray(values($keys)); return reject( $collection, - function ($value, $key) use ($keys) { + /** + * @param mixed $value + * @param mixed $key + * @return bool + */ + function ($value, $key) use ($keys): bool { return in_array($key, $keys); } ); @@ -1247,9 +1389,11 @@ function ($value, $key) use ($keys) { /** * Returns a lazy collection of items associated to any of the keys from $keys. * - * @param array|Traversable $collection - * @param array|Traversable $keys - * @return Collection + * @template TKey + * @template TVal + * @param iterable $collection + * @param iterable $keys + * @return iterable */ function only($collection, $keys) { @@ -1257,7 +1401,12 @@ function only($collection, $keys) return filter( $collection, - function ($value, $key) use ($keys) { + /** + * @param mixed $_ + * @param mixed $key + * @return bool + */ + function ($_, $key) use ($keys): bool { return in_array($key, $keys, true); } ); @@ -1267,14 +1416,16 @@ function ($value, $key) use ($keys) { * Returns a lazy collection of items that are in $collection but are not in any of the other arguments, indexed by the * keys from the first collection. Note that the ...$collections are iterated non-lazily. * - * @param array|Traversable $collection - * @param array|Traversable ...$collections - * @return Collection + * @template TKey + * @template TVal + * @param iterable $collection + * @param iterable ...$collections + * @return iterable */ -function diff($collection, ...$collections) +function diff(iterable $collection, ...$collections) { $valuesToCompare = toArray(values(concat(...$collections))); - $generatorFactory = function () use ($collection, $valuesToCompare) { + $factory = function () use ($collection, $valuesToCompare): iterable { foreach ($collection as $key => $value) { if (!in_array($value, $valuesToCompare)) { yield $key => $value; @@ -1282,21 +1433,23 @@ function diff($collection, ...$collections) } }; - return new Collection($generatorFactory); + return new RewindableIterable($factory); } /** * Returns a lazy collection of items that are in $collection and all the other arguments, indexed by the keys from the * first collection. Note that the ...$collections are iterated non-lazily. * - * @param array|Traversable $collection - * @param array|Traversable ...$collections - * @return Collection + * @template TKey + * @template TVal + * @param iterable $collection + * @param iterable ...$collections + * @return iterable */ -function intersect($collection, ...$collections) +function intersect(iterable $collection, iterable ...$collections): iterable { $valuesToCompare = toArray(values(concat(...$collections))); - $generatorFactory = function () use ($collection, $valuesToCompare) { + $factory = function () use ($collection, $valuesToCompare): iterable { foreach ($collection as $key => $value) { if (in_array($value, $valuesToCompare)) { yield $key => $value; @@ -1304,34 +1457,37 @@ function intersect($collection, ...$collections) } }; - return new Collection($generatorFactory); + return new RewindableIterable($factory); } /** * Returns a lazy collection where keys and values are flipped. * - * @param array|Traversable $collection - * @return Collection + * @template TKey + * @template TVal + * @param iterable $collection + * @return iterable */ function flip($collection) { - $generatorFactory = function () use ($collection) { + $factory = function () use ($collection): iterable { foreach ($collection as $key => $value) { yield $value => $key; } }; - return new Collection($generatorFactory); + return new RewindableIterable($factory); } /** * Checks for the existence of an item with key $key in $collection. * - * @param array|Traversable $collection - * @param mixed $key + * @template TKey + * @param iterable $collection + * @param TKey $key * @return bool */ -function has($collection, $key) +function has(iterable $collection, $key): bool { try { get($collection, $key); @@ -1345,25 +1501,27 @@ function has($collection, $key) * Returns a lazy collection of non-lazy collections of items from nth position from each passed collection. Stops when * any of the collections don't have an item at the nth position. * - * @param array|Traversable ...$collections - * @return Collection + * @template TKey + * @template TVal + * @param iterable ...$collections + * @return iterable> */ -function zip(...$collections) +function zip(iterable ...$collections): iterable { /* @var Iterator[] $iterators */ $iterators = array_map( function ($collection) { - $it = new IteratorIterator(new Collection($collection)); + $it = iterableToIterator($collection); $it->rewind(); return $it; }, $collections ); - $generatorFactory = function () use ($iterators) { + $factory = function () use ($iterators): iterable { while (true) { $isMissingItems = false; - $zippedItem = new Collection([]); + $zippedItem = []; foreach ($iterators as $it) { if (!$it->valid()) { @@ -1383,34 +1541,42 @@ function ($collection) { } }; - return new Collection($generatorFactory); + return new RewindableIterable($factory); } /** * Transpose each item in a collection, interchanging the row and column indexes. * Can only transpose collections of collections. Otherwise an InvalidArgument is raised. * - * @param Collection[] $collection - * @return Collection + * @template TVal + * @param iterable> $collection + * @return iterable> */ -function transpose($collection) +function transpose(iterable $collection): iterable { - if (some($collection, function ($value) { - return !($value instanceof Collection); - })) { + if (some( + $collection, + /** + * @param mixed $value + * @return bool + */ + function ($value): bool { + return !is_iterable($value); + } + )) { throw new InvalidArgument('Can only transpose collections of collections.'); } - return Collection::from( - array_map( - function (...$items) { - return new Collection($items); - }, - ...toArray( - map( - $collection, - 'DusanKasan\Knapsack\toArray' - ) + return array_map( + function (...$items) { + return $items; + }, + ...toArray( + map( + $collection, + function (iterable $c): array { + return toArray($c); + } ) ) ); @@ -1420,18 +1586,30 @@ function (...$items) { * Returns a lazy collection of data extracted from $collection items by dot separated key path. Supports the * * wildcard. If a key contains \ or * it must be escaped using \ character. * - * @param array|Traversable $collection - * @param mixed $keyPath - * @return Collection + * @param iterable $collection + * @param string $keyPath + * @return iterable */ -function extract($collection, $keyPath) +function extract(iterable $collection, string $keyPath): iterable { preg_match_all('/(.*[^\\\])(?:\.|$)/U', $keyPath, $matches); $pathParts = $matches[1]; - $extractor = function ($coll) use ($pathParts) { + $extractor = function (iterable $coll) use ($pathParts): iterable { foreach ($pathParts as $pathPart) { - $coll = flatten(filter($coll, '\DusanKasan\Knapsack\isCollection'), 1); + $coll = flatten( + filter( + $coll, + /** + * @param mixed $item + * @return bool + */ + function ($item) { + return is_iterable($item); + } + ), + 1 + ); if ($pathPart != '*') { $pathPart = str_replace(['\.', '\*'], ['.', '*'], $pathPart); @@ -1442,7 +1620,7 @@ function extract($collection, $keyPath) return $coll; }; - $generatorFactory = function () use ($collection, $extractor) { + $factory = function () use ($collection, $extractor): iterable { foreach ($collection as $item) { foreach ($extractor([$item]) as $extracted) { yield $extracted; @@ -1450,17 +1628,17 @@ function extract($collection, $keyPath) } }; - return new Collection($generatorFactory); + return new RewindableIterable($factory); } /** * Checks whether $collection has exactly $size items. * - * @param array|Traversable $collection + * @param iterable $collection * @param int $size * @return bool */ -function sizeIs($collection, $size) +function sizeIs(iterable $collection, int $size): bool { $itemsTempCount = 0; @@ -1478,11 +1656,11 @@ function sizeIs($collection, $size) /** * Checks whether $collection has less than $size items. * - * @param array|Traversable $collection + * @param iterable $collection * @param int $size * @return bool */ -function sizeIsLessThan($collection, $size) +function sizeIsLessThan(iterable $collection, int $size): bool { $itemsTempCount = 0; @@ -1500,11 +1678,11 @@ function sizeIsLessThan($collection, $size) /** * Checks whether $collection has more than $size items. * - * @param array|Traversable $collection + * @param iterable $collection * @param int $size * @return bool */ -function sizeIsGreaterThan($collection, $size) +function sizeIsGreaterThan(iterable $collection, int $size): bool { $itemsTempCount = 0; @@ -1523,12 +1701,12 @@ function sizeIsGreaterThan($collection, $size) * Checks whether $collection has between $fromSize to $toSize items. $toSize can be * smaller than $fromSize. * - * @param array|Traversable $collection + * @param iterable $collection * @param int $fromSize * @param int $toSize * @return bool */ -function sizeIsBetween($collection, $fromSize, $toSize) +function sizeIsBetween(iterable $collection, int $fromSize, int $toSize): bool { if ($fromSize > $toSize) { $tmp = $toSize; @@ -1551,10 +1729,11 @@ function sizeIsBetween($collection, $fromSize, $toSize) /** * Returns a sum of all values in the $collection. * - * @param array|Traversable $collection - * @return int|float + * @template TVal of numeric + * @param iterable $collection + * @return TVal */ -function sum($collection) +function sum(iterable $collection) { $result = 0; @@ -1568,8 +1747,8 @@ function sum($collection) /** * Returns average of values from $collection. * - * @param array|Traversable $collection - * @return int|float + * @param iterable $collection + * @return float */ function average($collection) { @@ -1581,14 +1760,15 @@ function average($collection) $count++; } - return $count ? $sum/$count : 0; + return (float)($count ? $sum / $count : 0); } /** * Returns maximal value from $collection. * - * @param array|Traversable $collection - * @return mixed + * @template TVal of numeric + * @param iterable $collection + * @return TVal */ function max($collection) { @@ -1604,8 +1784,9 @@ function max($collection) /** * Returns minimal value from $collection. * - * @param array|Traversable $collection - * @return mixed + * @template TVal of numeric + * @param iterable $collection + * @return TVal */ function min($collection) { @@ -1627,7 +1808,7 @@ function min($collection) /** * Returns a string by concatenating the $collection values into a string. * - * @param array|Traversable $collection + * @param iterable $collection * @return string */ function toString($collection) @@ -1635,7 +1816,7 @@ function toString($collection) $result = ''; foreach ($collection as $value) { - $result .= (string) $value; + $result .= (string)$value; } return $result; @@ -1643,23 +1824,25 @@ function toString($collection) /** - * Returns a lazy collection with items from $collection, but items with keys that are found in keys of $replacementMap + * Returns a lazy collection with items from $collection, but items with keys that are found in keys of $replacementMap * are replaced by their values. * - * @param array|Traversable $collection - * @param array|Traversable $replacementMap - * @return Collection + * @template TKey + * @template TVal + * @param iterable $collection + * @param iterable $replacementMap + * @return iterable */ function replaceByKeys($collection, $replacementMap) { - $generatorFactory = function () use ($collection, $replacementMap) { + $factory = function () use ($collection, $replacementMap): iterable { foreach ($collection as $key => $value) { $newValue = getOrDefault($replacementMap, $key, $value); yield $key => $newValue; } }; - return new Collection($generatorFactory); + return new RewindableIterable($factory); } /** @@ -1686,7 +1869,7 @@ function replaceByKeys($collection, $replacementMap) * @param int|null $maxDepth * @return array|mixed */ -function dump($input, $maxItemsPerCollection = null, $maxDepth = null) +function dump($input, int $maxItemsPerCollection = null, int $maxDepth = null) { if (is_scalar($input)) { return $input; @@ -1710,7 +1893,7 @@ function dump($input, $maxItemsPerCollection = null, $maxDepth = null) $normalizedProperties[$betterKey] = dump( $value, $maxItemsPerCollection, - $maxDepth>0 ? $maxDepth-1 : null + $maxDepth > 0 ? $maxDepth - 1 : null ); break; @@ -1726,13 +1909,13 @@ function dump($input, $maxItemsPerCollection = null, $maxDepth = null) return '^^^'; } - $reflection = new \ReflectionObject($input); + $reflection = new ReflectionObject($input); $normalizedProperties = []; foreach ($reflection->getProperties() as $property) { $property->setAccessible(true); $normalizedProperties[$property->getName()] = $property->getValue($input); } - return [get_class($input) => dump($normalizedProperties, null, $maxDepth>0 ? $maxDepth-1 : null)]; + return [get_class($input) => dump($normalizedProperties, null, $maxDepth > 0 ? $maxDepth - 1 : null)]; } return gettype($input); @@ -1741,12 +1924,13 @@ function dump($input, $maxItemsPerCollection = null, $maxDepth = null) /** * Calls dump on $input and then prints it using the var_export. Returns $input. * - * @param mixed $input + * + * @param iterable $input * @param int|null $maxItemsPerCollection * @param int|null $maxDepth * @return mixed */ -function printDump($input, $maxItemsPerCollection = null, $maxDepth = null) +function printDump(iterable $input, int $maxItemsPerCollection = null, int $maxDepth = null) { var_export(dump($input, $maxItemsPerCollection, $maxDepth)); return $input; diff --git a/src/utility_functions.php b/src/utility_functions.php index b71228b..f78389d 100644 --- a/src/utility_functions.php +++ b/src/utility_functions.php @@ -2,6 +2,10 @@ namespace DusanKasan\Knapsack; +use ArrayIterator; +use Iterator; +use IteratorAggregate; + /** * Returns its argument. * @@ -51,3 +55,22 @@ function decrement($value) { return $value - 1; } + +/** + * Converts any iterable to an Iterator. + * + * @param iterable $iterable + * @return Iterator + */ +function iterableToIterator(iterable $iterable): Iterator { + if ($iterable instanceof IteratorAggregate) { + $iterable = $iterable->getIterator(); + } + + if ($iterable instanceof Iterator) { + return $iterable; + } + + /** @var array $iterable */ + return new ArrayIterator($iterable); +} \ No newline at end of file diff --git a/tests/scenarios/CallableFuctionNamesTest.php b/tests/scenarios/CallableFuctionNamesTest.php index 6c000cf..5ba731e 100644 --- a/tests/scenarios/CallableFuctionNamesTest.php +++ b/tests/scenarios/CallableFuctionNamesTest.php @@ -3,9 +3,10 @@ namespace DusanKasan\Knapsack\Tests\Scenarios; use DusanKasan\Knapsack\Collection; +use PHPUnit\Framework\TestCase; use PHPUnit_Framework_TestCase; -class CallableFunctionNamesTest extends PHPUnit_Framework_TestCase +class CallableFunctionNamesTest extends TestCase { /** * Example that it's possible to use callable function names as arguments. diff --git a/tests/scenarios/CustomPassthroughFunctionTest.php b/tests/scenarios/CustomPassthroughFunctionTest.php index 177e860..c757b78 100644 --- a/tests/scenarios/CustomPassthroughFunctionTest.php +++ b/tests/scenarios/CustomPassthroughFunctionTest.php @@ -3,9 +3,11 @@ namespace DusanKasan\Knapsack\Tests\Scenarios; use DusanKasan\Knapsack\Collection; +use DusanKasan\Knapsack\CollectionInterface; +use PHPUnit\Framework\TestCase; use PHPUnit_Framework_TestCase; -class CustomPassthroughFunctionTest extends PHPUnit_Framework_TestCase +class CustomPassthroughFunctionTest extends TestCase { /** * Example of implementing a transpose function and how to apply it over a collection. @@ -33,7 +35,7 @@ public function testIt() ]; //Must take and return a Collection - $transpose = function (Collection $collections) { + $transpose = function (CollectionInterface $collections) { $transposed = array_map( function (...$items) { return $items; diff --git a/tests/scenarios/FibonaccisSequenceTest.php b/tests/scenarios/FibonaccisSequenceTest.php index 0180275..bc23cac 100644 --- a/tests/scenarios/FibonaccisSequenceTest.php +++ b/tests/scenarios/FibonaccisSequenceTest.php @@ -3,9 +3,10 @@ namespace DusanKasan\Knapsack\Tests\Scenarios; use DusanKasan\Knapsack\Collection; +use PHPUnit\Framework\TestCase; use PHPUnit_Framework_TestCase; -class FibonaccisSequenceTest extends PHPUnit_Framework_TestCase +class FibonaccisSequenceTest extends TestCase { /** * Example generating first 5 values in fibonacci's sequence. diff --git a/tests/scenarios/GroupingFlightsTest.php b/tests/scenarios/GroupingFlightsTest.php index 5deb7d3..d72ff3d 100644 --- a/tests/scenarios/GroupingFlightsTest.php +++ b/tests/scenarios/GroupingFlightsTest.php @@ -3,13 +3,15 @@ namespace DusanKasan\Knapsack\Tests\Scenarios; use DusanKasan\Knapsack\Collection; +use DusanKasan\Knapsack\CollectionInterface; +use PHPUnit\Framework\TestCase; use PHPUnit_Framework_TestCase; /** * More advanced usage of collection pipeline, see * http://martinfowler.com/articles/refactoring-pipelines.html#GroupingFlightRecords for reference. */ -class GroupingFlightsTest extends PHPUnit_Framework_TestCase +class GroupingFlightsTest extends TestCase { private $inputData = [ [ @@ -54,7 +56,7 @@ public function testIt() $this->assertEquals($expected, $result); } - public function summarize(Collection $flights) + public function summarize(CollectionInterface $flights) { $numCancellations = $flights ->filter(function ($f) { diff --git a/tests/scenarios/MultipleOperationsTest.php b/tests/scenarios/MultipleOperationsTest.php index 32203ad..7e2a9c2 100644 --- a/tests/scenarios/MultipleOperationsTest.php +++ b/tests/scenarios/MultipleOperationsTest.php @@ -3,9 +3,10 @@ namespace DusanKasan\Knapsack\Tests\Scenarios; use DusanKasan\Knapsack\Collection; +use PHPUnit\Framework\TestCase; use PHPUnit_Framework_TestCase; -class MultipleOperationsTest extends PHPUnit_Framework_TestCase +class MultipleOperationsTest extends TestCase { /** * Example of a longer pipeline. If this was real code, you should probably split it into smaller chunks. diff --git a/tests/spec/CollectionSpec.php b/tests/spec/CollectionSpec.php index 89b4888..5bd94a4 100644 --- a/tests/spec/CollectionSpec.php +++ b/tests/spec/CollectionSpec.php @@ -5,6 +5,7 @@ use ArrayIterator; use DOMXPath; use DusanKasan\Knapsack\Collection; +use DusanKasan\Knapsack\CollectionInterface; use DusanKasan\Knapsack\Exceptions\InvalidArgument; use DusanKasan\Knapsack\Exceptions\InvalidReturnValue; use DusanKasan\Knapsack\Exceptions\ItemNotFound; @@ -242,7 +243,7 @@ function ($temp, $item, $key) { $this ->reduce( - function (Collection $temp, $item) { + function (CollectionInterface $temp, $item) { return $temp->append($item); }, new Collection([]) @@ -271,7 +272,7 @@ function it_can_sort() $this ->sort(function ($v1, $v2, $k1, $k2) { - return $k1 < $k2 || $v1 == $v2; + return -1 * ($k1 <=> $k2); }) ->toArray() ->shouldReturn([2 => 2, 1 => 1, 0 => 3]); @@ -403,8 +404,8 @@ function ($v) { ) ->shouldReturn('not found'); - $this->find('\DusanKasan\Knapsack\isCollection', null, true)->first()->shouldReturn(5); - $this->find('\DusanKasan\Knapsack\isCollection')->shouldReturn([5]); + $this->find(function($item) {return is_iterable($item);}, null, true)->first()->shouldReturn(5); + $this->find(function($item) {return is_iterable($item);})->shouldReturn([5]); } function it_can_count_by() @@ -556,7 +557,7 @@ function ($temp, $key, $item) { $this ->reduceRight( - function (Collection $temp, $item) { + function (CollectionInterface $temp, $item) { return $temp->append($item); }, new Collection([]) @@ -1080,7 +1081,7 @@ function it_can_use_callable_as_transformer() { $this->beConstructedWith([1, 2, 3]); $this - ->transform(function (Collection $collection) { + ->transform(function (CollectionInterface $collection) { return $collection->map('\DusanKasan\Knapsack\increment'); }) ->toArray() @@ -1091,7 +1092,7 @@ function it_can_use_callable_as_transformer() ->during( 'transform', [ - function (Collection $collection) { + function (CollectionInterface $collection) { return $collection->first(); }, ] @@ -1187,14 +1188,14 @@ function it_can_sum_the_collection() function it_can_get_average_of_the_collection() { $this->beConstructedWith([1, 2, 2, 3]); - $this->average()->shouldReturn(2); + $this->average()->shouldReturn(2.0); $this->append(3)->average()->shouldReturn(2.2); } function it_will_return_zero_when_average_is_called_on_empty_collection() { $this->beConstructedWith([]); - $this->average()->shouldReturn(0); + $this->average()->shouldReturn(0.0); } function it_can_get_maximal_value_in_the_colleciton() @@ -1266,12 +1267,12 @@ function it_can_transpose_arrays_of_different_lengths() function it_should_throw_an_invalid_argument_if_collection_items_are_not_collection() { $this->beConstructedWith([ - [1, 2, 3], + 1, [4, 5, 6], [7, 8, 9], ]); - $this->shouldThrow(InvalidArgument::class)->during('transpose'); + $this->transpose()->getIterator()->shouldThrow(InvalidArgument::class)->during('rewind'); } function it_can_use_the_utility_methods()