Page MenuHomePhabricator

D501.id1609.diff
No OneTemporary

D501.id1609.diff

diff --git a/composer.json b/composer.json
--- a/composer.json
+++ b/composer.json
@@ -4,9 +4,15 @@
"require": {
"php": ">7",
- "psr/container": "^1.0"
+ "psr/container": "^1.0",
+ "phpstan/phpstan": "^0.12.64"
},
-
+ "scripts": {
+ "test" : [
+ "./vendor/bin/phpstan analyse --level 7 src/",
+ "./vendor/bin/phpunit tests/"
+ ]
+ },
"autoload" : {
"psr-4":{
"spitfire\\provider\\" : "./src"
diff --git a/composer.lock b/composer.lock
--- a/composer.lock
+++ b/composer.lock
@@ -4,8 +4,68 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "54486338c73cb34e3aea8718efe000dd",
+ "content-hash": "270c9fe7d6bee7aa57d0bb44cda1a428",
"packages": [
+ {
+ "name": "phpstan/phpstan",
+ "version": "0.12.64",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/phpstan/phpstan.git",
+ "reference": "23eb1cb7ae125f45f1d0e48051bcf67a9a9b08aa"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/phpstan/phpstan/zipball/23eb1cb7ae125f45f1d0e48051bcf67a9a9b08aa",
+ "reference": "23eb1cb7ae125f45f1d0e48051bcf67a9a9b08aa",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^7.1|^8.0"
+ },
+ "conflict": {
+ "phpstan/phpstan-shim": "*"
+ },
+ "bin": [
+ "phpstan",
+ "phpstan.phar"
+ ],
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "0.12-dev"
+ }
+ },
+ "autoload": {
+ "files": [
+ "bootstrap.php"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "description": "PHPStan - PHP Static Analysis Tool",
+ "support": {
+ "issues": "https://github.com/phpstan/phpstan/issues",
+ "source": "https://github.com/phpstan/phpstan/tree/0.12.64"
+ },
+ "funding": [
+ {
+ "url": "https://github.com/ondrejmirtes",
+ "type": "github"
+ },
+ {
+ "url": "https://www.patreon.com/phpstan",
+ "type": "patreon"
+ },
+ {
+ "url": "https://tidelift.com/funding/github/packagist/phpstan/phpstan",
+ "type": "tidelift"
+ }
+ ],
+ "time": "2020-12-21T11:59:02+00:00"
+ },
{
"name": "psr/container",
"version": "1.0.0",
@@ -53,42 +113,41 @@
"container-interop",
"psr"
],
+ "support": {
+ "issues": "https://github.com/php-fig/container/issues",
+ "source": "https://github.com/php-fig/container/tree/master"
+ },
"time": "2017-02-14T16:28:37+00:00"
}
],
"packages-dev": [
{
"name": "doctrine/instantiator",
- "version": "1.3.1",
+ "version": "1.4.0",
"source": {
"type": "git",
"url": "https://github.com/doctrine/instantiator.git",
- "reference": "f350df0268e904597e3bd9c4685c53e0e333feea"
+ "reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/doctrine/instantiator/zipball/f350df0268e904597e3bd9c4685c53e0e333feea",
- "reference": "f350df0268e904597e3bd9c4685c53e0e333feea",
+ "url": "https://api.github.com/repos/doctrine/instantiator/zipball/d56bf6102915de5702778fe20f2de3b2fe570b5b",
+ "reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b",
"shasum": ""
},
"require": {
"php": "^7.1 || ^8.0"
},
"require-dev": {
- "doctrine/coding-standard": "^6.0",
+ "doctrine/coding-standard": "^8.0",
"ext-pdo": "*",
"ext-phar": "*",
- "phpbench/phpbench": "^0.13",
- "phpstan/phpstan-phpunit": "^0.11",
- "phpstan/phpstan-shim": "^0.11",
- "phpunit/phpunit": "^7.0"
+ "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.2.x-dev"
- }
- },
"autoload": {
"psr-4": {
"Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/"
@@ -102,7 +161,7 @@
{
"name": "Marco Pivetta",
"email": "ocramius@gmail.com",
- "homepage": "http://ocramius.github.com/"
+ "homepage": "https://ocramius.github.io/"
}
],
"description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors",
@@ -111,6 +170,10 @@
"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",
@@ -125,20 +188,20 @@
"type": "tidelift"
}
],
- "time": "2020-05-29T17:27:14+00:00"
+ "time": "2020-11-10T18:47:58+00:00"
},
{
"name": "myclabs/deep-copy",
- "version": "1.10.1",
+ "version": "1.10.2",
"source": {
"type": "git",
"url": "https://github.com/myclabs/DeepCopy.git",
- "reference": "969b211f9a51aa1f6c01d1d2aef56d3bd91598e5"
+ "reference": "776f831124e9c62e1a2c601ecc52e776d8bb7220"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/969b211f9a51aa1f6c01d1d2aef56d3bd91598e5",
- "reference": "969b211f9a51aa1f6c01d1d2aef56d3bd91598e5",
+ "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/776f831124e9c62e1a2c601ecc52e776d8bb7220",
+ "reference": "776f831124e9c62e1a2c601ecc52e776d8bb7220",
"shasum": ""
},
"require": {
@@ -173,26 +236,30 @@
"object",
"object graph"
],
+ "support": {
+ "issues": "https://github.com/myclabs/DeepCopy/issues",
+ "source": "https://github.com/myclabs/DeepCopy/tree/1.10.2"
+ },
"funding": [
{
"url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy",
"type": "tidelift"
}
],
- "time": "2020-06-29T13:22:24+00:00"
+ "time": "2020-11-13T09:40:50+00:00"
},
{
"name": "nikic/php-parser",
- "version": "v4.9.0",
+ "version": "v4.10.4",
"source": {
"type": "git",
"url": "https://github.com/nikic/PHP-Parser.git",
- "reference": "aaee038b912e567780949787d5fe1977be11a778"
+ "reference": "c6d052fc58cb876152f89f532b95a8d7907e7f0e"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/aaee038b912e567780949787d5fe1977be11a778",
- "reference": "aaee038b912e567780949787d5fe1977be11a778",
+ "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/c6d052fc58cb876152f89f532b95a8d7907e7f0e",
+ "reference": "c6d052fc58cb876152f89f532b95a8d7907e7f0e",
"shasum": ""
},
"require": {
@@ -231,7 +298,11 @@
"parser",
"php"
],
- "time": "2020-08-18T19:48:01+00:00"
+ "support": {
+ "issues": "https://github.com/nikic/PHP-Parser/issues",
+ "source": "https://github.com/nikic/PHP-Parser/tree/v4.10.4"
+ },
+ "time": "2020-12-20T10:01:03+00:00"
},
{
"name": "phar-io/manifest",
@@ -287,20 +358,24 @@
}
],
"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/master"
+ },
"time": "2020-06-27T14:33:11+00:00"
},
{
"name": "phar-io/version",
- "version": "3.0.2",
+ "version": "3.0.4",
"source": {
"type": "git",
"url": "https://github.com/phar-io/version.git",
- "reference": "c6bb6825def89e0a32220f88337f8ceaf1975fa0"
+ "reference": "e4782611070e50613683d2b9a57730e9a3ba5451"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/phar-io/version/zipball/c6bb6825def89e0a32220f88337f8ceaf1975fa0",
- "reference": "c6bb6825def89e0a32220f88337f8ceaf1975fa0",
+ "url": "https://api.github.com/repos/phar-io/version/zipball/e4782611070e50613683d2b9a57730e9a3ba5451",
+ "reference": "e4782611070e50613683d2b9a57730e9a3ba5451",
"shasum": ""
},
"require": {
@@ -334,7 +409,11 @@
}
],
"description": "Library for handling version information and constraints",
- "time": "2020-06-27T14:39:04+00:00"
+ "support": {
+ "issues": "https://github.com/phar-io/version/issues",
+ "source": "https://github.com/phar-io/version/tree/3.0.4"
+ },
+ "time": "2020-12-13T23:18:30+00:00"
},
{
"name": "phpdocumentor/reflection-common",
@@ -383,20 +462,24 @@
"reflection",
"static analysis"
],
+ "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": "phpdocumentor/reflection-docblock",
- "version": "5.2.1",
+ "version": "5.2.2",
"source": {
"type": "git",
"url": "https://github.com/phpDocumentor/ReflectionDocBlock.git",
- "reference": "d870572532cd70bc3fab58f2e23ad423c8404c44"
+ "reference": "069a785b2141f5bcf49f3e353548dc1cce6df556"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/d870572532cd70bc3fab58f2e23ad423c8404c44",
- "reference": "d870572532cd70bc3fab58f2e23ad423c8404c44",
+ "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/069a785b2141f5bcf49f3e353548dc1cce6df556",
+ "reference": "069a785b2141f5bcf49f3e353548dc1cce6df556",
"shasum": ""
},
"require": {
@@ -435,20 +518,24 @@
}
],
"description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.",
- "time": "2020-08-15T11:14:08+00:00"
+ "support": {
+ "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues",
+ "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/master"
+ },
+ "time": "2020-09-03T19:13:55+00:00"
},
{
"name": "phpdocumentor/type-resolver",
- "version": "1.3.0",
+ "version": "1.4.0",
"source": {
"type": "git",
"url": "https://github.com/phpDocumentor/TypeResolver.git",
- "reference": "e878a14a65245fbe78f8080eba03b47c3b705651"
+ "reference": "6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/e878a14a65245fbe78f8080eba03b47c3b705651",
- "reference": "e878a14a65245fbe78f8080eba03b47c3b705651",
+ "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0",
+ "reference": "6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0",
"shasum": ""
},
"require": {
@@ -480,32 +567,36 @@
}
],
"description": "A PSR-5 based resolver of Class names, Types and Structural Element Names",
- "time": "2020-06-27T10:12:23+00:00"
+ "support": {
+ "issues": "https://github.com/phpDocumentor/TypeResolver/issues",
+ "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.4.0"
+ },
+ "time": "2020-09-17T18:55:26+00:00"
},
{
"name": "phpspec/prophecy",
- "version": "1.11.1",
+ "version": "1.12.2",
"source": {
"type": "git",
"url": "https://github.com/phpspec/prophecy.git",
- "reference": "b20034be5efcdab4fb60ca3a29cba2949aead160"
+ "reference": "245710e971a030f42e08f4912863805570f23d39"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/phpspec/prophecy/zipball/b20034be5efcdab4fb60ca3a29cba2949aead160",
- "reference": "b20034be5efcdab4fb60ca3a29cba2949aead160",
+ "url": "https://api.github.com/repos/phpspec/prophecy/zipball/245710e971a030f42e08f4912863805570f23d39",
+ "reference": "245710e971a030f42e08f4912863805570f23d39",
"shasum": ""
},
"require": {
"doctrine/instantiator": "^1.2",
- "php": "^7.2",
- "phpdocumentor/reflection-docblock": "^5.0",
+ "php": "^7.2 || ~8.0, <8.1",
+ "phpdocumentor/reflection-docblock": "^5.2",
"sebastian/comparator": "^3.0 || ^4.0",
"sebastian/recursion-context": "^3.0 || ^4.0"
},
"require-dev": {
"phpspec/phpspec": "^6.0",
- "phpunit/phpunit": "^8.0"
+ "phpunit/phpunit": "^8.0 || ^9.0"
},
"type": "library",
"extra": {
@@ -543,34 +634,38 @@
"spy",
"stub"
],
- "time": "2020-07-08T12:44:21+00:00"
+ "support": {
+ "issues": "https://github.com/phpspec/prophecy/issues",
+ "source": "https://github.com/phpspec/prophecy/tree/1.12.2"
+ },
+ "time": "2020-12-19T10:15:11+00:00"
},
{
"name": "phpunit/php-code-coverage",
- "version": "9.1.4",
+ "version": "9.2.5",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-code-coverage.git",
- "reference": "4422fca28c3634e2de8c7c373af97a104dd1a45f"
+ "reference": "f3e026641cc91909d421802dd3ac7827ebfd97e1"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/4422fca28c3634e2de8c7c373af97a104dd1a45f",
- "reference": "4422fca28c3634e2de8c7c373af97a104dd1a45f",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/f3e026641cc91909d421802dd3ac7827ebfd97e1",
+ "reference": "f3e026641cc91909d421802dd3ac7827ebfd97e1",
"shasum": ""
},
"require": {
"ext-dom": "*",
"ext-libxml": "*",
"ext-xmlwriter": "*",
- "nikic/php-parser": "^4.8",
- "php": "^7.3 || ^8.0",
+ "nikic/php-parser": "^4.10.2",
+ "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",
+ "sebastian/lines-of-code": "^1.0.3",
"sebastian/version": "^3.0.1",
"theseer/tokenizer": "^1.2.0"
},
@@ -584,7 +679,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "9.1-dev"
+ "dev-master": "9.2-dev"
}
},
"autoload": {
@@ -610,33 +705,37 @@
"testing",
"xunit"
],
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues",
+ "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.5"
+ },
"funding": [
{
"url": "https://github.com/sebastianbergmann",
"type": "github"
}
],
- "time": "2020-08-13T15:04:53+00:00"
+ "time": "2020-11-28T06:44:49+00:00"
},
{
"name": "phpunit/php-file-iterator",
- "version": "3.0.4",
+ "version": "3.0.5",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-file-iterator.git",
- "reference": "25fefc5b19835ca653877fe081644a3f8c1d915e"
+ "reference": "aa4be8575f26070b100fccb67faabb28f21f66f8"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/25fefc5b19835ca653877fe081644a3f8c1d915e",
- "reference": "25fefc5b19835ca653877fe081644a3f8c1d915e",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/aa4be8575f26070b100fccb67faabb28f21f66f8",
+ "reference": "aa4be8575f26070b100fccb67faabb28f21f66f8",
"shasum": ""
},
"require": {
- "php": "^7.3 || ^8.0"
+ "php": ">=7.3"
},
"require-dev": {
- "phpunit/phpunit": "^9.0"
+ "phpunit/phpunit": "^9.3"
},
"type": "library",
"extra": {
@@ -666,34 +765,38 @@
"filesystem",
"iterator"
],
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues",
+ "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.5"
+ },
"funding": [
{
"url": "https://github.com/sebastianbergmann",
"type": "github"
}
],
- "time": "2020-07-11T05:18:21+00:00"
+ "time": "2020-09-28T05:57:25+00:00"
},
{
"name": "phpunit/php-invoker",
- "version": "3.1.0",
+ "version": "3.1.1",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-invoker.git",
- "reference": "7a85b66acc48cacffdf87dadd3694e7123674298"
+ "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/7a85b66acc48cacffdf87dadd3694e7123674298",
- "reference": "7a85b66acc48cacffdf87dadd3694e7123674298",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/5a10147d0aaf65b58940a0b72f71c9ac0423cc67",
+ "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67",
"shasum": ""
},
"require": {
- "php": "^7.3 || ^8.0"
+ "php": ">=7.3"
},
"require-dev": {
"ext-pcntl": "*",
- "phpunit/phpunit": "^9.0"
+ "phpunit/phpunit": "^9.3"
},
"suggest": {
"ext-pcntl": "*"
@@ -725,33 +828,37 @@
"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-08-06T07:04:15+00:00"
+ "time": "2020-09-28T05:58:55+00:00"
},
{
"name": "phpunit/php-text-template",
- "version": "2.0.2",
+ "version": "2.0.4",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-text-template.git",
- "reference": "6ff9c8ea4d3212b88fcf74e25e516e2c51c99324"
+ "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/6ff9c8ea4d3212b88fcf74e25e516e2c51c99324",
- "reference": "6ff9c8ea4d3212b88fcf74e25e516e2c51c99324",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28",
+ "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28",
"shasum": ""
},
"require": {
- "php": "^7.3 || ^8.0"
+ "php": ">=7.3"
},
"require-dev": {
- "phpunit/phpunit": "^9.0"
+ "phpunit/phpunit": "^9.3"
},
"type": "library",
"extra": {
@@ -780,33 +887,37 @@
"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-06-26T11:55:37+00:00"
+ "time": "2020-10-26T05:33:50+00:00"
},
{
"name": "phpunit/php-timer",
- "version": "5.0.1",
+ "version": "5.0.3",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-timer.git",
- "reference": "cc49734779cbb302bf51a44297dab8c4bbf941e7"
+ "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/cc49734779cbb302bf51a44297dab8c4bbf941e7",
- "reference": "cc49734779cbb302bf51a44297dab8c4bbf941e7",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2",
+ "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2",
"shasum": ""
},
"require": {
- "php": "^7.3 || ^8.0"
+ "php": ">=7.3"
},
"require-dev": {
- "phpunit/phpunit": "^9.2"
+ "phpunit/phpunit": "^9.3"
},
"type": "library",
"extra": {
@@ -835,26 +946,30 @@
"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-06-26T11:58:13+00:00"
+ "time": "2020-10-26T13:16:10+00:00"
},
{
"name": "phpunit/phpunit",
- "version": "9.3.7",
+ "version": "9.5.0",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git",
- "reference": "c638a0cac77347980352485912de48c99b42ad00"
+ "reference": "8e16c225d57c3d6808014df6b1dd7598d0a5bbbe"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/c638a0cac77347980352485912de48c99b42ad00",
- "reference": "c638a0cac77347980352485912de48c99b42ad00",
+ "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/8e16c225d57c3d6808014df6b1dd7598d0a5bbbe",
+ "reference": "8e16c225d57c3d6808014df6b1dd7598d0a5bbbe",
"shasum": ""
},
"require": {
@@ -868,23 +983,24 @@
"myclabs/deep-copy": "^1.10.1",
"phar-io/manifest": "^2.0.1",
"phar-io/version": "^3.0.2",
- "php": "^7.3 || ^8.0",
- "phpspec/prophecy": "^1.11.1",
- "phpunit/php-code-coverage": "^9.1.1",
- "phpunit/php-file-iterator": "^3.0.4",
- "phpunit/php-invoker": "^3.1",
- "phpunit/php-text-template": "^2.0.2",
- "phpunit/php-timer": "^5.0.1",
- "sebastian/code-unit": "^1.0.5",
- "sebastian/comparator": "^4.0.3",
- "sebastian/diff": "^4.0.2",
- "sebastian/environment": "^5.1.2",
- "sebastian/exporter": "^4.0.2",
- "sebastian/global-state": "^5.0",
- "sebastian/object-enumerator": "^4.0.2",
- "sebastian/resource-operations": "^3.0.2",
- "sebastian/type": "^2.2.1",
- "sebastian/version": "^3.0.1"
+ "php": ">=7.3",
+ "phpspec/prophecy": "^1.12.1",
+ "phpunit/php-code-coverage": "^9.2.3",
+ "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",
+ "sebastian/version": "^3.0.2"
},
"require-dev": {
"ext-pdo": "*",
@@ -900,7 +1016,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "9.3-dev"
+ "dev-master": "9.5-dev"
}
},
"autoload": {
@@ -929,6 +1045,10 @@
"testing",
"xunit"
],
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/phpunit/issues",
+ "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.0"
+ },
"funding": [
{
"url": "https://phpunit.de/donate.html",
@@ -939,27 +1059,83 @@
"type": "github"
}
],
- "time": "2020-08-11T15:36:12+00:00"
+ "time": "2020-12-04T05:05:53+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.5",
+ "version": "1.0.8",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/code-unit.git",
- "reference": "c1e2df332c905079980b119c4db103117e5e5c90"
+ "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/c1e2df332c905079980b119c4db103117e5e5c90",
- "reference": "c1e2df332c905079980b119c4db103117e5e5c90",
+ "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/1fc9f64c0927627ef78ba436c9b17d967e68e120",
+ "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120",
"shasum": ""
},
"require": {
- "php": "^7.3 || ^8.0"
+ "php": ">=7.3"
},
"require-dev": {
- "phpunit/phpunit": "^9.0"
+ "phpunit/phpunit": "^9.3"
},
"type": "library",
"extra": {
@@ -985,33 +1161,37 @@
],
"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-06-26T12:50:45+00:00"
+ "time": "2020-10-26T13:08:54+00:00"
},
{
"name": "sebastian/code-unit-reverse-lookup",
- "version": "2.0.2",
+ "version": "2.0.3",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git",
- "reference": "ee51f9bb0c6d8a43337055db3120829fa14da819"
+ "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/ee51f9bb0c6d8a43337055db3120829fa14da819",
- "reference": "ee51f9bb0c6d8a43337055db3120829fa14da819",
+ "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5",
+ "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5",
"shasum": ""
},
"require": {
- "php": "^7.3 || ^8.0"
+ "php": ">=7.3"
},
"require-dev": {
- "phpunit/phpunit": "^9.0"
+ "phpunit/phpunit": "^9.3"
},
"type": "library",
"extra": {
@@ -1036,35 +1216,39 @@
],
"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-06-26T12:04:00+00:00"
+ "time": "2020-09-28T05:30:19+00:00"
},
{
"name": "sebastian/comparator",
- "version": "4.0.3",
+ "version": "4.0.6",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/comparator.git",
- "reference": "dcc580eadfaa4e7f9d2cf9ae1922134ea962e14f"
+ "reference": "55f4261989e546dc112258c7a75935a81a7ce382"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/dcc580eadfaa4e7f9d2cf9ae1922134ea962e14f",
- "reference": "dcc580eadfaa4e7f9d2cf9ae1922134ea962e14f",
+ "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/55f4261989e546dc112258c7a75935a81a7ce382",
+ "reference": "55f4261989e546dc112258c7a75935a81a7ce382",
"shasum": ""
},
"require": {
- "php": "^7.3 || ^8.0",
+ "php": ">=7.3",
"sebastian/diff": "^4.0",
"sebastian/exporter": "^4.0"
},
"require-dev": {
- "phpunit/phpunit": "^9.0"
+ "phpunit/phpunit": "^9.3"
},
"type": "library",
"extra": {
@@ -1106,34 +1290,38 @@
"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-06-26T12:05:46+00:00"
+ "time": "2020-10-26T15:49:45+00:00"
},
{
"name": "sebastian/complexity",
- "version": "2.0.0",
+ "version": "2.0.2",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/complexity.git",
- "reference": "33fcd6a26656c6546f70871244ecba4b4dced097"
+ "reference": "739b35e53379900cc9ac327b2147867b8b6efd88"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/33fcd6a26656c6546f70871244ecba4b4dced097",
- "reference": "33fcd6a26656c6546f70871244ecba4b4dced097",
+ "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/739b35e53379900cc9ac327b2147867b8b6efd88",
+ "reference": "739b35e53379900cc9ac327b2147867b8b6efd88",
"shasum": ""
},
"require": {
"nikic/php-parser": "^4.7",
- "php": "^7.3 || ^8.0"
+ "php": ">=7.3"
},
"require-dev": {
- "phpunit/phpunit": "^9.2"
+ "phpunit/phpunit": "^9.3"
},
"type": "library",
"extra": {
@@ -1159,33 +1347,37 @@
],
"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-07-25T14:01:34+00:00"
+ "time": "2020-10-26T15:52:27+00:00"
},
{
"name": "sebastian/diff",
- "version": "4.0.2",
+ "version": "4.0.4",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/diff.git",
- "reference": "1e90b4cf905a7d06c420b1d2e9d11a4dc8a13113"
+ "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/1e90b4cf905a7d06c420b1d2e9d11a4dc8a13113",
- "reference": "1e90b4cf905a7d06c420b1d2e9d11a4dc8a13113",
+ "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/3461e3fccc7cfdfc2720be910d3bd73c69be590d",
+ "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d",
"shasum": ""
},
"require": {
- "php": "^7.3 || ^8.0"
+ "php": ">=7.3"
},
"require-dev": {
- "phpunit/phpunit": "^9.0",
+ "phpunit/phpunit": "^9.3",
"symfony/process": "^4.2 || ^5"
},
"type": "library",
@@ -1221,33 +1413,37 @@
"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-06-30T04:46:02+00:00"
+ "time": "2020-10-26T13:10:38+00:00"
},
{
"name": "sebastian/environment",
- "version": "5.1.2",
+ "version": "5.1.3",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/environment.git",
- "reference": "0a757cab9d5b7ef49a619f1143e6c9c1bc0fe9d2"
+ "reference": "388b6ced16caa751030f6a69e588299fa09200ac"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/0a757cab9d5b7ef49a619f1143e6c9c1bc0fe9d2",
- "reference": "0a757cab9d5b7ef49a619f1143e6c9c1bc0fe9d2",
+ "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/388b6ced16caa751030f6a69e588299fa09200ac",
+ "reference": "388b6ced16caa751030f6a69e588299fa09200ac",
"shasum": ""
},
"require": {
- "php": "^7.3 || ^8.0"
+ "php": ">=7.3"
},
"require-dev": {
- "phpunit/phpunit": "^9.0"
+ "phpunit/phpunit": "^9.3"
},
"suggest": {
"ext-posix": "*"
@@ -1255,7 +1451,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "5.0-dev"
+ "dev-master": "5.1-dev"
}
},
"autoload": {
@@ -1280,35 +1476,39 @@
"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-06-26T12:07:24+00:00"
+ "time": "2020-09-28T05:52:38+00:00"
},
{
"name": "sebastian/exporter",
- "version": "4.0.2",
+ "version": "4.0.3",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/exporter.git",
- "reference": "571d721db4aec847a0e59690b954af33ebf9f023"
+ "reference": "d89cc98761b8cb5a1a235a6b703ae50d34080e65"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/571d721db4aec847a0e59690b954af33ebf9f023",
- "reference": "571d721db4aec847a0e59690b954af33ebf9f023",
+ "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/d89cc98761b8cb5a1a235a6b703ae50d34080e65",
+ "reference": "d89cc98761b8cb5a1a235a6b703ae50d34080e65",
"shasum": ""
},
"require": {
- "php": "^7.3 || ^8.0",
+ "php": ">=7.3",
"sebastian/recursion-context": "^4.0"
},
"require-dev": {
"ext-mbstring": "*",
- "phpunit/phpunit": "^9.2"
+ "phpunit/phpunit": "^9.3"
},
"type": "library",
"extra": {
@@ -1353,30 +1553,34 @@
"export",
"exporter"
],
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/exporter/issues",
+ "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.3"
+ },
"funding": [
{
"url": "https://github.com/sebastianbergmann",
"type": "github"
}
],
- "time": "2020-06-26T12:08:55+00:00"
+ "time": "2020-09-28T05:24:23+00:00"
},
{
"name": "sebastian/global-state",
- "version": "5.0.0",
+ "version": "5.0.2",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/global-state.git",
- "reference": "22ae663c951bdc39da96603edc3239ed3a299097"
+ "reference": "a90ccbddffa067b51f574dea6eb25d5680839455"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/22ae663c951bdc39da96603edc3239ed3a299097",
- "reference": "22ae663c951bdc39da96603edc3239ed3a299097",
+ "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/a90ccbddffa067b51f574dea6eb25d5680839455",
+ "reference": "a90ccbddffa067b51f574dea6eb25d5680839455",
"shasum": ""
},
"require": {
- "php": "^7.3 || ^8.0",
+ "php": ">=7.3",
"sebastian/object-reflector": "^2.0",
"sebastian/recursion-context": "^4.0"
},
@@ -1413,34 +1617,38 @@
"keywords": [
"global state"
],
+ "support": {
+ "issues": "https://github.com/sebastianbergmann/global-state/issues",
+ "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.2"
+ },
"funding": [
{
"url": "https://github.com/sebastianbergmann",
"type": "github"
}
],
- "time": "2020-08-07T04:09:03+00:00"
+ "time": "2020-10-26T15:55:19+00:00"
},
{
"name": "sebastian/lines-of-code",
- "version": "1.0.0",
+ "version": "1.0.3",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/lines-of-code.git",
- "reference": "e02bf626f404b5daec382a7b8a6a4456e49017e5"
+ "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/e02bf626f404b5daec382a7b8a6a4456e49017e5",
- "reference": "e02bf626f404b5daec382a7b8a6a4456e49017e5",
+ "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/c1c2e997aa3146983ed888ad08b15470a2e22ecc",
+ "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc",
"shasum": ""
},
"require": {
"nikic/php-parser": "^4.6",
- "php": "^7.3 || ^8.0"
+ "php": ">=7.3"
},
"require-dev": {
- "phpunit/phpunit": "^9.2"
+ "phpunit/phpunit": "^9.3"
},
"type": "library",
"extra": {
@@ -1466,35 +1674,39 @@
],
"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-07-22T18:33:42+00:00"
+ "time": "2020-11-28T06:42:11+00:00"
},
{
"name": "sebastian/object-enumerator",
- "version": "4.0.2",
+ "version": "4.0.4",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/object-enumerator.git",
- "reference": "074fed2d0a6d08e1677dd8ce9d32aecb384917b8"
+ "reference": "5c9eeac41b290a3712d88851518825ad78f45c71"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/074fed2d0a6d08e1677dd8ce9d32aecb384917b8",
- "reference": "074fed2d0a6d08e1677dd8ce9d32aecb384917b8",
+ "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/5c9eeac41b290a3712d88851518825ad78f45c71",
+ "reference": "5c9eeac41b290a3712d88851518825ad78f45c71",
"shasum": ""
},
"require": {
- "php": "^7.3 || ^8.0",
+ "php": ">=7.3",
"sebastian/object-reflector": "^2.0",
"sebastian/recursion-context": "^4.0"
},
"require-dev": {
- "phpunit/phpunit": "^9.0"
+ "phpunit/phpunit": "^9.3"
},
"type": "library",
"extra": {
@@ -1519,33 +1731,37 @@
],
"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-06-26T12:11:32+00:00"
+ "time": "2020-10-26T13:12:34+00:00"
},
{
"name": "sebastian/object-reflector",
- "version": "2.0.2",
+ "version": "2.0.4",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/object-reflector.git",
- "reference": "127a46f6b057441b201253526f81d5406d6c7840"
+ "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/127a46f6b057441b201253526f81d5406d6c7840",
- "reference": "127a46f6b057441b201253526f81d5406d6c7840",
+ "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/b4f479ebdbf63ac605d183ece17d8d7fe49c15c7",
+ "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7",
"shasum": ""
},
"require": {
- "php": "^7.3 || ^8.0"
+ "php": ">=7.3"
},
"require-dev": {
- "phpunit/phpunit": "^9.0"
+ "phpunit/phpunit": "^9.3"
},
"type": "library",
"extra": {
@@ -1570,33 +1786,37 @@
],
"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-06-26T12:12:55+00:00"
+ "time": "2020-10-26T13:14:26+00:00"
},
{
"name": "sebastian/recursion-context",
- "version": "4.0.2",
+ "version": "4.0.4",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/recursion-context.git",
- "reference": "062231bf61d2b9448c4fa5a7643b5e1829c11d63"
+ "reference": "cd9d8cf3c5804de4341c283ed787f099f5506172"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/062231bf61d2b9448c4fa5a7643b5e1829c11d63",
- "reference": "062231bf61d2b9448c4fa5a7643b5e1829c11d63",
+ "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/cd9d8cf3c5804de4341c283ed787f099f5506172",
+ "reference": "cd9d8cf3c5804de4341c283ed787f099f5506172",
"shasum": ""
},
"require": {
- "php": "^7.3 || ^8.0"
+ "php": ">=7.3"
},
"require-dev": {
- "phpunit/phpunit": "^9.0"
+ "phpunit/phpunit": "^9.3"
},
"type": "library",
"extra": {
@@ -1629,30 +1849,34 @@
],
"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-06-26T12:14:17+00:00"
+ "time": "2020-10-26T13:17:30+00:00"
},
{
"name": "sebastian/resource-operations",
- "version": "3.0.2",
+ "version": "3.0.3",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/resource-operations.git",
- "reference": "0653718a5a629b065e91f774595267f8dc32e213"
+ "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/0653718a5a629b065e91f774595267f8dc32e213",
- "reference": "0653718a5a629b065e91f774595267f8dc32e213",
+ "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8",
+ "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8",
"shasum": ""
},
"require": {
- "php": "^7.3 || ^8.0"
+ "php": ">=7.3"
},
"require-dev": {
"phpunit/phpunit": "^9.0"
@@ -1680,38 +1904,42 @@
],
"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-06-26T12:16:22+00:00"
+ "time": "2020-09-28T06:45:17+00:00"
},
{
"name": "sebastian/type",
- "version": "2.2.1",
+ "version": "2.3.1",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/type.git",
- "reference": "86991e2b33446cd96e648c18bcdb1e95afb2c05a"
+ "reference": "81cd61ab7bbf2de744aba0ea61fae32f721df3d2"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/86991e2b33446cd96e648c18bcdb1e95afb2c05a",
- "reference": "86991e2b33446cd96e648c18bcdb1e95afb2c05a",
+ "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/81cd61ab7bbf2de744aba0ea61fae32f721df3d2",
+ "reference": "81cd61ab7bbf2de744aba0ea61fae32f721df3d2",
"shasum": ""
},
"require": {
- "php": "^7.3 || ^8.0"
+ "php": ">=7.3"
},
"require-dev": {
- "phpunit/phpunit": "^9.2"
+ "phpunit/phpunit": "^9.3"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "2.2-dev"
+ "dev-master": "2.3-dev"
}
},
"autoload": {
@@ -1732,30 +1960,34 @@
],
"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.1"
+ },
"funding": [
{
"url": "https://github.com/sebastianbergmann",
"type": "github"
}
],
- "time": "2020-07-05T08:31:53+00:00"
+ "time": "2020-10-26T13:18:59+00:00"
},
{
"name": "sebastian/version",
- "version": "3.0.1",
+ "version": "3.0.2",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/version.git",
- "reference": "626586115d0ed31cb71483be55beb759b5af5a3c"
+ "reference": "c6c1022351a901512170118436c764e473f6de8c"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/626586115d0ed31cb71483be55beb759b5af5a3c",
- "reference": "626586115d0ed31cb71483be55beb759b5af5a3c",
+ "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c6c1022351a901512170118436c764e473f6de8c",
+ "reference": "c6c1022351a901512170118436c764e473f6de8c",
"shasum": ""
},
"require": {
- "php": "^7.3 || ^8.0"
+ "php": ">=7.3"
},
"type": "library",
"extra": {
@@ -1781,30 +2013,34 @@
],
"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-06-26T12:18:43+00:00"
+ "time": "2020-09-28T06:39:44+00:00"
},
{
"name": "symfony/polyfill-ctype",
- "version": "v1.18.1",
+ "version": "v1.20.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-ctype.git",
- "reference": "1c302646f6efc070cd46856e600e5e0684d6b454"
+ "reference": "f4ba089a5b6366e453971d3aad5fe8e897b37f41"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/1c302646f6efc070cd46856e600e5e0684d6b454",
- "reference": "1c302646f6efc070cd46856e600e5e0684d6b454",
+ "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/f4ba089a5b6366e453971d3aad5fe8e897b37f41",
+ "reference": "f4ba089a5b6366e453971d3aad5fe8e897b37f41",
"shasum": ""
},
"require": {
- "php": ">=5.3.3"
+ "php": ">=7.1"
},
"suggest": {
"ext-ctype": "For best performance"
@@ -1812,7 +2048,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "1.18-dev"
+ "dev-main": "1.20-dev"
},
"thanks": {
"name": "symfony/polyfill",
@@ -1849,6 +2085,9 @@
"polyfill",
"portable"
],
+ "support": {
+ "source": "https://github.com/symfony/polyfill-ctype/tree/v1.20.0"
+ },
"funding": [
{
"url": "https://symfony.com/sponsor",
@@ -1863,7 +2102,7 @@
"type": "tidelift"
}
],
- "time": "2020-07-14T12:35:20+00:00"
+ "time": "2020-10-23T14:02:19+00:00"
},
{
"name": "theseer/tokenizer",
@@ -1903,6 +2142,10 @@
}
],
"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/master"
+ },
"funding": [
{
"url": "https://github.com/theseer",
@@ -1958,6 +2201,10 @@
"check",
"validate"
],
+ "support": {
+ "issues": "https://github.com/webmozart/assert/issues",
+ "source": "https://github.com/webmozart/assert/tree/master"
+ },
"time": "2020-07-08T17:02:28+00:00"
}
],
@@ -1970,5 +2217,5 @@
"php": ">7"
},
"platform-dev": [],
- "plugin-api-version": "1.1.0"
+ "plugin-api-version": "2.0.0"
}
diff --git a/src/BindingInterface.php b/src/BindingInterface.php
new file mode 100644
--- /dev/null
+++ b/src/BindingInterface.php
@@ -0,0 +1,11 @@
+<?php namespace spitfire\provider;
+
+interface BindingInterface
+{
+
+ /**
+ *
+ * @return object
+ */
+ public function instance() : object;
+}
\ No newline at end of file
diff --git a/src/Provider.php b/src/Container.php
rename from src/Provider.php
rename to src/Container.php
--- a/src/Provider.php
+++ b/src/Container.php
@@ -5,7 +5,13 @@
use ReflectionClass;
use ReflectionException;
use ReflectionFunction;
+use ReflectionNamedType;
use ReflectionParameter;
+use spitfire\provider\bindings\Factory;
+use spitfire\provider\bindings\Partial;
+use spitfire\provider\bindings\Reference;
+use spitfire\provider\bindings\Service;
+use spitfire\provider\bindings\Singleton;
/**
* Provider is a dependency injection mechanism. It allows your
@@ -15,9 +21,13 @@
*
* @author César de la Cal Bretschneider
*/
-class Provider implements \Psr\Container\ContainerInterface
+class Container implements \Psr\Container\ContainerInterface
{
+ /**
+ *
+ * @var BindingInterface[]
+ */
private $items = [];
/**
@@ -29,14 +39,14 @@
* Please note that you MUST NOT provide user input to this method, this
* is very dangerous.
*
- * @throws \Psr\Container\NotFoundExceptionInterface
- * @throws \Psr\Container\ContainerExceptionInterface
+ * @param string $id
+ * @throws NotFoundException
*/
public function get($id) {
/**
* Check if there is a service registered for this
*/
- if (isset($this->items[$id])) {
+ if (isset($this->items[$id]) && $this->items[$id] instanceof BindingInterface) {
return $this->items[$id]->instance();
}
@@ -45,14 +55,21 @@
* to locate the service with an autowiring automatism.
*/
try {
+ if (!class_exists($id)) {
+ throw new NotFoundException('Attempting to autowire something that is not a class');
+ }
#Autowiring logic
$method = (new ReflectionClass($id))->getMethod('__construct');
$required = $method->getParameters();
-
-
+
+
$parameters = array_map(function (ReflectionParameter$e) {
- try { return $this->get($e->getClass()->getName()); }
+ #Get the named type to build. It is impossible for us to build anonymous types
+ $type = $e->getType();
+ if (!($type instanceof ReflectionNamedType)) { throw new NotFoundException('Unnamed types cannot be resolved by provider'); }
+
+ try { return $this->get($type->getName()); }
catch (ReflectionException $e) { throw new NotFoundException($e->getMessage()); }
}, $required);
@@ -60,8 +77,8 @@
catch (ReflectionException $e) {
$parameters = [];
}
- catch (NotFoundExceptionInterface $e) {
- throw new NotFoundException(sprintf("Service %s has missing dependencies", $id), 2008210958, $e);
+ catch (NotFoundException $ex) {
+ throw new NotFoundException(sprintf("Service %s has missing dependencies", $id), 2008210958, $ex);
}
/**
@@ -80,22 +97,75 @@
*
* @param string $id The key / classname the service should be located at
* @param mixed $item The service. May be an instance of a class, a string containing a classname, or a service
+ * @return Container
*/
- public function set($id, $item) {
+ public function set($id, $item)
+ {
- if (is_string($item) || is_object($item)) {
- $item = new Service($this, $item, []);
- }
+ if (is_string($item) && class_exists($item)) {
+ $item = new Partial($this, $item, []);
+ }
+
+ if (is_object($item)) {
+ $item = new Singleton($this, function () use ($item) { return $item; });
+ }
$this->items[$id] = $item;
return $this;
- }
+ }
+
+
+ /**
+ *
+ * @param string $id
+ * @return Partial
+ */
+ public function service(string $id) : Partial
+ {
+ if (!isset($this->items[$id]) && class_exists($id)) {
+ $item = new Partial($this, $id, []);
+ $this->items[$id] = $item;
+ }
+
+ if ($this->items[$id] instanceof Partial) {
+ return $this->items[$id];
+ }
+
+ throw new NotFoundException('Invalid partial');
+
+ }
+
+ /**
+ *
+ * @param string $id
+ * @param Closure $callable
+ * @return Container
+ */
+ public function factory($id, Closure $callable)
+ {
+ $this->items[$id] = new Factory($this, $callable);
+ return $this;
+ }
+
+
+ /**
+ *
+ * @param string $id
+ * @param Closure $callable
+ * @return Container
+ */
+ public function singleton($id, Closure $callable)
+ {
+ $this->items[$id] = new Singleton($this, $callable);
+ return $this;
+ }
/**
* Checks if the provider can find a service that it can assemble. This does
* not imply that a call to get will be smooth, get may still run into a
* \Psr\Container\ContainerExceptionInterface
*
+ * @param string $id
* @return bool
*/
public function has($id)
@@ -117,11 +187,13 @@
* Uses the container as a factory, you provide arguments that may not be
* automatically resolved or you wish to override.
*
- * @param string $id
+ * @param class-string $id
* @param mixed[] $parameters
+ * @return object
*/
- public function make($id, $parameters) {
- $service = new Service($this, $id, $parameters);
+ public function assemble($id, $parameters = [])
+ {
+ $service = new Partial($this, $id, $parameters);
return $service->instance();
}
@@ -130,29 +202,24 @@
* set of requirements, similar to how Javascript DI works, and our container
* will provide the right arguments for the task.
*
- * @param Callable $fn
+ * @param Closure $fn
* @return mixed The result of the function
*/
- public function call($fn) {
+ public function call(Closure $fn)
+ {
$reflection = new ReflectionFunction($fn);
$parameters = array_map(function (ReflectionParameter $e) {
- return $this->get($e->getClass()->getName());
+
+ #Get the named type to build. It is impossible for us to build anonymous types
+ $type = $e->getType();
+ if (!($type instanceof ReflectionNamedType)) { throw new NotFoundException('Unnamed types cannot be resolved by provider'); }
+
+ return $this->get($type->getName());
}, $reflection->getParameters());
return $fn(...$parameters);
}
- /**
- * Creates a reference to a service inside this container.
- *
- * @param string $id The identifier for the service
- * @param mixed $parameters The identifier for the service
- * @return Service
- */
- public function service($id, $parameters) {
- return new Service($this, $id, $parameters);
- }
-
/**
* Creates a reference to a service inside this container.
*
diff --git a/src/Service.php b/src/Service.php
deleted file mode 100644
--- a/src/Service.php
+++ /dev/null
@@ -1,83 +0,0 @@
-<?php namespace spitfire\provider;
-
-use Closure;
-use ReflectionClass;
-use ReflectionException;
-use ReflectionParameter;
-
-/**
- * A service is a reference to a class and a series of parameters that can be
- * instanced with Provider.
- *
- * @author César de la Cal Bretschneider
- */
-class Service
-{
-
- private $provider;
-
- /**
- * The name of the class to be instanced
- *
- * @var string
- */
- private $classname;
-
- /**
- * The parameters passed to the class' constructor.
- *
- * @var mixed
- */
- private $parameters;
-
- /**
- * Create a service. This allows the application to resolve the
- * parameters for the given service.
- */
- public function __construct(Provider$provider, $classname, $parameters)
- {
- $this->provider = $provider;
- $this->classname = $classname;
- $this->parameters = $parameters;
- }
-
- /**
- * Creates a new instance of the service.
- */
- public function instance() {
-
- try {
- # Autowiring logic for the arguments
- $reflection = new ReflectionClass($this->classname);
- $method = $reflection->getMethod('__construct');
- $required = $method->getParameters();
-
- $parameters = array_map(function (ReflectionParameter$e) {
- $name = $e->getName();
- $param = $this->parameters[$name]?? null;
-
- if ($param instanceof Reference) { return $param->resolve(); }
- if ($param instanceof Closure) { return $param(); }
- if (is_object($param)) { return $param; }
-
- try {
- return $this->provider->get($e->getClass()->getName());
- }
- catch (ReflectionException $e) {
- throw new NotFoundException($e->getMessage());
- }
- }, $required);
-
- return $reflection->newInstance(...$parameters);
- }
- /**
- * If the class does not have a constructor the reflection of __construct
- * will fail. This is a trivial issue, since we do accept classes without
- * an explicit constructor we can resolve this issue by instancing the class
- * without parameters.
- */
- catch (ReflectionException $e) {
- return new $this->classname;
- }
- }
-}
diff --git a/src/bindings/Factory.php b/src/bindings/Factory.php
new file mode 100644
--- /dev/null
+++ b/src/bindings/Factory.php
@@ -0,0 +1,33 @@
+<?php namespace spitfire\provider\bindings;
+
+use Closure;
+use spitfire\provider\BindingInterface;
+use spitfire\provider\Container;
+
+class Factory implements BindingInterface
+{
+
+ /**
+ *
+ * @var Closure
+ */
+ private $factory;
+
+ /**
+ *
+ * @var Container
+ */
+ private $container;
+
+ public function __construct(Container $container, Closure $factory)
+ {
+ $this->container = $container;
+ $this->factory = $factory;
+ }
+
+ public function instance() : object
+ {
+ return $this->container->call($this->factory);
+ }
+
+}
\ No newline at end of file
diff --git a/src/bindings/Partial.php b/src/bindings/Partial.php
new file mode 100644
--- /dev/null
+++ b/src/bindings/Partial.php
@@ -0,0 +1,137 @@
+<?php namespace spitfire\provider\bindings;
+
+use Closure;
+use ReflectionClass;
+use ReflectionException;
+use ReflectionNamedType;
+use ReflectionParameter;
+use spitfire\provider\BindingInterface;
+use spitfire\provider\Container;
+use spitfire\provider\NotFoundException;
+
+/**
+ * A partial is a reference to a class and a series of parameters that can be
+ * instanced with Provider.
+ *
+ * It's called partial because, with the given resources, an instance of the
+ * class cannot be assmebled. Instead, the container will need to provide missing
+ * pieces.
+ *
+ * @author César de la Cal Bretschneider
+ */
+class Partial implements BindingInterface
+{
+
+ /**
+ *
+ * @var Container
+ */
+ private $provider;
+
+ /**
+ * The name of the class to be instanced
+ *
+ * @template T of object
+ * @var class-string<T>
+ */
+ private $classname;
+
+ /**
+ * The parameters passed to the class' constructor.
+ *
+ * @var mixed
+ */
+ private $parameters;
+
+ /**
+ * Create a service. This allows the application to resolve the
+ * parameters for the given service.
+ *
+ * @param Container $provider
+ * @param class-string $classname
+ * @param mixed[] $parameters
+ */
+ public function __construct(Container $provider, $classname, $parameters)
+ {
+ $this->provider = $provider;
+ $this->classname = $classname;
+ $this->parameters = $parameters;
+ }
+
+ /**
+ * Allows to generate expressive
+ *
+ * @param string $name
+ * @param mixed $payload
+ * @throws NotFoundException
+ * @return Partial
+ */
+ public function needs($name, $payload)
+ {
+ if (class_exists($name)) {
+
+ $reflection = new ReflectionClass($this->classname);
+ $method = $reflection->getMethod('__construct');
+ $params = $method->getParameters();
+
+ foreach ($params as $param) {
+ $type = $param->getType();
+
+ if ($type instanceof ReflectionNamedType && $type->getName()) {
+ $this->parameters[$param->getName()] = $payload;
+ return $this;
+ }
+
+ }
+
+ throw new NotFoundException(sprintf('Class %s does not depend on %s', $this->classname, $name));
+ }
+ else {
+ $this->parameters[$name] = $payload;
+ return $this;
+ }
+
+ }
+
+ /**
+ * Creates a new instance of the service.
+ */
+ public function instance() : object
+ {
+
+ try {
+ # Autowiring logic for the arguments
+ $reflection = new ReflectionClass($this->classname);
+ $method = $reflection->getMethod('__construct');
+ $required = $method->getParameters();
+
+ $parameters = array_map(function (ReflectionParameter$e) {
+ $name = $e->getName();
+
+ if (array_key_exists($name, $this->parameters)) {
+ return $this->parameters[$name] instanceof BindingInterface? $this->parameters[$name]->instance() : $this->parameters[$name];
+ }
+
+ try {
+ $type = $e->getType();
+ if (!($type instanceof ReflectionNamedType)) { throw new NotFoundException('Anonymous types cannot be resolved'); }
+ return $this->provider->get($type->getName());
+ }
+ catch (ReflectionException $e) {
+ throw new NotFoundException($e->getMessage());
+ }
+ }, $required);
+
+ return $reflection->newInstance(...$parameters);
+ }
+ /**
+ * If the class does not have a constructor the reflection of __construct
+ * will fail. This is a trivial issue, since we do accept classes without
+ * an explicit constructor we can resolve this issue by instancing the class
+ * without parameters.
+ */
+ catch (ReflectionException $e) {
+ return new $this->classname;
+ }
+ }
+}
diff --git a/src/Reference.php b/src/bindings/Reference.php
rename from src/Reference.php
rename to src/bindings/Reference.php
--- a/src/Reference.php
+++ b/src/bindings/Reference.php
@@ -1,4 +1,7 @@
-<?php namespace spitfire\provider;
+<?php namespace spitfire\provider\bindings;
+
+use spitfire\provider\BindingInterface;
+use spitfire\provider\Container;
/**
* A reference links a Provider instance with a service name. This
@@ -7,11 +10,11 @@
*
* @author César de la Cal Bretschneider
*/
-class Reference
+class Reference implements BindingInterface
{
/**
- * @var Provider
+ * @var Container
*/
private $container;
@@ -22,7 +25,12 @@
*/
private $key;
- public function __construct($container, $key)
+ /**
+ *
+ * @param Container $container
+ * @param string $key
+ */
+ public function __construct(Container $container, $key)
{
$this->container = $container;
$this->key = $key;
@@ -32,7 +40,9 @@
* Performs a lookup on the linked container to locate the dependency or
* service and returns it.
*/
- public function resolve() {
+ public function instance() : object
+ {
return $this->container->get($this->key);
- }
+ }
+
}
diff --git a/src/bindings/Singleton.php b/src/bindings/Singleton.php
new file mode 100644
--- /dev/null
+++ b/src/bindings/Singleton.php
@@ -0,0 +1,28 @@
+<?php namespace spitfire\provider\bindings;
+
+use Closure;
+use spitfire\provider\BindingInterface;
+use spitfire\provider\Container;
+
+class Singleton extends Factory
+{
+
+ /**
+ *
+ * @var object
+ */
+ private $instance;
+
+ /**
+ * @return object
+ */
+ public function instance() : object
+ {
+ if ($this->instance === null) {
+ $this->instance = parent::instance();
+ }
+
+ return $this->instance;
+ }
+
+}
\ No newline at end of file
diff --git a/tests/ProviderTest.php b/tests/ProviderTest.php
--- a/tests/ProviderTest.php
+++ b/tests/ProviderTest.php
@@ -1,11 +1,14 @@
<?php
use PHPUnit\Framework\TestCase;
+use spitfire\provider\Container;
use spitfire\provider\NotFoundException;
use spitfire\provider\Provider;
-class A {}
+class A {
+ public $a;
+}
class B {
public $a;
public function __construct(A $a)
@@ -29,6 +32,17 @@
public function __construct(D $d)
{
+ return $d;
+ }
+}
+class F {
+
+ public $a;
+
+ public function __construct(A $a, string $hello)
+ {
+ $a->a = $hello;
+ $this->a = $a;
}
}
@@ -36,7 +50,7 @@
{
public function testGet() {
- $provider = new Provider();
+ $provider = new Container();
$b = $provider->get(B::class);
$this->assertInstanceOf(B::class, $b);
@@ -44,10 +58,10 @@
}
public function testMake() {
- $provider = new Provider();
+ $provider = new Container();
$a = new A();
- $c = $provider->make(C::class, ['a' => $a]);
+ $c = $provider->assemble(C::class, ['a' => $a]);
$this->assertInstanceOf(C::class, $c);
$this->assertInstanceOf(B::class, $c->b);
@@ -56,7 +70,7 @@
}
public function testCall() {
- $provider = new Provider();
+ $provider = new Container();
$c = $provider->call(function (C $c) {
$this->assertInstanceOf(C::class, $c);
@@ -66,10 +80,47 @@
}
public function testInvalidDependency() {
- $provider = new Provider();
+ $provider = new Container();
$this->expectException(NotFoundException::class);
$e = $provider->get(E::class);
- }
+ }
+
+ public function testFactories() {
+ $invoked = false;
+ $provider = new Container();
+ $provider->factory(A::class, function () use (&$invoked) { $invoked = true; return new A(); });
+ $provider->get(A::class);
+
+ $this->assertEquals(true, $invoked);
+ }
+
+ public function testFactoriesInherited() {
+ $invoked = false;
+ $provider = new Container();
+ $provider->factory(A::class, function () use (&$invoked) { $invoked = true; return new A(); });
+ $provider->get(B::class);
+
+ $this->assertEquals(true, $invoked);
+ }
+
+ public function testSingleton() {
+ $provider = new Container();
+ $provider->singleton(A::class, function () { return new A(); });
+
+ $b1 = $provider->get(B::class);
+ $b2 = $provider->get(B::class);
+
+ $this->assertEquals(false, $b1 === $b2);
+ $this->assertEquals(true, $b1->a === $b2->a);
+ }
+
+ public function testPartials() {
+ $provider = new Container();
+ $provider->service(F::class)->needs('hello', 'world');
+
+ $f = $provider->get(F::class);
+ $this->assertEquals('world', $f->a->a);
+ }
}

File Metadata

Mime Type
text/plain
Expires
Wed, Apr 14, 5:04 PM (3 w, 5 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5516
Default Alt Text
D501.id1609.diff (82 KB)

Event Timeline