diff --git a/composer.json b/composer.json index 258a1de..87a42e8 100644 --- a/composer.json +++ b/composer.json @@ -28,8 +28,8 @@ "ext-pdo": "*", "doctrine/coding-standard": "^6.0", "phpbench/phpbench": "^0.13", - "phpstan/phpstan-phpunit": "^0.11", - "phpstan/phpstan-shim": "^0.11", + "phpstan/phpstan": "^0.12", + "phpstan/phpstan-phpunit": "^0.12", "phpunit/phpunit": "^7.0" }, "autoload": { diff --git a/composer.lock b/composer.lock index d40a9df..e6f3c9f 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "cb6941aca5cfedf769e6161aa5667bc5", + "content-hash": "5d688ebd535a4634f5e255fc5f0c2126", "packages": [], "packages-dev": [ { @@ -60,6 +60,10 @@ "assertion", "validation" ], + "support": { + "issues": "https://github.com/beberlei/assert/issues", + "source": "https://github.com/beberlei/assert/tree/v2.9.9" + }, "time": "2019-05-28T15:27:37+00:00" }, { @@ -134,30 +138,33 @@ }, { "name": "doctrine/annotations", - "version": "v1.8.0", + "version": "1.11.1", "source": { "type": "git", "url": "https://github.com/doctrine/annotations.git", - "reference": "904dca4eb10715b92569fbcd79e201d5c349b6bc" + "reference": "ce77a7ba1770462cd705a91a151b6c3746f9c6ad" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/annotations/zipball/904dca4eb10715b92569fbcd79e201d5c349b6bc", - "reference": "904dca4eb10715b92569fbcd79e201d5c349b6bc", + "url": "https://api.github.com/repos/doctrine/annotations/zipball/ce77a7ba1770462cd705a91a151b6c3746f9c6ad", + "reference": "ce77a7ba1770462cd705a91a151b6c3746f9c6ad", "shasum": "" }, "require": { "doctrine/lexer": "1.*", - "php": "^7.1" + "ext-tokenizer": "*", + "php": "^7.1 || ^8.0" }, "require-dev": { "doctrine/cache": "1.*", - "phpunit/phpunit": "^7.5" + "doctrine/coding-standard": "^6.0 || ^8.1", + "phpstan/phpstan": "^0.12.20", + "phpunit/phpunit": "^7.5 || ^9.1.5" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.7.x-dev" + "dev-master": "1.11.x-dev" } }, "autoload": { @@ -192,13 +199,17 @@ } ], "description": "Docblock Annotations Parser", - "homepage": "http://www.doctrine-project.org", + "homepage": "https://www.doctrine-project.org/projects/annotations.html", "keywords": [ "annotations", "docblock", "parser" ], - "time": "2019-10-01T18:55:10+00:00" + "support": { + "issues": "https://github.com/doctrine/annotations/issues", + "source": "https://github.com/doctrine/annotations/tree/1.11.1" + }, + "time": "2020-10-26T10:28:16+00:00" }, { "name": "doctrine/coding-standard", @@ -323,20 +334,24 @@ "parser", "php" ], + "support": { + "issues": "https://github.com/doctrine/lexer/issues", + "source": "https://github.com/doctrine/lexer/tree/1.0.2" + }, "time": "2019-06-08T11:03:04+00:00" }, { "name": "lstrojny/functional-php", - "version": "1.11.0", + "version": "1.14.1", "source": { "type": "git", "url": "https://github.com/lstrojny/functional-php.git", - "reference": "df0e516eb44cd0579eeaff57023ef41ffa11947f" + "reference": "9e8363e3cb9db924327f51b5804f4dfba03605aa" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/lstrojny/functional-php/zipball/df0e516eb44cd0579eeaff57023ef41ffa11947f", - "reference": "df0e516eb44cd0579eeaff57023ef41ffa11947f", + "url": "https://api.github.com/repos/lstrojny/functional-php/zipball/9e8363e3cb9db924327f51b5804f4dfba03605aa", + "reference": "9e8363e3cb9db924327f51b5804f4dfba03605aa", "shasum": "" }, "require": { @@ -353,6 +368,7 @@ "Functional\\": "src/Functional" }, "files": [ + "src/Functional/Ary.php", "src/Functional/Average.php", "src/Functional/ButLast.php", "src/Functional/Capture.php", @@ -400,7 +416,7 @@ "src/Functional/LessThanOrEqual.php", "src/Functional/LexicographicCompare.php", "src/Functional/Map.php", - "src/Functional/Match.php", + "src/Functional/Matching.php", "src/Functional/Maximum.php", "src/Functional/Memoize.php", "src/Functional/Minimum.php", @@ -441,6 +457,7 @@ "src/Functional/True.php", "src/Functional/Truthy.php", "src/Functional/Unique.php", + "src/Functional/ValueToKey.php", "src/Functional/With.php", "src/Functional/Zip.php", "src/Functional/ZipAll.php" @@ -465,24 +482,28 @@ "keywords": [ "functional" ], - "time": "2019-12-19T16:01:40+00:00" + "support": { + "issues": "https://github.com/lstrojny/functional-php/issues", + "source": "https://github.com/lstrojny/functional-php/tree/1.14.1" + }, + "time": "2020-10-12T09:48:50+00:00" }, { "name": "myclabs/deep-copy", - "version": "1.9.5", + "version": "1.10.1", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "b2c28789e80a97badd14145fda39b545d83ca3ef" + "reference": "969b211f9a51aa1f6c01d1d2aef56d3bd91598e5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/b2c28789e80a97badd14145fda39b545d83ca3ef", - "reference": "b2c28789e80a97badd14145fda39b545d83ca3ef", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/969b211f9a51aa1f6c01d1d2aef56d3bd91598e5", + "reference": "969b211f9a51aa1f6c01d1d2aef56d3bd91598e5", "shasum": "" }, "require": { - "php": "^7.1" + "php": "^7.1 || ^8.0" }, "replace": { "myclabs/deep-copy": "self.version" @@ -513,7 +534,17 @@ "object", "object graph" ], - "time": "2020-01-17T21:11:47+00:00" + "support": { + "issues": "https://github.com/myclabs/DeepCopy/issues", + "source": "https://github.com/myclabs/DeepCopy/tree/1.x" + }, + "funding": [ + { + "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", + "type": "tidelift" + } + ], + "time": "2020-06-29T13:22:24+00:00" }, { "name": "phar-io/manifest", @@ -568,6 +599,10 @@ } ], "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": "2018-07-08T19:23:20+00:00" }, { @@ -615,20 +650,24 @@ } ], "description": "Library for handling version information and constraints", + "support": { + "issues": "https://github.com/phar-io/version/issues", + "source": "https://github.com/phar-io/version/tree/master" + }, "time": "2018-07-08T19:19:57+00:00" }, { "name": "phpbench/container", - "version": "1.2", + "version": "1.2.1", "source": { "type": "git", "url": "https://github.com/phpbench/container.git", - "reference": "c0e3cbf1cd8f867c70b029cb6d1b0b39fe6d409d" + "reference": "2f2b269b3b8cb9a0053cf98f1c3a84866fe7f0e2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpbench/container/zipball/c0e3cbf1cd8f867c70b029cb6d1b0b39fe6d409d", - "reference": "c0e3cbf1cd8f867c70b029cb6d1b0b39fe6d409d", + "url": "https://api.github.com/repos/phpbench/container/zipball/2f2b269b3b8cb9a0053cf98f1c3a84866fe7f0e2", + "reference": "2f2b269b3b8cb9a0053cf98f1c3a84866fe7f0e2", "shasum": "" }, "require": { @@ -659,7 +698,11 @@ } ], "description": "Simple, configurable, service container.", - "time": "2018-02-12T08:08:59+00:00" + "support": { + "issues": "https://github.com/phpbench/container/issues", + "source": "https://github.com/phpbench/container/tree/1.2.1" + }, + "time": "2020-08-23T23:43:00+00:00" }, { "name": "phpbench/dom", @@ -704,6 +747,10 @@ } ], "description": "DOM wrapper to simplify working with the PHP DOM implementation", + "support": { + "issues": "https://github.com/phpbench/dom/issues", + "source": "https://github.com/phpbench/dom/tree/master" + }, "time": "2016-02-27T12:15:56+00:00" }, { @@ -773,28 +820,29 @@ } ], "description": "PHP Benchmarking Framework", + "support": { + "issues": "https://github.com/phpbench/phpbench/issues", + "source": "https://github.com/phpbench/phpbench/tree/master" + }, "time": "2016-11-20T22:04:57+00:00" }, { "name": "phpdocumentor/reflection-common", - "version": "2.0.0", + "version": "2.1.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionCommon.git", - "reference": "63a995caa1ca9e5590304cd845c15ad6d482a62a" + "reference": "6568f4687e5b41b054365f9ae03fcb1ed5f2069b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/63a995caa1ca9e5590304cd845c15ad6d482a62a", - "reference": "63a995caa1ca9e5590304cd845c15ad6d482a62a", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/6568f4687e5b41b054365f9ae03fcb1ed5f2069b", + "reference": "6568f4687e5b41b054365f9ae03fcb1ed5f2069b", "shasum": "" }, "require": { "php": ">=7.1" }, - "require-dev": { - "phpunit/phpunit": "~6" - }, "type": "library", "extra": { "branch-alias": { @@ -825,7 +873,11 @@ "reflection", "static analysis" ], - "time": "2018-08-07T13:53:10+00:00" + "support": { + "issues": "https://github.com/phpDocumentor/ReflectionCommon/issues", + "source": "https://github.com/phpDocumentor/ReflectionCommon/tree/master" + }, + "time": "2020-04-27T09:25:28+00:00" }, { "name": "phpdocumentor/reflection-docblock", @@ -877,6 +929,10 @@ } ], "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", + "support": { + "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", + "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/release/4.x" + }, "time": "2019-12-28T18:55:12+00:00" }, { @@ -924,20 +980,24 @@ } ], "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/0.7.2" + }, "time": "2019-08-22T18:11:29+00:00" }, { "name": "phpspec/prophecy", - "version": "v1.10.2", + "version": "v1.10.3", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "b4400efc9d206e83138e2bb97ed7f5b14b831cd9" + "reference": "451c3cd1418cf640de218914901e51b064abb093" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/b4400efc9d206e83138e2bb97ed7f5b14b831cd9", - "reference": "b4400efc9d206e83138e2bb97ed7f5b14b831cd9", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/451c3cd1418cf640de218914901e51b064abb093", + "reference": "451c3cd1418cf640de218914901e51b064abb093", "shasum": "" }, "require": { @@ -987,86 +1047,82 @@ "spy", "stub" ], - "time": "2020-01-20T15:57:02+00:00" + "support": { + "issues": "https://github.com/phpspec/prophecy/issues", + "source": "https://github.com/phpspec/prophecy/tree/v1.10.3" + }, + "time": "2020-03-05T15:02:03+00:00" }, { - "name": "phpstan/phpstan-phpunit", - "version": "0.11.2", + "name": "phpstan/phpdoc-parser", + "version": "0.3.5", "source": { "type": "git", - "url": "https://github.com/phpstan/phpstan-phpunit.git", - "reference": "fbf2ad56c3b13189d29655e226c9b1da47c2fad9" + "url": "https://github.com/phpstan/phpdoc-parser.git", + "reference": "8c4ef2aefd9788238897b678a985e1d5c8df6db4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan-phpunit/zipball/fbf2ad56c3b13189d29655e226c9b1da47c2fad9", - "reference": "fbf2ad56c3b13189d29655e226c9b1da47c2fad9", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/8c4ef2aefd9788238897b678a985e1d5c8df6db4", + "reference": "8c4ef2aefd9788238897b678a985e1d5c8df6db4", "shasum": "" }, "require": { - "nikic/php-parser": "^4.0", - "php": "~7.1", - "phpstan/phpdoc-parser": "^0.3", - "phpstan/phpstan": "^0.11.4" - }, - "conflict": { - "phpunit/phpunit": "<7.0" + "php": "~7.1" }, "require-dev": { - "consistence/coding-standard": "^3.0.1", - "dealerdirect/phpcodesniffer-composer-installer": "^0.4.4", - "jakub-onderka/php-parallel-lint": "^1.0", + "consistence/coding-standard": "^3.5", + "jakub-onderka/php-parallel-lint": "^0.9.2", "phing/phing": "^2.16.0", - "phpstan/phpstan-strict-rules": "^0.11", - "phpunit/phpunit": "^7.0", - "satooshi/php-coveralls": "^1.0", - "slevomat/coding-standard": "^4.5.2" + "phpstan/phpstan": "^0.10", + "phpunit/phpunit": "^6.3", + "slevomat/coding-standard": "^4.7.2", + "squizlabs/php_codesniffer": "^3.3.2", + "symfony/process": "^3.4 || ^4.0" }, - "type": "phpstan-extension", + "type": "library", "extra": { "branch-alias": { - "dev-master": "0.11-dev" - }, - "phpstan": { - "includes": [ - "extension.neon", - "rules.neon" - ] + "dev-master": "0.3-dev" } }, "autoload": { "psr-4": { - "PHPStan\\": "src/" + "PHPStan\\PhpDocParser\\": [ + "src/" + ] } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "description": "PHPUnit extensions and rules for PHPStan", - "time": "2019-05-17T17:50:16+00:00" + "description": "PHPDoc parser with support for nullable, intersection and generic types", + "support": { + "issues": "https://github.com/phpstan/phpdoc-parser/issues", + "source": "https://github.com/phpstan/phpdoc-parser/tree/master" + }, + "time": "2019-06-07T19:13:52+00:00" }, { - "name": "phpstan/phpstan-shim", - "version": "0.11.19", + "name": "phpstan/phpstan", + "version": "0.12.54", "source": { "type": "git", - "url": "https://github.com/phpstan/phpstan-shim.git", - "reference": "e3c06b1d63691dae644ae1e5b540905c8c021801" + "url": "https://github.com/phpstan/phpstan.git", + "reference": "45c7b999a4b7dd9ac5558bdaaf23dcebbef88223" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan-shim/zipball/e3c06b1d63691dae644ae1e5b540905c8c021801", - "reference": "e3c06b1d63691dae644ae1e5b540905c8c021801", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/45c7b999a4b7dd9ac5558bdaaf23dcebbef88223", + "reference": "45c7b999a4b7dd9ac5558bdaaf23dcebbef88223", "shasum": "" }, "require": { - "php": "~7.1" + "php": "^7.1|^8.0" }, - "replace": { - "nikic/php-parser": "^4.0.2", - "phpstan/phpdoc-parser": "^0.3.3", - "phpstan/phpstan": "self.version" + "conflict": { + "phpstan/phpstan-shim": "*" }, "bin": [ "phpstan", @@ -1075,7 +1131,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "0.11-dev" + "dev-master": "0.12-dev" } }, "autoload": { @@ -1087,9 +1143,86 @@ "license": [ "MIT" ], - "description": "PHPStan Phar distribution", - "abandoned": "phpstan/phpstan", - "time": "2019-10-22T20:46:16+00:00" + "description": "PHPStan - PHP Static Analysis Tool", + "support": { + "issues": "https://github.com/phpstan/phpstan/issues", + "source": "https://github.com/phpstan/phpstan/tree/0.12.54" + }, + "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-11-05T13:36:26+00:00" + }, + { + "name": "phpstan/phpstan-phpunit", + "version": "0.12.16", + "source": { + "type": "git", + "url": "https://github.com/phpstan/phpstan-phpunit.git", + "reference": "1dd916d181b0539dea5cd37e91546afb8b107e17" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/phpstan-phpunit/zipball/1dd916d181b0539dea5cd37e91546afb8b107e17", + "reference": "1dd916d181b0539dea5cd37e91546afb8b107e17", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0", + "phpstan/phpstan": "^0.12.33" + }, + "conflict": { + "phpunit/phpunit": "<7.0" + }, + "require-dev": { + "consistence/coding-standard": "^3.5", + "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", + "ergebnis/composer-normalize": "^2.0.2", + "jakub-onderka/php-parallel-lint": "^1.0", + "phing/phing": "^2.16.0", + "phpstan/phpstan-strict-rules": "^0.12", + "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0", + "satooshi/php-coveralls": "^1.0", + "slevomat/coding-standard": "^4.7.2" + }, + "type": "phpstan-extension", + "extra": { + "branch-alias": { + "dev-master": "0.12-dev" + }, + "phpstan": { + "includes": [ + "extension.neon", + "rules.neon" + ] + } + }, + "autoload": { + "psr-4": { + "PHPStan\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "PHPUnit extensions and rules for PHPStan", + "support": { + "issues": "https://github.com/phpstan/phpstan-phpunit/issues", + "source": "https://github.com/phpstan/phpstan-phpunit/tree/0.12.16" + }, + "time": "2020-08-05T13:28:50+00:00" }, { "name": "phpunit/php-code-coverage", @@ -1152,6 +1285,10 @@ "testing", "xunit" ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/master" + }, "time": "2018-10-31T16:06:48+00:00" }, { @@ -1202,6 +1339,10 @@ "filesystem", "iterator" ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/2.0.2" + }, "time": "2018-09-13T20:33:42+00:00" }, { @@ -1243,6 +1384,10 @@ "keywords": [ "template" ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-text-template/issues", + "source": "https://github.com/sebastianbergmann/php-text-template/tree/1.2.1" + }, "time": "2015-06-21T13:50:34+00:00" }, { @@ -1292,6 +1437,10 @@ "keywords": [ "timer" ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-timer/issues", + "source": "https://github.com/sebastianbergmann/php-timer/tree/master" + }, "time": "2019-06-07T04:22:29+00:00" }, { @@ -1341,6 +1490,11 @@ "keywords": [ "tokenizer" ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-token-stream/issues", + "source": "https://github.com/sebastianbergmann/php-token-stream/tree/3.1.1" + }, + "abandoned": true, "time": "2019-09-17T06:23:10+00:00" }, { @@ -1425,6 +1579,10 @@ "testing", "xunit" ], + "support": { + "issues": "https://github.com/sebastianbergmann/phpunit/issues", + "source": "https://github.com/sebastianbergmann/phpunit/tree/7.5.20" + }, "time": "2020-01-08T08:45:45+00:00" }, { @@ -1474,20 +1632,24 @@ "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" }, { "name": "psr/log", - "version": "1.1.2", + "version": "1.1.3", "source": { "type": "git", "url": "https://github.com/php-fig/log.git", - "reference": "446d54b4cb6bf489fc9d75f55843658e6f25d801" + "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/446d54b4cb6bf489fc9d75f55843658e6f25d801", - "reference": "446d54b4cb6bf489fc9d75f55843658e6f25d801", + "url": "https://api.github.com/repos/php-fig/log/zipball/0f73288fd15629204f9d42b7055f72dacbe811fc", + "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc", "shasum": "" }, "require": { @@ -1521,7 +1683,10 @@ "psr", "psr-3" ], - "time": "2019-11-01T11:05:21+00:00" + "support": { + "source": "https://github.com/php-fig/log/tree/1.1.3" + }, + "time": "2020-03-23T09:12:05+00:00" }, { "name": "sebastian/code-unit-reverse-lookup", @@ -1566,6 +1731,10 @@ ], "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/master" + }, "time": "2017-03-04T06:30:41+00:00" }, { @@ -1630,6 +1799,10 @@ "compare", "equality" ], + "support": { + "issues": "https://github.com/sebastianbergmann/comparator/issues", + "source": "https://github.com/sebastianbergmann/comparator/tree/master" + }, "time": "2018-07-12T15:12:46+00:00" }, { @@ -1686,6 +1859,10 @@ "unidiff", "unified diff" ], + "support": { + "issues": "https://github.com/sebastianbergmann/diff/issues", + "source": "https://github.com/sebastianbergmann/diff/tree/master" + }, "time": "2019-02-04T06:01:07+00:00" }, { @@ -1739,6 +1916,10 @@ "environment", "hhvm" ], + "support": { + "issues": "https://github.com/sebastianbergmann/environment/issues", + "source": "https://github.com/sebastianbergmann/environment/tree/4.2.3" + }, "time": "2019-11-20T08:46:58+00:00" }, { @@ -1806,6 +1987,10 @@ "export", "exporter" ], + "support": { + "issues": "https://github.com/sebastianbergmann/exporter/issues", + "source": "https://github.com/sebastianbergmann/exporter/tree/master" + }, "time": "2019-09-14T09:02:43+00:00" }, { @@ -1857,6 +2042,10 @@ "keywords": [ "global state" ], + "support": { + "issues": "https://github.com/sebastianbergmann/global-state/issues", + "source": "https://github.com/sebastianbergmann/global-state/tree/2.0.0" + }, "time": "2017-04-27T15:39:26+00:00" }, { @@ -1904,6 +2093,10 @@ ], "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/master" + }, "time": "2017-08-03T12:35:26+00:00" }, { @@ -1949,6 +2142,10 @@ ], "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/master" + }, "time": "2017-03-29T09:07:27+00:00" }, { @@ -2002,6 +2199,10 @@ ], "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/master" + }, "time": "2017-03-03T06:23:57+00:00" }, { @@ -2044,6 +2245,10 @@ ], "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/master" + }, "time": "2018-10-04T04:07:39+00:00" }, { @@ -2087,24 +2292,28 @@ ], "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/master" + }, "time": "2016-10-03T07:35:21+00:00" }, { "name": "seld/jsonlint", - "version": "1.7.2", + "version": "1.8.2", "source": { "type": "git", "url": "https://github.com/Seldaek/jsonlint.git", - "reference": "e2e5d290e4d2a4f0eb449f510071392e00e10d19" + "reference": "590cfec960b77fd55e39b7d9246659e95dd6d337" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/e2e5d290e4d2a4f0eb449f510071392e00e10d19", - "reference": "e2e5d290e4d2a4f0eb449f510071392e00e10d19", + "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/590cfec960b77fd55e39b7d9246659e95dd6d337", + "reference": "590cfec960b77fd55e39b7d9246659e95dd6d337", "shasum": "" }, "require": { - "php": "^5.3 || ^7.0" + "php": "^5.3 || ^7.0 || ^8.0" }, "require-dev": { "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" @@ -2136,7 +2345,21 @@ "parser", "validator" ], - "time": "2019-10-24T14:27:39+00:00" + "support": { + "issues": "https://github.com/Seldaek/jsonlint/issues", + "source": "https://github.com/Seldaek/jsonlint/tree/master" + }, + "funding": [ + { + "url": "https://github.com/Seldaek", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/seld/jsonlint", + "type": "tidelift" + } + ], + "time": "2020-08-25T06:56:57+00:00" }, { "name": "slevomat/coding-standard", @@ -2176,20 +2399,24 @@ "MIT" ], "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/master" + }, "time": "2019-03-22T19:10:53+00:00" }, { "name": "squizlabs/php_codesniffer", - "version": "3.5.4", + "version": "3.5.8", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "dceec07328401de6211037abbb18bda423677e26" + "reference": "9d583721a7157ee997f235f327de038e7ea6dac4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/dceec07328401de6211037abbb18bda423677e26", - "reference": "dceec07328401de6211037abbb18bda423677e26", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/9d583721a7157ee997f235f327de038e7ea6dac4", + "reference": "9d583721a7157ee997f235f327de038e7ea6dac4", "shasum": "" }, "require": { @@ -2227,20 +2454,25 @@ "phpcs", "standards" ], - "time": "2020-01-30T22:20:29+00:00" + "support": { + "issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues", + "source": "https://github.com/squizlabs/PHP_CodeSniffer", + "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki" + }, + "time": "2020-10-23T02:01:07+00:00" }, { "name": "symfony/console", - "version": "v3.4.37", + "version": "v3.4.46", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "7c5bdd346f9d90a2d22d4e1fe61e02dc19b98f12" + "reference": "a10b1da6fc93080c180bba7219b5ff5b7518fe81" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/7c5bdd346f9d90a2d22d4e1fe61e02dc19b98f12", - "reference": "7c5bdd346f9d90a2d22d4e1fe61e02dc19b98f12", + "url": "https://api.github.com/repos/symfony/console/zipball/a10b1da6fc93080c180bba7219b5ff5b7518fe81", + "reference": "a10b1da6fc93080c180bba7219b5ff5b7518fe81", "shasum": "" }, "require": { @@ -2270,11 +2502,6 @@ "symfony/process": "" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.4-dev" - } - }, "autoload": { "psr-4": { "Symfony\\Component\\Console\\": "" @@ -2299,20 +2526,37 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2020-01-10T07:52:48+00:00" + "support": { + "source": "https://github.com/symfony/console/tree/v3.4.46" + }, + "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": "2020-10-24T10:57:07+00:00" }, { "name": "symfony/debug", - "version": "v3.4.37", + "version": "v3.4.46", "source": { "type": "git", "url": "https://github.com/symfony/debug.git", - "reference": "70dd18e93bb8bdf3c4db7fde832619fef9828cf8" + "reference": "ab42889de57fdfcfcc0759ab102e2fd4ea72dcae" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/70dd18e93bb8bdf3c4db7fde832619fef9828cf8", - "reference": "70dd18e93bb8bdf3c4db7fde832619fef9828cf8", + "url": "https://api.github.com/repos/symfony/debug/zipball/ab42889de57fdfcfcc0759ab102e2fd4ea72dcae", + "reference": "ab42889de57fdfcfcc0759ab102e2fd4ea72dcae", "shasum": "" }, "require": { @@ -2326,11 +2570,6 @@ "symfony/http-kernel": "~2.8|~3.0|~4.0" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.4-dev" - } - }, "autoload": { "psr-4": { "Symfony\\Component\\Debug\\": "" @@ -2355,20 +2594,37 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "time": "2020-01-08T16:36:15+00:00" + "support": { + "source": "https://github.com/symfony/debug/tree/v3.4.46" + }, + "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": "2020-10-24T10:57:07+00:00" }, { "name": "symfony/filesystem", - "version": "v3.4.37", + "version": "v3.4.46", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "0a0d3b4bda11aa3a0464531c40e681e184e75628" + "reference": "e58d7841cddfed6e846829040dca2cca0ebbbbb3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/0a0d3b4bda11aa3a0464531c40e681e184e75628", - "reference": "0a0d3b4bda11aa3a0464531c40e681e184e75628", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/e58d7841cddfed6e846829040dca2cca0ebbbbb3", + "reference": "e58d7841cddfed6e846829040dca2cca0ebbbbb3", "shasum": "" }, "require": { @@ -2376,11 +2632,6 @@ "symfony/polyfill-ctype": "~1.8" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.4-dev" - } - }, "autoload": { "psr-4": { "Symfony\\Component\\Filesystem\\": "" @@ -2405,31 +2656,43 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "time": "2020-01-17T08:50:08+00:00" + "support": { + "source": "https://github.com/symfony/filesystem/tree/v3.4.46" + }, + "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": "2020-10-24T10:57:07+00:00" }, { "name": "symfony/finder", - "version": "v3.4.37", + "version": "v3.4.46", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "a90a9d3b9f458a5cdeabfa4090b20c000ca3962f" + "reference": "4e1da3c110c52d868f8a9153b7de3ebc381fba78" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/a90a9d3b9f458a5cdeabfa4090b20c000ca3962f", - "reference": "a90a9d3b9f458a5cdeabfa4090b20c000ca3962f", + "url": "https://api.github.com/repos/symfony/finder/zipball/4e1da3c110c52d868f8a9153b7de3ebc381fba78", + "reference": "4e1da3c110c52d868f8a9153b7de3ebc381fba78", "shasum": "" }, "require": { "php": "^5.5.9|>=7.0.8" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.4-dev" - } - }, "autoload": { "psr-4": { "Symfony\\Component\\Finder\\": "" @@ -2454,31 +2717,43 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2020-01-01T11:03:25+00:00" + "support": { + "source": "https://github.com/symfony/finder/tree/v3.4.46" + }, + "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": "2020-10-24T10:57:07+00:00" }, { "name": "symfony/options-resolver", - "version": "v3.4.37", + "version": "v3.4.46", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", - "reference": "730ef56164ed6c9356c159e9f5ff2b84d753b9ed" + "reference": "c7efc97a47b2ebaabc19d5b6c6b50f5c37c92744" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/730ef56164ed6c9356c159e9f5ff2b84d753b9ed", - "reference": "730ef56164ed6c9356c159e9f5ff2b84d753b9ed", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/c7efc97a47b2ebaabc19d5b6c6b50f5c37c92744", + "reference": "c7efc97a47b2ebaabc19d5b6c6b50f5c37c92744", "shasum": "" }, "require": { "php": "^5.5.9|>=7.0.8" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.4-dev" - } - }, "autoload": { "psr-4": { "Symfony\\Component\\OptionsResolver\\": "" @@ -2508,24 +2783,41 @@ "configuration", "options" ], - "time": "2020-01-01T11:03:25+00:00" + "support": { + "source": "https://github.com/symfony/options-resolver/tree/v3.4.46" + }, + "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": "2020-10-24T10:57:07+00:00" }, { "name": "symfony/polyfill-ctype", - "version": "v1.13.1", + "version": "v1.20.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "f8f0b461be3385e56d6de3dbb5a0df24c0c275e3" + "reference": "f4ba089a5b6366e453971d3aad5fe8e897b37f41" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/f8f0b461be3385e56d6de3dbb5a0df24c0c275e3", - "reference": "f8f0b461be3385e56d6de3dbb5a0df24c0c275e3", + "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" @@ -2533,7 +2825,11 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.13-dev" + "dev-main": "1.20-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } }, "autoload": { @@ -2566,24 +2862,41 @@ "polyfill", "portable" ], - "time": "2019-11-27T13:56:44+00:00" + "support": { + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.20.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-10-23T14:02:19+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.13.1", + "version": "v1.20.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "7b4aab9743c30be783b73de055d24a39cf4b954f" + "reference": "39d483bdf39be819deabf04ec872eb0b2410b531" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/7b4aab9743c30be783b73de055d24a39cf4b954f", - "reference": "7b4aab9743c30be783b73de055d24a39cf4b954f", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/39d483bdf39be819deabf04ec872eb0b2410b531", + "reference": "39d483bdf39be819deabf04ec872eb0b2410b531", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=7.1" }, "suggest": { "ext-mbstring": "For best performance" @@ -2591,7 +2904,11 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.13-dev" + "dev-main": "1.20-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } }, "autoload": { @@ -2625,31 +2942,43 @@ "portable", "shim" ], - "time": "2019-11-27T14:18:11+00:00" + "support": { + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.20.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-10-23T14:02:19+00:00" }, { "name": "symfony/process", - "version": "v3.4.37", + "version": "v3.4.46", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "5b9d2bcffe4678911a4c941c00b7c161252cf09a" + "reference": "b8648cf1d5af12a44a51d07ef9bf980921f15fca" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/5b9d2bcffe4678911a4c941c00b7c161252cf09a", - "reference": "5b9d2bcffe4678911a4c941c00b7c161252cf09a", + "url": "https://api.github.com/repos/symfony/process/zipball/b8648cf1d5af12a44a51d07ef9bf980921f15fca", + "reference": "b8648cf1d5af12a44a51d07ef9bf980921f15fca", "shasum": "" }, "require": { "php": "^5.5.9|>=7.0.8" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.4-dev" - } - }, "autoload": { "psr-4": { "Symfony\\Component\\Process\\": "" @@ -2674,7 +3003,24 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2020-01-01T11:03:25+00:00" + "support": { + "source": "https://github.com/symfony/process/tree/v3.4.46" + }, + "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": "2020-10-24T10:57:07+00:00" }, { "name": "theseer/tokenizer", @@ -2714,28 +3060,33 @@ } ], "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" + }, "time": "2019-06-13T22:48:21+00:00" }, { "name": "webmozart/assert", - "version": "1.6.0", + "version": "1.9.1", "source": { "type": "git", "url": "https://github.com/webmozart/assert.git", - "reference": "573381c0a64f155a0d9a23f4b0c797194805b925" + "reference": "bafc69caeb4d49c39fd0779086c03a3738cbb389" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozart/assert/zipball/573381c0a64f155a0d9a23f4b0c797194805b925", - "reference": "573381c0a64f155a0d9a23f4b0c797194805b925", + "url": "https://api.github.com/repos/webmozart/assert/zipball/bafc69caeb4d49c39fd0779086c03a3738cbb389", + "reference": "bafc69caeb4d49c39fd0779086c03a3738cbb389", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0", + "php": "^5.3.3 || ^7.0 || ^8.0", "symfony/polyfill-ctype": "^1.8" }, "conflict": { - "vimeo/psalm": "<3.6.0" + "phpstan/phpstan": "<0.12.20", + "vimeo/psalm": "<3.9.1" }, "require-dev": { "phpunit/phpunit": "^4.8.36 || ^7.5.13" @@ -2762,7 +3113,11 @@ "check", "validate" ], - "time": "2019-11-24T13:36:37+00:00" + "support": { + "issues": "https://github.com/webmozart/assert/issues", + "source": "https://github.com/webmozart/assert/tree/master" + }, + "time": "2020-07-08T17:02:28+00:00" } ], "aliases": [], diff --git a/phpstan.neon.dist b/phpstan.neon.dist index ecc38ef..60bec6b 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -9,10 +9,6 @@ parameters: - tests ignoreErrors: - - - message: '#::__construct\(\) does not call parent constructor from#' - path: '*/tests/DoctrineTest/InstantiatorTestAsset/*.php' - # dynamic properties confuse static analysis - message: '#Access to an undefined property object::\$foo\.#' diff --git a/src/Doctrine/Instantiator/Exception/InvalidArgumentException.php b/src/Doctrine/Instantiator/Exception/InvalidArgumentException.php index 9188f0b..20e6a9b 100644 --- a/src/Doctrine/Instantiator/Exception/InvalidArgumentException.php +++ b/src/Doctrine/Instantiator/Exception/InvalidArgumentException.php @@ -4,7 +4,6 @@ use InvalidArgumentException as BaseInvalidArgumentException; use ReflectionClass; -use const PHP_VERSION_ID; use function interface_exists; use function sprintf; use function trait_exists; @@ -20,13 +19,17 @@ public static function fromNonExistingClass(string $className) : self return new self(sprintf('The provided type "%s" is an interface, and can not be instantiated', $className)); } - if (PHP_VERSION_ID >= 50400 && trait_exists($className)) { + if (trait_exists($className)) { return new self(sprintf('The provided type "%s" is a trait, and can not be instantiated', $className)); } return new self(sprintf('The provided class "%s" does not exist', $className)); } + /** + * @template T of object + * @phpstan-param ReflectionClass $reflectionClass + */ public static function fromAbstractClass(ReflectionClass $reflectionClass) : self { return new self(sprintf( diff --git a/src/Doctrine/Instantiator/Exception/UnexpectedValueException.php b/src/Doctrine/Instantiator/Exception/UnexpectedValueException.php index d946731..00068e6 100644 --- a/src/Doctrine/Instantiator/Exception/UnexpectedValueException.php +++ b/src/Doctrine/Instantiator/Exception/UnexpectedValueException.php @@ -12,6 +12,10 @@ */ class UnexpectedValueException extends BaseUnexpectedValueException implements ExceptionInterface { + /** + * @template T of object + * @phpstan-param ReflectionClass $reflectionClass + */ public static function fromSerializationTriggeredException( ReflectionClass $reflectionClass, Exception $exception @@ -26,6 +30,10 @@ public static function fromSerializationTriggeredException( ); } + /** + * @template T of object + * @phpstan-param ReflectionClass $reflectionClass + */ public static function fromUncleanUnSerialization( ReflectionClass $reflectionClass, string $errorString, diff --git a/src/Doctrine/Instantiator/Instantiator.php b/src/Doctrine/Instantiator/Instantiator.php index 9c67862..06df8e8 100644 --- a/src/Doctrine/Instantiator/Instantiator.php +++ b/src/Doctrine/Instantiator/Instantiator.php @@ -66,6 +66,11 @@ public function instantiate($className) * Builds the requested object and caches it in static properties for performance * * @return object + * + * @template T of object + * @phpstan-param class-string $className + * + * @phpstan-return T */ private function buildAndCacheFromFactory(string $className) { @@ -86,6 +91,11 @@ private function buildAndCacheFromFactory(string $className) * @throws InvalidArgumentException * @throws UnexpectedValueException * @throws ReflectionException + * + * @template T of object + * @phpstan-param class-string $className + * + * @phpstan-return callable(): T */ private function buildFactory(string $className) : callable { @@ -112,6 +122,11 @@ private function buildFactory(string $className) : callable /** * @throws InvalidArgumentException * @throws ReflectionException + * + * @template T of object + * @phpstan-param class-string $className + * + * @phpstan-return ReflectionClass */ private function getReflectionClass(string $className) : ReflectionClass { @@ -130,6 +145,9 @@ private function getReflectionClass(string $className) : ReflectionClass /** * @throws UnexpectedValueException + * + * @template T of object + * @phpstan-param ReflectionClass $reflectionClass */ private function checkIfUnSerializationIsSupported(ReflectionClass $reflectionClass, string $serializedString) : void { @@ -158,6 +176,9 @@ private function checkIfUnSerializationIsSupported(ReflectionClass $reflectionCl /** * @throws UnexpectedValueException + * + * @template T of object + * @phpstan-param ReflectionClass $reflectionClass */ private function attemptInstantiationViaUnSerialization(ReflectionClass $reflectionClass, string $serializedString) : void { @@ -168,6 +189,10 @@ private function attemptInstantiationViaUnSerialization(ReflectionClass $reflect } } + /** + * @template T of object + * @phpstan-param ReflectionClass $reflectionClass + */ private function isInstantiableViaReflection(ReflectionClass $reflectionClass) : bool { return ! ($this->hasInternalAncestors($reflectionClass) && $reflectionClass->isFinal()); @@ -175,6 +200,9 @@ private function isInstantiableViaReflection(ReflectionClass $reflectionClass) : /** * Verifies whether the given class is to be considered internal + * + * @template T of object + * @phpstan-param ReflectionClass $reflectionClass */ private function hasInternalAncestors(ReflectionClass $reflectionClass) : bool { @@ -193,11 +221,14 @@ private function hasInternalAncestors(ReflectionClass $reflectionClass) : bool * Checks if a class is cloneable * * Classes implementing `__clone` cannot be safely cloned, as that may cause side-effects. + * + * @template T of object + * @phpstan-param ReflectionClass $reflectionClass */ - private function isSafeToClone(ReflectionClass $reflection) : bool + private function isSafeToClone(ReflectionClass $reflectionClass) : bool { - return $reflection->isCloneable() - && ! $reflection->hasMethod('__clone') - && ! $reflection->isSubclassOf(ArrayIterator::class); + return $reflectionClass->isCloneable() + && ! $reflectionClass->hasMethod('__clone') + && ! $reflectionClass->isSubclassOf(ArrayIterator::class); } } diff --git a/src/Doctrine/Instantiator/InstantiatorInterface.php b/src/Doctrine/Instantiator/InstantiatorInterface.php index 95299f4..3ffff82 100644 --- a/src/Doctrine/Instantiator/InstantiatorInterface.php +++ b/src/Doctrine/Instantiator/InstantiatorInterface.php @@ -15,6 +15,9 @@ interface InstantiatorInterface * @return object * * @throws ExceptionInterface + * + * @template T of object + * @phpstan-param class-string $className */ public function instantiate($className); } diff --git a/tests/DoctrineTest/InstantiatorTest/InstantiatorTest.php b/tests/DoctrineTest/InstantiatorTest/InstantiatorTest.php index 302900c..a3ac1a8 100644 --- a/tests/DoctrineTest/InstantiatorTest/InstantiatorTest.php +++ b/tests/DoctrineTest/InstantiatorTest/InstantiatorTest.php @@ -50,6 +50,7 @@ protected function setUp() : void /** * @dataProvider getInstantiableClasses + * @phpstan-param class-string $className */ public function testCanInstantiate(string $className) : void { @@ -58,6 +59,7 @@ public function testCanInstantiate(string $className) : void /** * @dataProvider getInstantiableClasses + * @phpstan-param class-string $className */ public function testInstantiatesSeparateInstances(string $className) : void { @@ -77,6 +79,7 @@ public function testExceptionOnUnSerializationException() : void /** * @dataProvider getInvalidClassNames + * @phpstan-param class-string $invalidClassName */ public function testInstantiationFromNonExistingClass(string $invalidClassName) : void { @@ -91,11 +94,16 @@ public function testInstancesAreNotCloned() : void eval('namespace ' . __NAMESPACE__ . '; class ' . $className . '{}'); - $instance = $this->instantiator->instantiate(__NAMESPACE__ . '\\' . $className); + /** + * @phpstan-var class-string + */ + $classNameWithNamespace = __NAMESPACE__ . '\\' . $className; + + $instance = $this->instantiator->instantiate($classNameWithNamespace); $instance->foo = 'bar'; - $instance2 = $this->instantiator->instantiate(__NAMESPACE__ . '\\' . $className); + $instance2 = $this->instantiator->instantiate($classNameWithNamespace); self::assertObjectNotHasAttribute('foo', $instance2); } @@ -104,6 +112,8 @@ public function testInstancesAreNotCloned() : void * Provides a list of instantiable classes (existing) * * @return string[][] + * + * @phpstan-return list */ public function getInstantiableClasses() : array { diff --git a/tests/DoctrineTest/InstantiatorTestAsset/ArrayObjectAsset.php b/tests/DoctrineTest/InstantiatorTestAsset/ArrayObjectAsset.php index 16aa44a..8e1fb0c 100644 --- a/tests/DoctrineTest/InstantiatorTestAsset/ArrayObjectAsset.php +++ b/tests/DoctrineTest/InstantiatorTestAsset/ArrayObjectAsset.php @@ -7,6 +7,9 @@ /** * Test asset that extends an internal PHP class + * + * @template TValue + * @template-extends ArrayObject */ class ArrayObjectAsset extends ArrayObject { diff --git a/tests/DoctrineTest/InstantiatorTestAsset/SerializableArrayObjectAsset.php b/tests/DoctrineTest/InstantiatorTestAsset/SerializableArrayObjectAsset.php index 18d419f..edc0fbe 100644 --- a/tests/DoctrineTest/InstantiatorTestAsset/SerializableArrayObjectAsset.php +++ b/tests/DoctrineTest/InstantiatorTestAsset/SerializableArrayObjectAsset.php @@ -8,6 +8,9 @@ /** * Serializable test asset that also extends an internal class + * + * @template TValue + * @template-extends ArrayObject */ class SerializableArrayObjectAsset extends ArrayObject implements Serializable { diff --git a/tests/DoctrineTest/InstantiatorTestAsset/SerializableFinalInternalChildAsset.php b/tests/DoctrineTest/InstantiatorTestAsset/SerializableFinalInternalChildAsset.php index 0ef7452..d4631b3 100644 --- a/tests/DoctrineTest/InstantiatorTestAsset/SerializableFinalInternalChildAsset.php +++ b/tests/DoctrineTest/InstantiatorTestAsset/SerializableFinalInternalChildAsset.php @@ -5,6 +5,10 @@ use ArrayIterator; +/** + * @template TValue + * @template-extends ArrayIterator + */ final class SerializableFinalInternalChildAsset extends ArrayIterator { } diff --git a/tests/DoctrineTest/InstantiatorTestAsset/UnserializeExceptionArrayObjectAsset.php b/tests/DoctrineTest/InstantiatorTestAsset/UnserializeExceptionArrayObjectAsset.php index a6e2fd5..9d81534 100644 --- a/tests/DoctrineTest/InstantiatorTestAsset/UnserializeExceptionArrayObjectAsset.php +++ b/tests/DoctrineTest/InstantiatorTestAsset/UnserializeExceptionArrayObjectAsset.php @@ -7,6 +7,9 @@ /** * A simple asset for an abstract class + * + * @template TValue + * @template-extends ArrayObject */ class UnserializeExceptionArrayObjectAsset extends ArrayObject { diff --git a/tests/DoctrineTest/InstantiatorTestAsset/WakeUpNoticesAsset.php b/tests/DoctrineTest/InstantiatorTestAsset/WakeUpNoticesAsset.php index 51974c7..fef72b1 100644 --- a/tests/DoctrineTest/InstantiatorTestAsset/WakeUpNoticesAsset.php +++ b/tests/DoctrineTest/InstantiatorTestAsset/WakeUpNoticesAsset.php @@ -7,6 +7,9 @@ /** * A simple asset for an abstract class + * + * @template TValue + * @template-extends ArrayObject */ class WakeUpNoticesAsset extends ArrayObject {