diff --git a/composer.json b/composer.json index 4bc19f9..25eb8e6 100644 --- a/composer.json +++ b/composer.json @@ -7,8 +7,8 @@ }, "require-dev": { "phpunit/phpunit": "^7.0", - "phpstan/phpstan": "^0.9.2", - "phpstan/phpstan-phpunit": "^0.9.4" + "phpstan/phpstan": "^0.10", + "phpstan/phpstan-phpunit": "^0.10" }, "autoload": { "psr-4": { @@ -29,7 +29,7 @@ ], "scripts": { "tests": "phpunit", - "stan": "phpstan analyse -l max -c ./phpstan.neon ./src ./tests", + "stan": "phpstan analyse -l max -c ./phpstan.neon ./src", "check": [ "@tests", "@stan" diff --git a/composer.lock b/composer.lock index eec4f4f..76d4fe3 100644 --- a/composer.lock +++ b/composer.lock @@ -1,12 +1,56 @@ { "_readme": [ "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "f5dee83cb249ae75af88f4c9f88122e1", + "content-hash": "42591a1983b65ef415b10081c1831512", "packages": [], "packages-dev": [ + { + "name": "composer/xdebug-handler", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/composer/xdebug-handler.git", + "reference": "c919dc6c62e221fc6406f861ea13433c0aa24f08" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/c919dc6c62e221fc6406f861ea13433c0aa24f08", + "reference": "c919dc6c62e221fc6406f861ea13433c0aa24f08", + "shasum": "" + }, + "require": { + "php": "^5.3.2 || ^7.0", + "psr/log": "^1.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5" + }, + "type": "library", + "autoload": { + "psr-4": { + "Composer\\XdebugHandler\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "John Stevenson", + "email": "john-stevenson@blueyonder.co.uk" + } + ], + "description": "Restarts a process without xdebug.", + "keywords": [ + "Xdebug", + "performance" + ], + "time": "2018-04-11T15:42:36+00:00" + }, { "name": "doctrine/instantiator", "version": "1.1.0", @@ -63,16 +107,16 @@ }, { "name": "jean85/pretty-package-versions", - "version": "1.1", + "version": "1.2", "source": { "type": "git", "url": "https://github.com/Jean85/pretty-package-versions.git", - "reference": "d457344b6a035ef99236bdda4729ad7eeb233f54" + "reference": "75c7effcf3f77501d0e0caa75111aff4daa0dd48" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Jean85/pretty-package-versions/zipball/d457344b6a035ef99236bdda4729ad7eeb233f54", - "reference": "d457344b6a035ef99236bdda4729ad7eeb233f54", + "url": "https://api.github.com/repos/Jean85/pretty-package-versions/zipball/75c7effcf3f77501d0e0caa75111aff4daa0dd48", + "reference": "75c7effcf3f77501d0e0caa75111aff4daa0dd48", "shasum": "" }, "require": { @@ -103,14 +147,14 @@ "email": "alessandro.lai85@gmail.com" } ], - "description": "A wrapper for ocramius/pretty-package-versions to get pretty versions strings", + "description": "A wrapper for ocramius/package-versions to get pretty versions strings", "keywords": [ "composer", "package", "release", "versions" ], - "time": "2018-01-21T13:54:22+00:00" + "time": "2018-06-13T13:22:40+00:00" }, { "name": "myclabs/deep-copy", @@ -159,16 +203,16 @@ }, { "name": "nette/bootstrap", - "version": "v2.4.5", + "version": "v2.4.6", "source": { "type": "git", "url": "https://github.com/nette/bootstrap.git", - "reference": "804925787764d708a7782ea0d9382a310bb21968" + "reference": "268816e3f1bb7426c3a4ceec2bd38a036b532543" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nette/bootstrap/zipball/804925787764d708a7782ea0d9382a310bb21968", - "reference": "804925787764d708a7782ea0d9382a310bb21968", + "url": "https://api.github.com/repos/nette/bootstrap/zipball/268816e3f1bb7426c3a4ceec2bd38a036b532543", + "reference": "268816e3f1bb7426c3a4ceec2bd38a036b532543", "shasum": "" }, "require": { @@ -231,20 +275,20 @@ "configurator", "nette" ], - "time": "2017-08-20T17:36:59+00:00" + "time": "2018-05-17T12:52:20+00:00" }, { "name": "nette/di", - "version": "v2.4.10", + "version": "v2.4.13", "source": { "type": "git", "url": "https://github.com/nette/di.git", - "reference": "a4b3be935b755f23aebea1ce33d7e3c832cdff98" + "reference": "3f8f212b02d5c17feb97a7e0a39ab306f40c06ca" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nette/di/zipball/a4b3be935b755f23aebea1ce33d7e3c832cdff98", - "reference": "a4b3be935b755f23aebea1ce33d7e3c832cdff98", + "url": "https://api.github.com/repos/nette/di/zipball/3f8f212b02d5c17feb97a7e0a39ab306f40c06ca", + "reference": "3f8f212b02d5c17feb97a7e0a39ab306f40c06ca", "shasum": "" }, "require": { @@ -300,31 +344,31 @@ "nette", "static" ], - "time": "2017-08-31T22:42:00+00:00" + "time": "2018-06-11T08:46:01+00:00" }, { "name": "nette/finder", - "version": "v2.4.1", + "version": "v2.4.2", "source": { "type": "git", "url": "https://github.com/nette/finder.git", - "reference": "4d43a66d072c57d585bf08a3ef68d3587f7e9547" + "reference": "ee951a656cb8ac622e5dd33474a01fd2470505a0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nette/finder/zipball/4d43a66d072c57d585bf08a3ef68d3587f7e9547", - "reference": "4d43a66d072c57d585bf08a3ef68d3587f7e9547", + "url": "https://api.github.com/repos/nette/finder/zipball/ee951a656cb8ac622e5dd33474a01fd2470505a0", + "reference": "ee951a656cb8ac622e5dd33474a01fd2470505a0", "shasum": "" }, "require": { - "nette/utils": "^2.4 || ~3.0.0", + "nette/utils": "~2.4", "php": ">=5.6.0" }, "conflict": { "nette/nette": "<2.2" }, "require-dev": { - "nette/tester": "^2.0", + "nette/tester": "~2.0", "tracy/tracy": "^2.3" }, "type": "library", @@ -354,22 +398,28 @@ "homepage": "https://nette.org/contributors" } ], - "description": "Nette Finder: Files Searching", + "description": "🔍 Nette Finder: find files and directories with an intuitive API.", "homepage": "https://nette.org", - "time": "2017-07-10T23:47:08+00:00" + "keywords": [ + "filesystem", + "glob", + "iterator", + "nette" + ], + "time": "2018-06-28T11:49:23+00:00" }, { "name": "nette/neon", - "version": "v2.4.2", + "version": "v2.4.3", "source": { "type": "git", "url": "https://github.com/nette/neon.git", - "reference": "9eacd50553b26b53a3977bfb2fea2166d4331622" + "reference": "5e72b1dd3e2d34f0863c5561139a19df6a1ef398" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nette/neon/zipball/9eacd50553b26b53a3977bfb2fea2166d4331622", - "reference": "9eacd50553b26b53a3977bfb2fea2166d4331622", + "url": "https://api.github.com/repos/nette/neon/zipball/5e72b1dd3e2d34f0863c5561139a19df6a1ef398", + "reference": "5e72b1dd3e2d34f0863c5561139a19df6a1ef398", "shasum": "" }, "require": { @@ -408,22 +458,29 @@ "homepage": "https://nette.org/contributors" } ], - "description": "Nette NEON: parser & generator for Nette Object Notation", + "description": "🍸 Nette NEON: encodes and decodes NEON file format.", "homepage": "http://ne-on.org", - "time": "2017-07-11T18:29:08+00:00" + "keywords": [ + "export", + "import", + "neon", + "nette", + "yaml" + ], + "time": "2018-03-21T12:12:21+00:00" }, { "name": "nette/php-generator", - "version": "v3.0.2", + "version": "v3.0.4", "source": { "type": "git", "url": "https://github.com/nette/php-generator.git", - "reference": "1652635d312a8db4291b16f3ebf87cb1a15a6257" + "reference": "b381ecacbf5a0b5f99cc0b303d5b0578d409f446" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nette/php-generator/zipball/1652635d312a8db4291b16f3ebf87cb1a15a6257", - "reference": "1652635d312a8db4291b16f3ebf87cb1a15a6257", + "url": "https://api.github.com/repos/nette/php-generator/zipball/b381ecacbf5a0b5f99cc0b303d5b0578d409f446", + "reference": "b381ecacbf5a0b5f99cc0b303d5b0578d409f446", "shasum": "" }, "require": { @@ -472,20 +529,20 @@ "php", "scaffolding" ], - "time": "2017-09-26T11:19:32+00:00" + "time": "2018-04-26T16:48:20+00:00" }, { "name": "nette/robot-loader", - "version": "v3.0.3", + "version": "v3.0.4", "source": { "type": "git", "url": "https://github.com/nette/robot-loader.git", - "reference": "92d4b40b49d5e2d9e37fc736bbcebe6da55fa44a" + "reference": "3cf88781a05e0bf4618ae605361afcbaa4d5b392" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nette/robot-loader/zipball/92d4b40b49d5e2d9e37fc736bbcebe6da55fa44a", - "reference": "92d4b40b49d5e2d9e37fc736bbcebe6da55fa44a", + "url": "https://api.github.com/repos/nette/robot-loader/zipball/3cf88781a05e0bf4618ae605361afcbaa4d5b392", + "reference": "3cf88781a05e0bf4618ae605361afcbaa4d5b392", "shasum": "" }, "require": { @@ -537,20 +594,20 @@ "nette", "trait" ], - "time": "2017-09-26T13:42:21+00:00" + "time": "2018-06-22T09:34:04+00:00" }, { "name": "nette/utils", - "version": "v2.4.9", + "version": "v2.5.2", "source": { "type": "git", "url": "https://github.com/nette/utils.git", - "reference": "1e08eb4c9d26ae5aedced8260e8b4ed951ee4aa6" + "reference": "183069866dc477fcfbac393ed486aaa6d93d19a5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nette/utils/zipball/1e08eb4c9d26ae5aedced8260e8b4ed951ee4aa6", - "reference": "1e08eb4c9d26ae5aedced8260e8b4ed951ee4aa6", + "url": "https://api.github.com/repos/nette/utils/zipball/183069866dc477fcfbac393ed486aaa6d93d19a5", + "reference": "183069866dc477fcfbac393ed486aaa6d93d19a5", "shasum": "" }, "require": { @@ -574,12 +631,15 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.4-dev" + "dev-master": "2.5-dev" } }, "autoload": { "classmap": [ "src/" + ], + "files": [ + "src/loader.php" ] }, "notification-url": "https://packagist.org/downloads/", @@ -616,28 +676,28 @@ "utility", "validation" ], - "time": "2018-02-06T15:40:36+00:00" + "time": "2018-05-02T17:16:08+00:00" }, { "name": "nikic/php-parser", - "version": "v3.1.4", + "version": "v4.0.3", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "e57b3a09784f846411aa7ed664eedb73e3399078" + "reference": "bd088dc940a418f09cda079a9b5c7c478890fb8d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/e57b3a09784f846411aa7ed664eedb73e3399078", - "reference": "e57b3a09784f846411aa7ed664eedb73e3399078", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/bd088dc940a418f09cda079a9b5c7c478890fb8d", + "reference": "bd088dc940a418f09cda079a9b5c7c478890fb8d", "shasum": "" }, "require": { "ext-tokenizer": "*", - "php": ">=5.5" + "php": ">=7.0" }, "require-dev": { - "phpunit/phpunit": "~4.0|~5.0" + "phpunit/phpunit": "^6.5 || ^7.0" }, "bin": [ "bin/php-parse" @@ -645,7 +705,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-master": "4.0-dev" } }, "autoload": { @@ -667,7 +727,7 @@ "parser", "php" ], - "time": "2018-01-25T21:31:33+00:00" + "time": "2018-07-15T17:25:16+00:00" }, { "name": "ocramius/package-versions", @@ -1037,33 +1097,34 @@ }, { "name": "phpstan/phpdoc-parser", - "version": "0.2", + "version": "0.3", "source": { "type": "git", "url": "https://github.com/phpstan/phpdoc-parser.git", - "reference": "02f909f134fe06f0cd4790d8627ee24efbe84d6a" + "reference": "ed3223362174b8067729930439e139794e9e514a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/02f909f134fe06f0cd4790d8627ee24efbe84d6a", - "reference": "02f909f134fe06f0cd4790d8627ee24efbe84d6a", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/ed3223362174b8067729930439e139794e9e514a", + "reference": "ed3223362174b8067729930439e139794e9e514a", "shasum": "" }, "require": { - "php": "~7.0" + "php": "~7.1" }, "require-dev": { "consistence/coding-standard": "^2.0.0", "jakub-onderka/php-parallel-lint": "^0.9.2", "phing/phing": "^2.16.0", - "phpstan/phpstan": "^0.9", + "phpstan/phpstan": "^0.10@dev", "phpunit/phpunit": "^6.3", - "slevomat/coding-standard": "^3.3.0" + "slevomat/coding-standard": "^3.3.0", + "symfony/process": "^3.4 || ^4.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "0.1-dev" + "dev-master": "0.3-dev" } }, "autoload": { @@ -1078,46 +1139,51 @@ "MIT" ], "description": "PHPDoc parser with support for nullable, intersection and generic types", - "time": "2018-01-13T18:19:41+00:00" + "time": "2018-06-20T17:48:01+00:00" }, { "name": "phpstan/phpstan", - "version": "0.9.2", + "version": "0.10.1", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "e59541bcc7cac9b35ca54db6365bf377baf4a488" + "reference": "3179cf27542e9e47acb548150e7ca21ca5ab92d6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/e59541bcc7cac9b35ca54db6365bf377baf4a488", - "reference": "e59541bcc7cac9b35ca54db6365bf377baf4a488", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/3179cf27542e9e47acb548150e7ca21ca5ab92d6", + "reference": "3179cf27542e9e47acb548150e7ca21ca5ab92d6", "shasum": "" }, "require": { + "composer/xdebug-handler": "^1.0", "jean85/pretty-package-versions": "^1.0.3", "nette/bootstrap": "^2.4 || ^3.0", "nette/di": "^2.4.7 || ^3.0", "nette/robot-loader": "^3.0.1", "nette/utils": "^2.4.5 || ^3.0", - "nikic/php-parser": "^3.1", - "php": "~7.0", - "phpstan/phpdoc-parser": "^0.2", + "nikic/php-parser": "^4.0.2", + "php": "~7.1", + "phpstan/phpdoc-parser": "^0.3", "symfony/console": "~3.2 || ~4.0", "symfony/finder": "~3.2 || ~4.0" }, "require-dev": { - "consistence/coding-standard": "2.2.1", + "brianium/paratest": "^2.0", + "consistence/coding-standard": "^3.3", + "dealerdirect/phpcodesniffer-composer-installer": "^0.4.4", "ext-gd": "*", "ext-intl": "*", "ext-mysqli": "*", - "jakub-onderka/php-parallel-lint": "^0.9.2", + "ext-zip": "*", + "jakub-onderka/php-parallel-lint": "^1.0", "phing/phing": "^2.16.0", - "phpstan/phpstan-php-parser": "^0.9", - "phpstan/phpstan-phpunit": "^0.9.3", - "phpstan/phpstan-strict-rules": "^0.9", - "phpunit/phpunit": "^6.5.4", - "slevomat/coding-standard": "4.0.0" + "phpstan/phpstan-deprecation-rules": "^0.10.2", + "phpstan/phpstan-php-parser": "^0.10", + "phpstan/phpstan-phpunit": "^0.10", + "phpstan/phpstan-strict-rules": "^0.10", + "phpunit/phpunit": "^7.0", + "slevomat/coding-standard": "^4.6.2" }, "bin": [ "bin/phpstan" @@ -1125,7 +1191,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "0.9-dev" + "dev-master": "0.10-dev" } }, "autoload": { @@ -1141,39 +1207,44 @@ "MIT" ], "description": "PHPStan - PHP Static Analysis Tool", - "time": "2018-01-28T13:22:19+00:00" + "time": "2018-07-01T18:22:12+00:00" }, { "name": "phpstan/phpstan-phpunit", - "version": "0.9.4", + "version": "0.10", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan-phpunit.git", - "reference": "852411f841a37aeca2fa5af0002b0272c485c9bf" + "reference": "6feecc7faae187daa6be44140cd0f1ba210e6aa0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan-phpunit/zipball/852411f841a37aeca2fa5af0002b0272c485c9bf", - "reference": "852411f841a37aeca2fa5af0002b0272c485c9bf", + "url": "https://api.github.com/repos/phpstan/phpstan-phpunit/zipball/6feecc7faae187daa6be44140cd0f1ba210e6aa0", + "reference": "6feecc7faae187daa6be44140cd0f1ba210e6aa0", "shasum": "" }, "require": { - "php": "~7.0", - "phpstan/phpstan": "^0.9.1", - "phpunit/phpunit": "^6.3 || ~7.0" + "nikic/php-parser": "^4.0", + "php": "~7.1", + "phpstan/phpstan": "^0.10" + }, + "conflict": { + "phpunit/phpunit": "<7.0" }, "require-dev": { - "consistence/coding-standard": "^2.0", - "jakub-onderka/php-parallel-lint": "^0.9.2", + "consistence/coding-standard": "^3.0.1", + "dealerdirect/phpcodesniffer-composer-installer": "^0.4.4", + "jakub-onderka/php-parallel-lint": "^1.0", "phing/phing": "^2.16.0", - "phpstan/phpstan-strict-rules": "^0.9", + "phpstan/phpstan-strict-rules": "^0.10", + "phpunit/phpunit": "^7.0", "satooshi/php-coveralls": "^1.0", - "slevomat/coding-standard": "^3.3.0" + "slevomat/coding-standard": "^4.5.2" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "0.9-dev" + "dev-master": "0.10-dev" } }, "autoload": { @@ -1186,7 +1257,7 @@ "MIT" ], "description": "PHPUnit extensions and rules for PHPStan", - "time": "2018-02-02T09:45:47+00:00" + "time": "2018-06-22T18:12:17+00:00" }, { "name": "phpunit/php-code-coverage", @@ -1573,6 +1644,53 @@ ], "time": "2018-02-01T13:11:13+00:00" }, + { + "name": "psr/log", + "version": "1.0.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", + "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "Psr/Log/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "time": "2016-10-10T12:19:37+00:00" + }, { "name": "sebastian/code-unit-reverse-lookup", "version": "1.0.1", @@ -2138,16 +2256,16 @@ }, { "name": "symfony/console", - "version": "v4.0.4", + "version": "v4.1.1", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "36d5b41e7d4e1ccf0370f6babe966c08ef0a1488" + "reference": "70591cda56b4b47c55776ac78e157c4bb6c8b43f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/36d5b41e7d4e1ccf0370f6babe966c08ef0a1488", - "reference": "36d5b41e7d4e1ccf0370f6babe966c08ef0a1488", + "url": "https://api.github.com/repos/symfony/console/zipball/70591cda56b4b47c55776ac78e157c4bb6c8b43f", + "reference": "70591cda56b4b47c55776ac78e157c4bb6c8b43f", "shasum": "" }, "require": { @@ -2167,7 +2285,7 @@ "symfony/process": "~3.4|~4.0" }, "suggest": { - "psr/log": "For using the console logger", + "psr/log-implementation": "For using the console logger", "symfony/event-dispatcher": "", "symfony/lock": "", "symfony/process": "" @@ -2175,7 +2293,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-master": "4.1-dev" } }, "autoload": { @@ -2202,20 +2320,20 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2018-01-29T09:06:29+00:00" + "time": "2018-05-31T10:17:53+00:00" }, { "name": "symfony/finder", - "version": "v4.0.4", + "version": "v4.1.1", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "8b08180f2b7ccb41062366b9ad91fbc4f1af8601" + "reference": "84714b8417d19e4ba02ea78a41a975b3efaafddb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/8b08180f2b7ccb41062366b9ad91fbc4f1af8601", - "reference": "8b08180f2b7ccb41062366b9ad91fbc4f1af8601", + "url": "https://api.github.com/repos/symfony/finder/zipball/84714b8417d19e4ba02ea78a41a975b3efaafddb", + "reference": "84714b8417d19e4ba02ea78a41a975b3efaafddb", "shasum": "" }, "require": { @@ -2224,7 +2342,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-master": "4.1-dev" } }, "autoload": { @@ -2251,20 +2369,20 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2018-01-03T07:38:00+00:00" + "time": "2018-06-19T21:38:16+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.7.0", + "version": "v1.8.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "78be803ce01e55d3491c1397cf1c64beb9c1b63b" + "reference": "3296adf6a6454a050679cde90f95350ad604b171" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/78be803ce01e55d3491c1397cf1c64beb9c1b63b", - "reference": "78be803ce01e55d3491c1397cf1c64beb9c1b63b", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/3296adf6a6454a050679cde90f95350ad604b171", + "reference": "3296adf6a6454a050679cde90f95350ad604b171", "shasum": "" }, "require": { @@ -2276,7 +2394,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.7-dev" + "dev-master": "1.8-dev" } }, "autoload": { @@ -2310,7 +2428,7 @@ "portable", "shim" ], - "time": "2018-01-30T19:27:44+00:00" + "time": "2018-04-26T10:06:28+00:00" }, { "name": "theseer/tokenizer", diff --git a/extension.neon b/extension.neon index 98d90c6..9deb11a 100644 --- a/extension.neon +++ b/extension.neon @@ -2,6 +2,9 @@ services: - class: Proget\PHPStan\Yii2\Type\ContainerDynamicMethodReturnTypeExtension tags: [phpstan.broker.dynamicMethodReturnTypeExtension] + - + class: Proget\PHPStan\Yii2\Type\ActiveRecordDynamicStaticMethodReturnTypeExtension + tags: [phpstan.broker.dynamicStaticMethodReturnTypeExtension] - class: Proget\PHPStan\Yii2\Reflection\RequestMethodsClassReflectionExtension tags: [phpstan.broker.methodsClassReflectionExtension] diff --git a/src/Analyser/ScopeFactory.php b/src/Analyser/ScopeFactory.php new file mode 100644 index 0000000..06005fe --- /dev/null +++ b/src/Analyser/ScopeFactory.php @@ -0,0 +1,70 @@ +broker = $broker; + $this->printer = $printer; + } + + /** + * @param \PhpParser\Node\Expr\FuncCall|\PhpParser\Node\Expr\MethodCall|\PhpParser\Node\Expr\StaticCall|null $inFunctionCall + */ + public function create( + ScopeContext $context, + bool $declareStrictTypes = false, + $function = null, + ?string $namespace = null, + array $variablesTypes = [], + array $moreSpecificTypes = [], + ?string $inClosureBindScopeClass = null, + ?Type $inAnonymousFunctionReturnType = null, + ?Expr $inFunctionCall = null, + bool $negated = false, + bool $inFirstLevelStatement = true, + array $currentlyAssignedExpressions = [] + ): Scope { + return new Scope( + $this, + $this->broker, + $this->printer, + new TypeSpecifier($this->printer, $this->broker, [], [], []), + $context, + $declareStrictTypes, + $function, + $namespace, + $variablesTypes, + $moreSpecificTypes, + $inClosureBindScopeClass, + $inAnonymousFunctionReturnType, + $inFunctionCall, + $negated, + $inFirstLevelStatement, + $currentlyAssignedExpressions + ); + } +} diff --git a/src/Reflection/RequestMethodsClassReflectionExtension.php b/src/Reflection/RequestMethodsClassReflectionExtension.php index 101d722..ff062d4 100644 --- a/src/Reflection/RequestMethodsClassReflectionExtension.php +++ b/src/Reflection/RequestMethodsClassReflectionExtension.php @@ -1,11 +1,9 @@ broker = $broker; } @@ -41,5 +39,4 @@ public function getMethod(ClassReflection $classReflection, string $methodName): return $webRequest->getNativeMethod($methodName); } - -} \ No newline at end of file +} diff --git a/src/Reflection/RequestPropertiesClassReflectionExtension.php b/src/Reflection/RequestPropertiesClassReflectionExtension.php index 1c737c7..f44dcd3 100644 --- a/src/Reflection/RequestPropertiesClassReflectionExtension.php +++ b/src/Reflection/RequestPropertiesClassReflectionExtension.php @@ -1,18 +1,18 @@ broker = $broker; + $this->scopeFactory = new ProgetScopeFactory($broker, new Standard()); } public function hasProperty(ClassReflection $classReflection, string $propertyName): bool @@ -41,14 +47,9 @@ public function getProperty(ClassReflection $classReflection, string $propertyNa { $webRequest = $this->broker->getClass('yii\web\Request'); - $printer = new Standard(); - - return $webRequest->getProperty($propertyName, new Scope( - $this->broker, - $printer, - new TypeSpecifier($printer), - (string) $classReflection->getFileName() - )); + return $webRequest->getProperty( + $propertyName, + $this->scopeFactory->create(ScopeContext::create((string) $classReflection->getFileName())) + ); } - -} \ No newline at end of file +} diff --git a/src/ServiceMap.php b/src/ServiceMap.php index 565052d..a3cf03c 100644 --- a/src/ServiceMap.php +++ b/src/ServiceMap.php @@ -1,10 +1,9 @@ $service) { - if(is_callable($service)) { - $reflection = new \ReflectionFunction($service); - if(!$reflection->hasReturnType()) { + if($service instanceof \Closure || \is_string($service)) { + $returnType = (new \ReflectionFunction($service))->getReturnType(); + if(!$returnType instanceof \ReflectionType) { throw new \RuntimeException(sprintf('Please provide return type for %s service closure', $id)); } - $this->services[$id] = $reflection->getReturnType()->getName(); + + $this->services[$id] = $returnType->getName(); } else { $this->services[$id] = $service['class'] ?? $service[0]['class']; } diff --git a/src/Type/ActiveRecordDynamicStaticMethodReturnTypeExtension.php b/src/Type/ActiveRecordDynamicStaticMethodReturnTypeExtension.php new file mode 100644 index 0000000..a30d621 --- /dev/null +++ b/src/Type/ActiveRecordDynamicStaticMethodReturnTypeExtension.php @@ -0,0 +1,38 @@ +getName() === 'findOne'; + } + + public function getTypeFromStaticMethodCall(MethodReflection $methodReflection, StaticCall $methodCall, Scope $scope): Type + { + /** @var Name $name */ + $name = $methodCall->class; + + return TypeCombinator::union( + new NullType(), new ObjectType($name->toString()) + ); + } +} diff --git a/src/Type/ContainerDynamicMethodReturnTypeExtension.php b/src/Type/ContainerDynamicMethodReturnTypeExtension.php index fa36b28..97ca42a 100644 --- a/src/Type/ContainerDynamicMethodReturnTypeExtension.php +++ b/src/Type/ContainerDynamicMethodReturnTypeExtension.php @@ -1,14 +1,14 @@ getReturnType(); + return ParametersAcceptorSelector::selectSingle($methodReflection->getVariants())->getReturnType(); } - -} \ No newline at end of file +}