diff --git a/composer.json b/composer.json index 0e12860..1aad38d 100644 --- a/composer.json +++ b/composer.json @@ -35,6 +35,7 @@ "php": "^7.4 || ~8.0.0 || ~8.1.0", "ext-dom": "*", "ext-json": "*", + "psr/container": "^1.1.2 || ^2.0.2", "psr/http-factory": "^1.0", "psr/http-message": "^1.0.1", "psr/link": "^1.0", diff --git a/composer.lock b/composer.lock index b9f2487..d31ea8f 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,61 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "dfac9153c74306ea8f4d7eda11a78ab2", + "content-hash": "f1a4824c0ce1afa9f40075a072a3a575", "packages": [ + { + "name": "psr/container", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "shasum": "" + }, + "require": { + "php": ">=7.4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "support": { + "issues": "https://github.com/php-fig/container/issues", + "source": "https://github.com/php-fig/container/tree/2.0.2" + }, + "time": "2021-11-05T16:47:00+00:00" + }, { "name": "psr/http-factory", "version": "1.0.1", @@ -168,21 +221,24 @@ }, { "name": "symfony/polyfill-ctype", - "version": "v1.23.0", + "version": "v1.24.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce" + "reference": "30885182c981ab175d4d034db0f6f469898070ab" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/46cd95797e9df938fdd2b03693b5fca5e64b01ce", - "reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/30885182c981ab175d4d034db0f6f469898070ab", + "reference": "30885182c981ab175d4d034db0f6f469898070ab", "shasum": "" }, "require": { "php": ">=7.1" }, + "provide": { + "ext-ctype": "*" + }, "suggest": { "ext-ctype": "For best performance" }, @@ -227,7 +283,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.23.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.24.0" }, "funding": [ { @@ -243,7 +299,7 @@ "type": "tidelift" } ], - "time": "2021-02-19T12:13:01+00:00" + "time": "2021-10-20T20:35:02+00:00" }, { "name": "webmozart/assert", @@ -600,18 +656,89 @@ ], "time": "2021-09-13T08:41:34+00:00" }, + { + "name": "composer/pcre", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/composer/pcre.git", + "reference": "3d322d715c43a1ac36c7fe215fa59336265500f2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/pcre/zipball/3d322d715c43a1ac36c7fe215fa59336265500f2", + "reference": "3d322d715c43a1ac36c7fe215fa59336265500f2", + "shasum": "" + }, + "require": { + "php": "^5.3.2 || ^7.0 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^1", + "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": { + "Composer\\Pcre\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "PCRE wrapping library that offers type-safe preg_* replacements.", + "keywords": [ + "PCRE", + "preg", + "regex", + "regular expression" + ], + "support": { + "issues": "https://github.com/composer/pcre/issues", + "source": "https://github.com/composer/pcre/tree/1.0.0" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2021-12-06T15:17:27+00:00" + }, { "name": "composer/semver", - "version": "3.2.6", + "version": "3.2.7", "source": { "type": "git", "url": "https://github.com/composer/semver.git", - "reference": "83e511e247de329283478496f7a1e114c9517506" + "reference": "deac27056b57e46faf136fae7b449eeaa71661ee" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/83e511e247de329283478496f7a1e114c9517506", - "reference": "83e511e247de329283478496f7a1e114c9517506", + "url": "https://api.github.com/repos/composer/semver/zipball/deac27056b57e46faf136fae7b449eeaa71661ee", + "reference": "deac27056b57e46faf136fae7b449eeaa71661ee", "shasum": "" }, "require": { @@ -663,7 +790,7 @@ "support": { "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/semver/issues", - "source": "https://github.com/composer/semver/tree/3.2.6" + "source": "https://github.com/composer/semver/tree/3.2.7" }, "funding": [ { @@ -679,29 +806,31 @@ "type": "tidelift" } ], - "time": "2021-10-25T11:34:17+00:00" + "time": "2022-01-04T09:57:54+00:00" }, { "name": "composer/xdebug-handler", - "version": "2.0.2", + "version": "3.0.1", "source": { "type": "git", "url": "https://github.com/composer/xdebug-handler.git", - "reference": "84674dd3a7575ba617f5a76d7e9e29a7d3891339" + "reference": "12f1b79476638a5615ed00ea6adbb269cec96fd8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/84674dd3a7575ba617f5a76d7e9e29a7d3891339", - "reference": "84674dd3a7575ba617f5a76d7e9e29a7d3891339", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/12f1b79476638a5615ed00ea6adbb269cec96fd8", + "reference": "12f1b79476638a5615ed00ea6adbb269cec96fd8", "shasum": "" }, "require": { - "php": "^5.3.2 || ^7.0 || ^8.0", + "composer/pcre": "^1", + "php": "^7.2.5 || ^8.0", "psr/log": "^1 || ^2 || ^3" }, "require-dev": { - "phpstan/phpstan": "^0.12.55", - "symfony/phpunit-bridge": "^4.2 || ^5" + "phpstan/phpstan": "^1.0", + "phpstan/phpstan-strict-rules": "^1.1", + "symfony/phpunit-bridge": "^6.0" }, "type": "library", "autoload": { @@ -727,7 +856,7 @@ "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.2" + "source": "https://github.com/composer/xdebug-handler/tree/3.0.1" }, "funding": [ { @@ -743,7 +872,7 @@ "type": "tidelift" } ], - "time": "2021-07-31T17:03:58+00:00" + "time": "2022-01-04T18:29:42+00:00" }, { "name": "dealerdirect/phpcodesniffer-composer-installer", @@ -852,78 +981,6 @@ }, "time": "2019-12-04T15:06:13+00:00" }, - { - "name": "doctrine/annotations", - "version": "1.13.2", - "source": { - "type": "git", - "url": "https://github.com/doctrine/annotations.git", - "reference": "5b668aef16090008790395c02c893b1ba13f7e08" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/annotations/zipball/5b668aef16090008790395c02c893b1ba13f7e08", - "reference": "5b668aef16090008790395c02c893b1ba13f7e08", - "shasum": "" - }, - "require": { - "doctrine/lexer": "1.*", - "ext-tokenizer": "*", - "php": "^7.1 || ^8.0", - "psr/cache": "^1 || ^2 || ^3" - }, - "require-dev": { - "doctrine/cache": "^1.11 || ^2.0", - "doctrine/coding-standard": "^6.0 || ^8.1", - "phpstan/phpstan": "^0.12.20", - "phpunit/phpunit": "^7.5 || ^8.0 || ^9.1.5", - "symfony/cache": "^4.4 || ^5.2" - }, - "type": "library", - "autoload": { - "psr-4": { - "Doctrine\\Common\\Annotations\\": "lib/Doctrine/Common/Annotations" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "description": "Docblock Annotations Parser", - "homepage": "https://www.doctrine-project.org/projects/annotations.html", - "keywords": [ - "annotations", - "docblock", - "parser" - ], - "support": { - "issues": "https://github.com/doctrine/annotations/issues", - "source": "https://github.com/doctrine/annotations/tree/1.13.2" - }, - "time": "2021-08-05T19:00:23+00:00" - }, { "name": "doctrine/cache", "version": "2.1.1", @@ -1094,16 +1151,16 @@ }, { "name": "doctrine/common", - "version": "3.2.0", + "version": "3.2.1", "source": { "type": "git", "url": "https://github.com/doctrine/common.git", - "reference": "6d970a11479275300b5144e9373ce5feacfa9b91" + "reference": "e927fc2410c8723d053b8032e591cdff76587cdb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/common/zipball/6d970a11479275300b5144e9373ce5feacfa9b91", - "reference": "6d970a11479275300b5144e9373ce5feacfa9b91", + "url": "https://api.github.com/repos/doctrine/common/zipball/e927fc2410c8723d053b8032e591cdff76587cdb", + "reference": "e927fc2410c8723d053b8032e591cdff76587cdb", "shasum": "" }, "require": { @@ -1111,9 +1168,9 @@ "php": "^7.1 || ^8.0" }, "require-dev": { - "doctrine/coding-standard": "^6.0 || ^8.0", - "phpstan/phpstan": "^0.12", - "phpstan/phpstan-phpunit": "^0.12", + "doctrine/coding-standard": "^9.0", + "phpstan/phpstan": "^1.2.0", + "phpstan/phpstan-phpunit": "^1", "phpunit/phpunit": "^7.5.20 || ^8.5 || ^9.0", "squizlabs/php_codesniffer": "^3.0", "symfony/phpunit-bridge": "^4.0.5", @@ -1164,7 +1221,7 @@ ], "support": { "issues": "https://github.com/doctrine/common/issues", - "source": "https://github.com/doctrine/common/tree/3.2.0" + "source": "https://github.com/doctrine/common/tree/3.2.1" }, "funding": [ { @@ -1180,20 +1237,20 @@ "type": "tidelift" } ], - "time": "2021-10-19T06:47:22+00:00" + "time": "2021-12-26T22:39:45+00:00" }, { "name": "doctrine/dbal", - "version": "3.2.0", + "version": "3.2.1", "source": { "type": "git", "url": "https://github.com/doctrine/dbal.git", - "reference": "5d54f63541d7bed1156cb5c9b79274ced61890e4" + "reference": "4caf37acf14b513a91dd4f087f7eda424fa25542" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/dbal/zipball/5d54f63541d7bed1156cb5c9b79274ced61890e4", - "reference": "5d54f63541d7bed1156cb5c9b79274ced61890e4", + "url": "https://api.github.com/repos/doctrine/dbal/zipball/4caf37acf14b513a91dd4f087f7eda424fa25542", + "reference": "4caf37acf14b513a91dd4f087f7eda424fa25542", "shasum": "" }, "require": { @@ -1208,14 +1265,14 @@ "require-dev": { "doctrine/coding-standard": "9.0.0", "jetbrains/phpstorm-stubs": "2021.1", - "phpstan/phpstan": "1.2.0", + "phpstan/phpstan": "1.3.0", "phpstan/phpstan-strict-rules": "^1.1", - "phpunit/phpunit": "9.5.10", + "phpunit/phpunit": "9.5.11", "psalm/plugin-phpunit": "0.16.1", - "squizlabs/php_codesniffer": "3.6.1", + "squizlabs/php_codesniffer": "3.6.2", "symfony/cache": "^5.2|^6.0", "symfony/console": "^2.0.5|^3.0|^4.0|^5.0|^6.0", - "vimeo/psalm": "4.13.0" + "vimeo/psalm": "4.16.1" }, "suggest": { "symfony/console": "For helpful console commands such as SQL execution and import of files." @@ -1275,7 +1332,7 @@ ], "support": { "issues": "https://github.com/doctrine/dbal/issues", - "source": "https://github.com/doctrine/dbal/tree/3.2.0" + "source": "https://github.com/doctrine/dbal/tree/3.2.1" }, "funding": [ { @@ -1291,7 +1348,7 @@ "type": "tidelift" } ], - "time": "2021-11-26T21:00:12+00:00" + "time": "2022-01-05T08:52:06+00:00" }, { "name": "doctrine/deprecations", @@ -1672,16 +1729,16 @@ }, { "name": "doctrine/orm", - "version": "2.10.3", + "version": "2.10.4", "source": { "type": "git", "url": "https://github.com/doctrine/orm.git", - "reference": "7b242753466508e1dd10f67c1baee95785f845c1" + "reference": "cccb2e2fdfed2969afb3d65c5ea82bafdefbe1a7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/orm/zipball/7b242753466508e1dd10f67c1baee95785f845c1", - "reference": "7b242753466508e1dd10f67c1baee95785f845c1", + "url": "https://api.github.com/repos/doctrine/orm/zipball/cccb2e2fdfed2969afb3d65c5ea82bafdefbe1a7", + "reference": "cccb2e2fdfed2969afb3d65c5ea82bafdefbe1a7", "shasum": "" }, "require": { @@ -1713,10 +1770,10 @@ "phpbench/phpbench": "^0.16.10 || ^1.0", "phpstan/phpstan": "1.2.0", "phpunit/phpunit": "^7.5 || ^8.5 || ^9.4", - "squizlabs/php_codesniffer": "3.6.1", + "squizlabs/php_codesniffer": "3.6.2", "symfony/cache": "^4.4 || ^5.2", "symfony/yaml": "^3.4 || ^4.0 || ^5.0 || ^6.0", - "vimeo/psalm": "4.13.1" + "vimeo/psalm": "4.15.0" }, "suggest": { "symfony/cache": "Provides cache support for Setup Tool with doctrine/cache 2.0", @@ -1765,44 +1822,45 @@ ], "support": { "issues": "https://github.com/doctrine/orm/issues", - "source": "https://github.com/doctrine/orm/tree/2.10.3" + "source": "https://github.com/doctrine/orm/tree/2.10.4" }, - "time": "2021-12-03T12:27:05+00:00" + "time": "2021-12-20T21:23:47+00:00" }, { "name": "doctrine/persistence", - "version": "2.2.3", + "version": "2.3.0", "source": { "type": "git", "url": "https://github.com/doctrine/persistence.git", - "reference": "5e7bdbbfe9811c06e1f745d1c166647d5c47d6ee" + "reference": "f8af155c1e7963f3d2b4415097d55757bbaa53d8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/persistence/zipball/5e7bdbbfe9811c06e1f745d1c166647d5c47d6ee", - "reference": "5e7bdbbfe9811c06e1f745d1c166647d5c47d6ee", + "url": "https://api.github.com/repos/doctrine/persistence/zipball/f8af155c1e7963f3d2b4415097d55757bbaa53d8", + "reference": "f8af155c1e7963f3d2b4415097d55757bbaa53d8", "shasum": "" }, "require": { - "doctrine/annotations": "^1.0", "doctrine/cache": "^1.11 || ^2.0", "doctrine/collections": "^1.0", "doctrine/deprecations": "^0.5.3", "doctrine/event-manager": "^1.0", "php": "^7.1 || ^8.0", - "psr/cache": "^1.0|^2.0|^3.0" + "psr/cache": "^1.0 || ^2.0 || ^3.0" }, "conflict": { + "doctrine/annotations": "<1.0 || >=2.0", "doctrine/common": "<2.10@dev" }, "require-dev": { "composer/package-versions-deprecated": "^1.11", + "doctrine/annotations": "^1.0", "doctrine/coding-standard": "^6.0 || ^9.0", "doctrine/common": "^3.0", - "phpstan/phpstan": "0.12.84", + "phpstan/phpstan": "1.2.0", "phpunit/phpunit": "^7.5.20 || ^8.0 || ^9.0", - "symfony/cache": "^4.4|^5.0", - "vimeo/psalm": "4.7.0" + "symfony/cache": "^4.4 || ^5.0 || ^6.0", + "vimeo/psalm": "4.13.1" }, "type": "library", "autoload": { @@ -1852,9 +1910,9 @@ ], "support": { "issues": "https://github.com/doctrine/persistence/issues", - "source": "https://github.com/doctrine/persistence/tree/2.2.3" + "source": "https://github.com/doctrine/persistence/tree/2.3.0" }, - "time": "2021-10-25T19:59:10+00:00" + "time": "2022-01-09T19:58:46+00:00" }, { "name": "felixfbecker/advanced-json-rpc", @@ -2145,36 +2203,37 @@ }, { "name": "laminas/laminas-paginator", - "version": "2.11.0", + "version": "2.12.1", "source": { "type": "git", "url": "https://github.com/laminas/laminas-paginator.git", - "reference": "7f00d5fdecd1b4f67c8e84e6f6d57bbabda4b7d8" + "reference": "fe51fdf2c938f7f8299e67c6f19628d890ef6868" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-paginator/zipball/7f00d5fdecd1b4f67c8e84e6f6d57bbabda4b7d8", - "reference": "7f00d5fdecd1b4f67c8e84e6f6d57bbabda4b7d8", + "url": "https://api.github.com/repos/laminas/laminas-paginator/zipball/fe51fdf2c938f7f8299e67c6f19628d890ef6868", + "reference": "fe51fdf2c938f7f8299e67c6f19628d890ef6868", "shasum": "" }, "require": { "ext-json": "*", - "laminas/laminas-stdlib": "^3.6.0", - "php": "^7.3 || ~8.0.0 || ~8.1.0" + "laminas/laminas-stdlib": "^3.6.2", + "php": "^7.4 || ~8.0.0 || ~8.1.0" }, "conflict": { "zendframework/zend-paginator": "*" }, "require-dev": { - "laminas/laminas-cache": "^2.13.0", - "laminas/laminas-coding-standard": "~2.1.4", - "laminas/laminas-config": "^2.6.0", - "laminas/laminas-filter": "^2.11.1", - "laminas/laminas-servicemanager": "^3.7.0", - "laminas/laminas-view": "^2.14.1", + "laminas/laminas-cache": "^3.1.2", + "laminas/laminas-cache-storage-adapter-memory": "^2.0.0", + "laminas/laminas-coding-standard": "^2.3.0", + "laminas/laminas-config": "^3.7.0", + "laminas/laminas-filter": "^2.13.0", + "laminas/laminas-servicemanager": "^3.10.0", + "laminas/laminas-view": "^2.15.0", "phpunit/phpunit": "^9.5.10", - "psalm/plugin-phpunit": "^0.15.1", - "vimeo/psalm": "^4.10.0" + "psalm/plugin-phpunit": "^0.16.1", + "vimeo/psalm": "^4.15.0" }, "suggest": { "laminas/laminas-cache": "Laminas\\Cache component to support cache features", @@ -2219,20 +2278,20 @@ "type": "community_bridge" } ], - "time": "2021-10-14T15:59:50+00:00" + "time": "2021-12-17T16:45:14+00:00" }, { "name": "laminas/laminas-stdlib", - "version": "3.6.1", + "version": "3.7.0", "source": { "type": "git", "url": "https://github.com/laminas/laminas-stdlib.git", - "reference": "db581851a092246ad99e12d4fddf105184924c71" + "reference": "cba75fad2053bb5dc8d3e7f5e62b61d75eecfaf1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-stdlib/zipball/db581851a092246ad99e12d4fddf105184924c71", - "reference": "db581851a092246ad99e12d4fddf105184924c71", + "url": "https://api.github.com/repos/laminas/laminas-stdlib/zipball/cba75fad2053bb5dc8d3e7f5e62b61d75eecfaf1", + "reference": "cba75fad2053bb5dc8d3e7f5e62b61d75eecfaf1", "shasum": "" }, "require": { @@ -2243,8 +2302,8 @@ }, "require-dev": { "laminas/laminas-coding-standard": "~2.3.0", - "phpbench/phpbench": "^0.17.1", - "phpunit/phpunit": "~9.3.7", + "phpbench/phpbench": "^1.0", + "phpunit/phpunit": "^9.3.7", "psalm/plugin-phpunit": "^0.16.0", "vimeo/psalm": "^4.7" }, @@ -2278,26 +2337,26 @@ "type": "community_bridge" } ], - "time": "2021-11-10T11:33:52+00:00" + "time": "2022-01-10T11:18:55+00:00" }, { "name": "mezzio/mezzio-helpers", - "version": "5.7.0", + "version": "5.8.0", "source": { "type": "git", "url": "https://github.com/mezzio/mezzio-helpers.git", - "reference": "8ba1bcf38689db21e2ccac699d99b66ded700162" + "reference": "6e231cd6ad09eae7c2d9bac71441b496159dba28" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/mezzio/mezzio-helpers/zipball/8ba1bcf38689db21e2ccac699d99b66ded700162", - "reference": "8ba1bcf38689db21e2ccac699d99b66ded700162", + "url": "https://api.github.com/repos/mezzio/mezzio-helpers/zipball/6e231cd6ad09eae7c2d9bac71441b496159dba28", + "reference": "6e231cd6ad09eae7c2d9bac71441b496159dba28", "shasum": "" }, "require": { "mezzio/mezzio-router": "^3.0", - "php": "^7.3 || ~8.0.0 || ~8.1.0", - "psr/container": "^1.0", + "php": "^7.4 || ~8.0.0 || ~8.1.0", + "psr/container": "^1.0 || ^2.0", "psr/http-message": "^1.0.1", "psr/http-server-middleware": "^1.0" }, @@ -2306,13 +2365,13 @@ }, "require-dev": { "ext-json": "*", - "laminas/laminas-coding-standard": "~2.2.0", + "laminas/laminas-coding-standard": "~2.3.0", "laminas/laminas-diactoros": "^2.5.0", "mockery/mockery": "^1.4.2", "phpspec/prophecy-phpunit": "^2.0", - "phpunit/phpunit": "^9.4.2", + "phpunit/phpunit": "^9.5.11", "psalm/plugin-phpunit": "^0.15.1", - "vimeo/psalm": "^4.7" + "vimeo/psalm": "^4.17" }, "suggest": { "ext-json": "If you wish to use the JsonStrategy with BodyParamsMiddleware" @@ -2356,26 +2415,26 @@ "type": "community_bridge" } ], - "time": "2021-10-13T17:13:37+00:00" + "time": "2022-01-06T16:10:11+00:00" }, { "name": "mezzio/mezzio-router", - "version": "3.7.0", + "version": "3.8.0", "source": { "type": "git", "url": "https://github.com/mezzio/mezzio-router.git", - "reference": "08d52bdad8a9e89ef482a10516264563bd596c93" + "reference": "27075d3e9b407791abf7ba5e62954a59be4b18df" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/mezzio/mezzio-router/zipball/08d52bdad8a9e89ef482a10516264563bd596c93", - "reference": "08d52bdad8a9e89ef482a10516264563bd596c93", + "url": "https://api.github.com/repos/mezzio/mezzio-router/zipball/27075d3e9b407791abf7ba5e62954a59be4b18df", + "reference": "27075d3e9b407791abf7ba5e62954a59be4b18df", "shasum": "" }, "require": { "fig/http-message-util": "^1.1.2", - "php": "^7.3 || ~8.0.0 || ~8.1.0", - "psr/container": "^1.0", + "php": "^7.4 || ~8.0.0 || ~8.1.0", + "psr/container": "^1.0 || ^2.0", "psr/http-factory": "^1.0", "psr/http-message": "^1.0.1", "psr/http-server-middleware": "^1.0", @@ -2386,14 +2445,14 @@ "zendframework/zend-expressive-router": "*" }, "require-dev": { - "laminas/laminas-coding-standard": "~2.2.0", + "laminas/laminas-coding-standard": "~2.3.0", "laminas/laminas-diactoros": "^2.6", "laminas/laminas-stratigility": "^3.4", "phpspec/prophecy": "^1.9", "phpspec/prophecy-phpunit": "^2.0", - "phpunit/phpunit": "^9.4.1", + "phpunit/phpunit": "^9.5.11", "psalm/plugin-phpunit": "^0.15.0", - "vimeo/psalm": "^4.3" + "vimeo/psalm": "^4.17" }, "suggest": { "mezzio/mezzio-aurarouter": "^3.0 to use the Aura.Router routing adapter", @@ -2439,7 +2498,7 @@ "type": "community_bridge" } ], - "time": "2021-09-14T04:06:31+00:00" + "time": "2022-01-06T16:27:49+00:00" }, { "name": "myclabs/deep-copy", @@ -2882,16 +2941,16 @@ }, { "name": "phpdocumentor/type-resolver", - "version": "1.5.1", + "version": "1.6.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "a12f7e301eb7258bb68acd89d4aefa05c2906cae" + "reference": "93ebd0014cab80c4ea9f5e297ea48672f1b87706" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/a12f7e301eb7258bb68acd89d4aefa05c2906cae", - "reference": "a12f7e301eb7258bb68acd89d4aefa05c2906cae", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/93ebd0014cab80c4ea9f5e297ea48672f1b87706", + "reference": "93ebd0014cab80c4ea9f5e297ea48672f1b87706", "shasum": "" }, "require": { @@ -2926,22 +2985,22 @@ "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.5.1" + "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.6.0" }, - "time": "2021-10-02T14:08:47+00:00" + "time": "2022-01-04T19:58:01+00:00" }, { "name": "phpspec/prophecy", - "version": "1.14.0", + "version": "v1.15.0", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "d86dfc2e2a3cd366cee475e52c6bb3bbc371aa0e" + "reference": "bbcd7380b0ebf3961ee21409db7b38bc31d69a13" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/d86dfc2e2a3cd366cee475e52c6bb3bbc371aa0e", - "reference": "d86dfc2e2a3cd366cee475e52c6bb3bbc371aa0e", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/bbcd7380b0ebf3961ee21409db7b38bc31d69a13", + "reference": "bbcd7380b0ebf3961ee21409db7b38bc31d69a13", "shasum": "" }, "require": { @@ -2993,9 +3052,9 @@ ], "support": { "issues": "https://github.com/phpspec/prophecy/issues", - "source": "https://github.com/phpspec/prophecy/tree/1.14.0" + "source": "https://github.com/phpspec/prophecy/tree/v1.15.0" }, - "time": "2021-09-10T09:02:12+00:00" + "time": "2021-12-08T12:19:24+00:00" }, { "name": "phpspec/prophecy-phpunit", @@ -3418,16 +3477,16 @@ }, { "name": "phpunit/phpunit", - "version": "9.5.10", + "version": "9.5.11", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "c814a05837f2edb0d1471d6e3f4ab3501ca3899a" + "reference": "2406855036db1102126125537adb1406f7242fdd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/c814a05837f2edb0d1471d6e3f4ab3501ca3899a", - "reference": "c814a05837f2edb0d1471d6e3f4ab3501ca3899a", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/2406855036db1102126125537adb1406f7242fdd", + "reference": "2406855036db1102126125537adb1406f7242fdd", "shasum": "" }, "require": { @@ -3505,11 +3564,11 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.10" + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.11" }, "funding": [ { - "url": "https://phpunit.de/donate.html", + "url": "https://phpunit.de/sponsors.html", "type": "custom" }, { @@ -3517,7 +3576,7 @@ "type": "github" } ], - "time": "2021-09-25T07:38:51+00:00" + "time": "2021-12-25T07:07:57+00:00" }, { "name": "psalm/plugin-phpunit", @@ -3628,54 +3687,6 @@ }, "time": "2016-08-06T20:24:11+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/http-server-handler", "version": "1.0.1", @@ -4806,16 +4817,16 @@ }, { "name": "slevomat/coding-standard", - "version": "7.0.17", + "version": "7.0.18", "source": { "type": "git", "url": "https://github.com/slevomat/coding-standard.git", - "reference": "b574727867bc5bba9d28a2a7093fc8ceeda56350" + "reference": "b81ac84f41a4797dc25c8ede1b0718e2a74be0fc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/slevomat/coding-standard/zipball/b574727867bc5bba9d28a2a7093fc8ceeda56350", - "reference": "b574727867bc5bba9d28a2a7093fc8ceeda56350", + "url": "https://api.github.com/repos/slevomat/coding-standard/zipball/b81ac84f41a4797dc25c8ede1b0718e2a74be0fc", + "reference": "b81ac84f41a4797dc25c8ede1b0718e2a74be0fc", "shasum": "" }, "require": { @@ -4851,7 +4862,7 @@ "description": "Slevomat Coding Standard for PHP_CodeSniffer complements Consistence Coding Standard by providing sniffs with additional checks.", "support": { "issues": "https://github.com/slevomat/coding-standard/issues", - "source": "https://github.com/slevomat/coding-standard/tree/7.0.17" + "source": "https://github.com/slevomat/coding-standard/tree/7.0.18" }, "funding": [ { @@ -4863,20 +4874,20 @@ "type": "tidelift" } ], - "time": "2021-12-06T22:13:58+00:00" + "time": "2021-12-07T17:19:06+00:00" }, { "name": "squizlabs/php_codesniffer", - "version": "3.6.1", + "version": "3.6.2", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "f268ca40d54617c6e06757f83f699775c9b3ff2e" + "reference": "5e4e71592f69da17871dba6e80dd51bce74a351a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/f268ca40d54617c6e06757f83f699775c9b3ff2e", - "reference": "f268ca40d54617c6e06757f83f699775c9b3ff2e", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/5e4e71592f69da17871dba6e80dd51bce74a351a", + "reference": "5e4e71592f69da17871dba6e80dd51bce74a351a", "shasum": "" }, "require": { @@ -4919,27 +4930,27 @@ "source": "https://github.com/squizlabs/PHP_CodeSniffer", "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki" }, - "time": "2021-10-11T04:00:11+00:00" + "time": "2021-12-12T21:44:58+00:00" }, { "name": "symfony/console", - "version": "v5.4.0", + "version": "v5.4.2", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "ec3661faca1d110d6c307e124b44f99ac54179e3" + "reference": "a2c6b7ced2eb7799a35375fb9022519282b5405e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/ec3661faca1d110d6c307e124b44f99ac54179e3", - "reference": "ec3661faca1d110d6c307e124b44f99ac54179e3", + "url": "https://api.github.com/repos/symfony/console/zipball/a2c6b7ced2eb7799a35375fb9022519282b5405e", + "reference": "a2c6b7ced2eb7799a35375fb9022519282b5405e", "shasum": "" }, "require": { "php": ">=7.2.5", "symfony/deprecation-contracts": "^2.1|^3", "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php73": "^1.8", + "symfony/polyfill-php73": "^1.9", "symfony/polyfill-php80": "^1.16", "symfony/service-contracts": "^1.1|^2|^3", "symfony/string": "^5.1|^6.0" @@ -5002,7 +5013,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v5.4.0" + "source": "https://github.com/symfony/console/tree/v5.4.2" }, "funding": [ { @@ -5018,7 +5029,7 @@ "type": "tidelift" } ], - "time": "2021-11-29T15:30:56+00:00" + "time": "2021-12-20T16:11:12+00:00" }, { "name": "symfony/deprecation-contracts", @@ -5089,16 +5100,16 @@ }, { "name": "symfony/polyfill-intl-grapheme", - "version": "v1.23.1", + "version": "v1.24.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "16880ba9c5ebe3642d1995ab866db29270b36535" + "reference": "81b86b50cf841a64252b439e738e97f4a34e2783" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/16880ba9c5ebe3642d1995ab866db29270b36535", - "reference": "16880ba9c5ebe3642d1995ab866db29270b36535", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/81b86b50cf841a64252b439e738e97f4a34e2783", + "reference": "81b86b50cf841a64252b439e738e97f4a34e2783", "shasum": "" }, "require": { @@ -5150,7 +5161,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.23.1" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.24.0" }, "funding": [ { @@ -5166,11 +5177,11 @@ "type": "tidelift" } ], - "time": "2021-05-27T12:26:48+00:00" + "time": "2021-11-23T21:10:46+00:00" }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.23.0", + "version": "v1.24.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", @@ -5234,7 +5245,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.23.0" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.24.0" }, "funding": [ { @@ -5254,21 +5265,24 @@ }, { "name": "symfony/polyfill-mbstring", - "version": "v1.23.1", + "version": "v1.24.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6" + "reference": "0abb51d2f102e00a4eefcf46ba7fec406d245825" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9174a3d80210dca8daa7f31fec659150bbeabfc6", - "reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/0abb51d2f102e00a4eefcf46ba7fec406d245825", + "reference": "0abb51d2f102e00a4eefcf46ba7fec406d245825", "shasum": "" }, "require": { "php": ">=7.1" }, + "provide": { + "ext-mbstring": "*" + }, "suggest": { "ext-mbstring": "For best performance" }, @@ -5314,7 +5328,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.23.1" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.24.0" }, "funding": [ { @@ -5330,11 +5344,11 @@ "type": "tidelift" } ], - "time": "2021-05-27T12:26:48+00:00" + "time": "2021-11-30T18:21:41+00:00" }, { "name": "symfony/polyfill-php72", - "version": "v1.23.0", + "version": "v1.24.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php72.git", @@ -5390,7 +5404,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php72/tree/v1.23.0" + "source": "https://github.com/symfony/polyfill-php72/tree/v1.24.0" }, "funding": [ { @@ -5410,16 +5424,16 @@ }, { "name": "symfony/polyfill-php73", - "version": "v1.23.0", + "version": "v1.24.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "fba8933c384d6476ab14fb7b8526e5287ca7e010" + "reference": "cc5db0e22b3cb4111010e48785a97f670b350ca5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/fba8933c384d6476ab14fb7b8526e5287ca7e010", - "reference": "fba8933c384d6476ab14fb7b8526e5287ca7e010", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/cc5db0e22b3cb4111010e48785a97f670b350ca5", + "reference": "cc5db0e22b3cb4111010e48785a97f670b350ca5", "shasum": "" }, "require": { @@ -5469,7 +5483,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php73/tree/v1.23.0" + "source": "https://github.com/symfony/polyfill-php73/tree/v1.24.0" }, "funding": [ { @@ -5485,20 +5499,20 @@ "type": "tidelift" } ], - "time": "2021-02-19T12:13:01+00:00" + "time": "2021-06-05T21:20:04+00:00" }, { "name": "symfony/polyfill-php80", - "version": "v1.23.1", + "version": "v1.24.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "1100343ed1a92e3a38f9ae122fc0eb21602547be" + "reference": "57b712b08eddb97c762a8caa32c84e037892d2e9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/1100343ed1a92e3a38f9ae122fc0eb21602547be", - "reference": "1100343ed1a92e3a38f9ae122fc0eb21602547be", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/57b712b08eddb97c762a8caa32c84e037892d2e9", + "reference": "57b712b08eddb97c762a8caa32c84e037892d2e9", "shasum": "" }, "require": { @@ -5552,7 +5566,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.23.1" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.24.0" }, "funding": [ { @@ -5568,41 +5582,33 @@ "type": "tidelift" } ], - "time": "2021-07-28T13:41:28+00:00" + "time": "2021-09-13T13:58:33+00:00" }, { "name": "symfony/service-contracts", - "version": "v2.5.0", + "version": "v1.1.2", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "1ab11b933cd6bc5464b08e81e2c5b07dec58b0fc" + "reference": "191afdcb5804db960d26d8566b7e9a2843cab3a0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/1ab11b933cd6bc5464b08e81e2c5b07dec58b0fc", - "reference": "1ab11b933cd6bc5464b08e81e2c5b07dec58b0fc", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/191afdcb5804db960d26d8566b7e9a2843cab3a0", + "reference": "191afdcb5804db960d26d8566b7e9a2843cab3a0", "shasum": "" }, "require": { - "php": ">=7.2.5", - "psr/container": "^1.1", - "symfony/deprecation-contracts": "^2.1" - }, - "conflict": { - "ext-psr": "<1.1|>=2" + "php": "^7.1.3" }, "suggest": { + "psr/container": "", "symfony/service-implementation": "" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "2.5-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" + "dev-master": "1.1-dev" } }, "autoload": { @@ -5635,36 +5641,22 @@ "standards" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/v2.5.0" + "source": "https://github.com/symfony/service-contracts/tree/v1.1.2" }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2021-11-04T16:48:04+00:00" + "time": "2019-05-28T07:50:59+00:00" }, { "name": "symfony/string", - "version": "v5.4.0", + "version": "v5.4.2", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "9ffaaba53c61ba75a3c7a3a779051d1e9ec4fd2d" + "reference": "e6a5d5ecf6589c5247d18e0e74e30b11dfd51a3d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/9ffaaba53c61ba75a3c7a3a779051d1e9ec4fd2d", - "reference": "9ffaaba53c61ba75a3c7a3a779051d1e9ec4fd2d", + "url": "https://api.github.com/repos/symfony/string/zipball/e6a5d5ecf6589c5247d18e0e74e30b11dfd51a3d", + "reference": "e6a5d5ecf6589c5247d18e0e74e30b11dfd51a3d", "shasum": "" }, "require": { @@ -5721,7 +5713,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v5.4.0" + "source": "https://github.com/symfony/string/tree/v5.4.2" }, "funding": [ { @@ -5737,7 +5729,7 @@ "type": "tidelift" } ], - "time": "2021-11-24T10:02:00+00:00" + "time": "2021-12-16T21:52:00+00:00" }, { "name": "theseer/tokenizer", @@ -5791,16 +5783,16 @@ }, { "name": "vimeo/psalm", - "version": "v4.14.0", + "version": "4.18.1", "source": { "type": "git", "url": "https://github.com/vimeo/psalm.git", - "reference": "14dcbc908ab2625cd7a74258ee6c740cbecc6140" + "reference": "dda05fa913f4dc6eb3386f2f7ce5a45d37a71bcb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vimeo/psalm/zipball/14dcbc908ab2625cd7a74258ee6c740cbecc6140", - "reference": "14dcbc908ab2625cd7a74258ee6c740cbecc6140", + "url": "https://api.github.com/repos/vimeo/psalm/zipball/dda05fa913f4dc6eb3386f2f7ce5a45d37a71bcb", + "reference": "dda05fa913f4dc6eb3386f2f7ce5a45d37a71bcb", "shasum": "" }, "require": { @@ -5808,7 +5800,7 @@ "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", + "composer/xdebug-handler": "^1.1 || ^2.0 || ^3.0", "dnoegel/php-xdg-base-dir": "^0.1.1", "ext-ctype": "*", "ext-dom": "*", @@ -5891,9 +5883,9 @@ ], "support": { "issues": "https://github.com/vimeo/psalm/issues", - "source": "https://github.com/vimeo/psalm/tree/v4.14.0" + "source": "https://github.com/vimeo/psalm/tree/4.18.1" }, - "time": "2021-12-04T17:49:24+00:00" + "time": "2022-01-08T21:21:26+00:00" }, { "name": "webimpress/coding-standard", diff --git a/psalm-baseline.xml b/psalm-baseline.xml index 49a131c..9c77978 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -1,18 +1,12 @@ - + is_object($resource) - - $containsNonLinkItem - $isResource - $item - $item + $key - $link $links - $matchesCollection $name $name $rel @@ -24,8 +18,7 @@ function ($item) { function (array $byRelation, LinkInterface $link) { - - $item + $links $links $name @@ -82,9 +75,6 @@ $this->aggregateEmbeddedCollection($name, $resource, $context) HalResource|HalResource[] - - $resource - gettype($resource) @@ -118,12 +108,6 @@ ! is_string($rel) is_object($rel) - - $isInvalid - $isString - $value - $value - $rel diff --git a/src/HalResource.php b/src/HalResource.php index 5854efb..03dd8c8 100644 --- a/src/HalResource.php +++ b/src/HalResource.php @@ -13,10 +13,8 @@ use Webmozart\Assert\Assert; use function array_key_exists; -use function array_keys; use function array_map; use function array_merge; -use function array_push; use function array_reduce; use function array_shift; use function array_walk; @@ -26,7 +24,6 @@ use function in_array; use function is_array; use function is_object; -use function sort; use function sprintf; /** @@ -58,7 +55,7 @@ public function __construct(array $data = [], array $links = [], array $embedded $this->validateElementName($name, $context); if ( ! empty($value) - && ($value instanceof self || $this->isResourceCollection($value, $name, $context)) + && ($value instanceof self || $this->isResourceCollection($value)) ) { $this->embedded[$name] = $value; return; @@ -69,7 +66,7 @@ public function __construct(array $data = [], array $links = [], array $embedded array_walk($embedded, function ($resource, $name) use ($context) { $this->validateElementName($name, $context); $this->detectCollisionWithData($name, $context); - if (! ($resource instanceof self || $this->isResourceCollection($resource, $name, $context))) { + if (! ($resource instanceof self || $this->isResourceCollection($resource))) { throw new InvalidArgumentException(sprintf( 'Invalid embedded resource provided to %s constructor with name "%s"', $context, @@ -147,7 +144,7 @@ public function withElement(string $name, $value): HalResource if ( ! empty($value) - && ($value instanceof self || $this->isResourceCollection($value, $name, __METHOD__)) + && ($value instanceof self || $this->isResourceCollection($value)) ) { return $this->embed($name, $value); } @@ -211,7 +208,7 @@ public function embed(string $name, $resource, bool $forceCollection = false): H { $this->validateElementName($name, __METHOD__); $this->detectCollisionWithData($name, __METHOD__); - if (! $resource instanceof self && ! $this->isResourceCollection($resource, $name, __METHOD__)) { + if (! $resource instanceof self && ! $this->isResourceCollection($resource)) { throw new InvalidArgumentException(sprintf( '%s expects a %s instance or array of %s instances; received %s', __METHOD__, @@ -328,12 +325,6 @@ private function aggregateEmbeddedResource(string $name, $resource, string $cont // $resource is a HalResource; existing resource is also a HalResource if ($this->embedded[$name] instanceof self) { - $this->compareResources( - $this->embedded[$name], - $resource, - $name, - $context - ); return [$this->embedded[$name], $resource]; } @@ -350,14 +341,7 @@ private function aggregateEmbeddedResource(string $name, $resource, string $cont } // $resource is a HalResource; existing collection present - $this->compareResources( - $collectionFirstResource, - $resource, - $name, - $context - ); - - array_push($collection, $resource); + $collection[] = $resource; return $collection; } @@ -384,12 +368,6 @@ private function aggregateEmbeddedCollection(string $name, array $collection, st )); } - $this->compareResources( - $originalFirstResource, - $collectionFirstResource, - $name, - $context - ); return $original + $collection; } @@ -412,23 +390,14 @@ private function firstResource(array $resources): ?HalResource /** * @param null|object|HalResource[] $value */ - private function isResourceCollection($value, string $name, string $context): bool + private function isResourceCollection($value): bool { if (! is_array($value)) { return false; } - if ( - ! array_reduce($value, function ($isResource, $item) { - return $isResource && $item instanceof self; - }, true) - ) { - return false; - } - - $resource = $this->firstResource($value); - return array_reduce($value, function ($matchesCollection, $item) use ($name, $resource, $context) { - return $matchesCollection && $this->compareResources($resource, $item, $name, $context); + return array_reduce($value, static function ($isResource, $item) { + return $isResource && $item instanceof self; }, true); } @@ -508,23 +477,4 @@ function ($resource, string $name) use (&$embedded): void { return $embedded; } - - /** - * @throws InvalidArgumentException If $a and $b are not structurally equivalent. - */ - private function compareResources(self $a, self $b, string $name, string $context): bool - { - $structureA = array_keys($a->getElements()); - $structureB = array_keys($b->getElements()); - sort($structureA); - sort($structureB); - if ($structureA !== $structureB) { - throw new InvalidArgumentException(sprintf( - '%s detected structurally inequivalent resources for element %s', - $context, - $name - )); - } - return true; - } } diff --git a/test/HalResourceTest.php b/test/HalResourceTest.php index 95b1f41..de4c53f 100644 --- a/test/HalResourceTest.php +++ b/test/HalResourceTest.php @@ -329,40 +329,96 @@ public function testEmbedReturnsNewInstanceAppendingCollectionToExistingCollecti $this->assertEquals(['foo' => $collection1 + $collection2], $new->getElements()); } - public function testEmbedRaisesExceptionIfNewResourceDoesNotMatchStructureOfExisting(): void - { - $resource1 = new HalResource(['foo' => 'bar']); - $resource2 = new HalResource(['bar' => 'baz']); - - $resource = new HalResource(['foo' => $resource1]); - $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('structurally inequivalent'); - $resource->embed('foo', $resource2); + public function testCanEmbedResourceEvenIfNewResourceDoesNotMatchStructureOfExistingOne(): void + { + self::assertSame( + [ + '_embedded' => [ + 'foo' => [ + ['foo' => 'bar'], + ['bar' => 'baz'], + ], + ], + ], + (new HalResource(['foo' => new HalResource(['foo' => 'bar'])])) + ->embed('foo', new HalResource(['bar' => 'baz'])) + ->toArray() + ); } - public function testEmbedRaisesExceptionIfNewResourceDoesNotMatchCollectionResourceStructure(): void + public function testCanEmbedResourceEvenIfNewResourceDoesNotMatchCollectionResourceStructure(): void { - $resource1 = new HalResource(['foo' => 'bar']); - $resource2 = new HalResource(['foo' => 'baz']); - $resource3 = new HalResource(['bar' => 'bat']); - $collection = [$resource1, $resource2]; - - $resource = new HalResource(['foo' => $collection]); - $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('structurally inequivalent'); - $resource->embed('foo', $resource3); + self::assertSame( + [ + '_embedded' => [ + 'foo' => [ + ['foo' => 'bar'], + ['foo' => 'baz'], + ['bar' => 'bat'], + ], + ], + ], + (new HalResource([ + 'foo' => [ + new HalResource(['foo' => 'bar']), + new HalResource(['foo' => 'baz']), + ], + ])) + ->embed('foo', new HalResource(['bar' => 'bat'])) + ->toArray() + ); } - public function testEmbedRaisesExceptionIfResourcesInCollectionAreNotOfSameStructure(): void - { - $resource1 = new HalResource(['foo' => 'bar']); - $resource2 = new HalResource(['bar' => 'bat']); - $collection = [$resource1, $resource2]; - - $resource = new HalResource(); - $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('structurally inequivalent'); - $resource->embed('foo', $collection); + /** + * HAL resources of different types can be embedded within the same parent: this is normal, since + * it is very much normal for JSONSchema to contain union types representing different types. + * + * In this example, we designed a traditional ECommerce scenario, where different products may + * have different field structure. + * + * @see https://github.com/mezzio/mezzio-hal/issues/50 + */ + public function testAllowsEmbeddedResourcesWithDifferentObjectProperties(): void + { + $resource = new HalResource( + ['id' => 123], + [], + [ + 'some.resource' => [ + new HalResource([ + 'id' => 456, + 'name' => 'a very cool hat', + 'colour' => 'yellow', + ]), + new HalResource([ + 'id' => 678, + 'name' => 'industrial cleaner', + 'flavour' => 'lemongrass', // Intentional: array key is different between cleaners and clothing! + ]), + ], + ] + ); + + self::assertSame( + [ + 'id' => 123, + '_embedded' => [ + 'some.resource' => [ + [ + 'id' => 456, + 'name' => 'a very cool hat', + 'colour' => 'yellow', + ], + [ + 'id' => 678, + 'name' => 'industrial cleaner', + 'flavour' => 'lemongrass', + ], + ], + ], + ], + $resource->toArray() + ); } public function testWithElementsAddsNewDataToNewResourceInstance(): void diff --git a/test/InMemoryContainer.php b/test/InMemoryContainer.php index be24edc..3715e6d 100644 --- a/test/InMemoryContainer.php +++ b/test/InMemoryContainer.php @@ -15,11 +15,8 @@ final class InMemoryContainer implements ContainerInterface /** @var array */ private $services = []; - /** - * @param string $id - * @return mixed - */ - public function get($id) + /** {@inheritDoc} */ + public function get(string $id) { if (! $this->has($id)) { throw new class ($id . ' was not found') extends RuntimeException implements NotFoundExceptionInterface { @@ -29,11 +26,7 @@ public function get($id) return $this->services[$id]; } - /** - * @param string $id - * @return bool - */ - public function has($id) + public function has(string $id): bool { return array_key_exists($id, $this->services); }