diff --git a/CHANGELOG.md b/CHANGELOG.md index 40ad26a67..6fdfaf6e0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## mm/dd/2020 1. [](#new) + * Update phpstan to version 0.12 * Auto-Escape enabled by default. Manually enable **Twig Compatibility** and disable **Auto-Escape** to use the old setting. * Updated unit tests to use codeception 4.1 * Added support for setting `GRAV_ENVIRONMENT` by using environment variable or a constant diff --git a/UPGRADE-1.7.md b/UPGRADE-1.7.md index 6bdd14635..3c1ab6bec 100644 --- a/UPGRADE-1.7.md +++ b/UPGRADE-1.7.md @@ -230,6 +230,7 @@ Grav 1.7 REQUIRES PHP 7.3.6 * **DEPRECATED** `FlexDirectory::update()` and `FlexDirectory::remove()` * **BC BREAK** Moved all Flex type classes under `Grav\Common\Flex` * **BC BREAK** `FlexStorageInterface::getStoragePath()` and `getMediaPath()` can now return null +* **BC BREAK** `FlexStorageIngerface::getMetaData()` now has second optional argument * **BC BREAK** Flex objects no longer return temporary key if they do not have one; empty key is returned instead * **BC BREAK** Added reload argument to `FlexStorageInterface::getMetaData()` * You can add `edit_list.html.twig` file to a form field in order to customize look in the listing view diff --git a/composer.json b/composer.json index 62c10abe8..f063f09d0 100644 --- a/composer.json +++ b/composer.json @@ -62,8 +62,8 @@ }, "require-dev": { "codeception/codeception": "^4.1", - "phpstan/phpstan": "^0.11", - "phpstan/phpstan-deprecation-rules": "^0.11", + "phpstan/phpstan": "^0.12", + "phpstan/phpstan-deprecation-rules": "^0.12", "phpunit/php-code-coverage": "~9.2", "fzaninotto/faker": "^1.9", "victorjonsson/markdowndocs": "dev-master", @@ -113,11 +113,9 @@ }, "scripts": { "api-17": "vendor/bin/phpdoc-md generate system/src > user/pages/14.api/default.17.md", - "api-16": "vendor/bin/phpdoc-md generate system/src > user/pages/14.api/default.16.md", - "api-15": "vendor/bin/phpdoc-md generate system/src > user/pages/14.api/default.md", "post-create-project-cmd": "bin/grav install", - "phpstan": "vendor/bin/phpstan analyse -l 3 -c ./tests/phpstan/phpstan.neon --memory-limit=400M system/src", - "phpstan-framework": "vendor/bin/phpstan analyse -l 7 -c ./tests/phpstan/phpstan.neon --memory-limit=256M system/src/Grav/Framework", + "phpstan": "vendor/bin/phpstan analyse -l 3 -c ./tests/phpstan/phpstan.neon --memory-limit=480M system/src", + "phpstan-framework": "vendor/bin/phpstan analyse -l 8 -c ./tests/phpstan/phpstan.neon --memory-limit=480M system/src/Grav/Framework system/src/Grav/Events system/src/Grav/Installer system/src/Grav/Common/Assets system/src/Grav/Common/Backup system/src/Grav/Common/Config system/src/Grav/Common/Data system/src/Grav/Common/Errors system/src/Grav/Common/File system/src/Grav/Common/Helpers system/src/Grav/Common/Language system/src/Grav/Common/Markdown system/src/Grav/Common/Form system/src/Grav/Common/User", "phpstan-plugins": "vendor/bin/phpstan analyse -l 1 -c ./tests/phpstan/plugins.neon --memory-limit=400M user/plugins", "test": "vendor/bin/codecept run unit", "test-windows": "vendor\\bin\\codecept run unit" diff --git a/composer.lock b/composer.lock index 67c8dd737..13657334a 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": "bc99b3b861eea5ff536cbf20afd688cf", + "content-hash": "be29d6883e03f450ef32eadf454dfc74", "packages": [ { "name": "antoligy/dom-string-iterators", @@ -1109,25 +1109,25 @@ }, { "name": "maximebf/debugbar", - "version": "v1.16.3", + "version": "v1.16.4", "source": { "type": "git", "url": "https://github.com/maximebf/php-debugbar.git", - "reference": "1a1605b8e9bacb34cc0c6278206d699772e1d372" + "reference": "c86c717e4bf3c6d98422da5c38bfa7b0f494b04c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/maximebf/php-debugbar/zipball/1a1605b8e9bacb34cc0c6278206d699772e1d372", - "reference": "1a1605b8e9bacb34cc0c6278206d699772e1d372", + "url": "https://api.github.com/repos/maximebf/php-debugbar/zipball/c86c717e4bf3c6d98422da5c38bfa7b0f494b04c", + "reference": "c86c717e4bf3c6d98422da5c38bfa7b0f494b04c", "shasum": "" }, "require": { - "php": "^7.1", + "php": "^7.1|^8", "psr/log": "^1.0", "symfony/var-dumper": "^2.6|^3|^4|^5" }, "require-dev": { - "phpunit/phpunit": "^5" + "phpunit/phpunit": "^7.5.20 || ^9.4.2" }, "suggest": { "kriswallsmith/assetic": "The best way to manage assets", @@ -1168,9 +1168,9 @@ ], "support": { "issues": "https://github.com/maximebf/php-debugbar/issues", - "source": "https://github.com/maximebf/php-debugbar/tree/v1.16.3" + "source": "https://github.com/maximebf/php-debugbar/tree/v1.16.4" }, - "time": "2020-05-06T07:06:27+00:00" + "time": "2020-12-07T10:48:48+00:00" }, { "name": "miljar/php-exif", @@ -3748,142 +3748,6 @@ }, "time": "2020-07-03T15:54:43+00:00" }, - { - "name": "composer/package-versions-deprecated", - "version": "1.11.99.1", - "source": { - "type": "git", - "url": "https://github.com/composer/package-versions-deprecated.git", - "reference": "7413f0b55a051e89485c5cb9f765fe24bb02a7b6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/package-versions-deprecated/zipball/7413f0b55a051e89485c5cb9f765fe24bb02a7b6", - "reference": "7413f0b55a051e89485c5cb9f765fe24bb02a7b6", - "shasum": "" - }, - "require": { - "composer-plugin-api": "^1.1.0 || ^2.0", - "php": "^7 || ^8" - }, - "replace": { - "ocramius/package-versions": "1.11.99" - }, - "require-dev": { - "composer/composer": "^1.9.3 || ^2.0@dev", - "ext-zip": "^1.13", - "phpunit/phpunit": "^6.5 || ^7" - }, - "type": "composer-plugin", - "extra": { - "class": "PackageVersions\\Installer", - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "PackageVersions\\": "src/PackageVersions" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com" - }, - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be" - } - ], - "description": "Composer plugin that provides efficient querying for installed package versions (no runtime IO)", - "support": { - "issues": "https://github.com/composer/package-versions-deprecated/issues", - "source": "https://github.com/composer/package-versions-deprecated/tree/1.11.99.1" - }, - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://github.com/composer", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" - } - ], - "time": "2020-11-11T10:22:58+00:00" - }, - { - "name": "composer/xdebug-handler", - "version": "1.4.5", - "source": { - "type": "git", - "url": "https://github.com/composer/xdebug-handler.git", - "reference": "f28d44c286812c714741478d968104c5e604a1d4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/f28d44c286812c714741478d968104c5e604a1d4", - "reference": "f28d44c286812c714741478d968104c5e604a1d4", - "shasum": "" - }, - "require": { - "php": "^5.3.2 || ^7.0 || ^8.0", - "psr/log": "^1.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || 6.5 - 8" - }, - "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" - ], - "support": { - "irc": "irc://irc.freenode.org/composer", - "issues": "https://github.com/composer/xdebug-handler/issues", - "source": "https://github.com/composer/xdebug-handler/tree/1.4.5" - }, - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://github.com/composer", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" - } - ], - "time": "2020-11-13T08:04:11+00:00" - }, { "name": "doctrine/instantiator", "version": "1.4.0", @@ -4008,61 +3872,6 @@ "abandoned": true, "time": "2019-12-12T13:22:17+00:00" }, - { - "name": "jean85/pretty-package-versions", - "version": "1.5.1", - "source": { - "type": "git", - "url": "https://github.com/Jean85/pretty-package-versions.git", - "reference": "a917488320c20057da87f67d0d40543dd9427f7a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Jean85/pretty-package-versions/zipball/a917488320c20057da87f67d0d40543dd9427f7a", - "reference": "a917488320c20057da87f67d0d40543dd9427f7a", - "shasum": "" - }, - "require": { - "composer/package-versions-deprecated": "^1.8.0", - "php": "^7.0|^8.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.0|^8.5|^9.2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Jean85\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Alessandro Lai", - "email": "alessandro.lai85@gmail.com" - } - ], - "description": "A wrapper for ocramius/package-versions to get pretty versions strings", - "keywords": [ - "composer", - "package", - "release", - "versions" - ], - "support": { - "issues": "https://github.com/Jean85/pretty-package-versions/issues", - "source": "https://github.com/Jean85/pretty-package-versions/tree/1.5.1" - }, - "time": "2020-09-14T08:43:34+00:00" - }, { "name": "myclabs/deep-copy", "version": "1.10.2", @@ -4121,577 +3930,6 @@ ], "time": "2020-11-13T09:40:50+00:00" }, - { - "name": "nette/bootstrap", - "version": "v3.0.2", - "source": { - "type": "git", - "url": "https://github.com/nette/bootstrap.git", - "reference": "67830a65b42abfb906f8e371512d336ebfb5da93" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/bootstrap/zipball/67830a65b42abfb906f8e371512d336ebfb5da93", - "reference": "67830a65b42abfb906f8e371512d336ebfb5da93", - "shasum": "" - }, - "require": { - "nette/di": "^3.0", - "nette/utils": "^3.0", - "php": ">=7.1" - }, - "conflict": { - "tracy/tracy": "<2.6" - }, - "require-dev": { - "latte/latte": "^2.2", - "nette/application": "^3.0", - "nette/caching": "^3.0", - "nette/database": "^3.0", - "nette/forms": "^3.0", - "nette/http": "^3.0", - "nette/mail": "^3.0", - "nette/robot-loader": "^3.0", - "nette/safe-stream": "^2.2", - "nette/security": "^3.0", - "nette/tester": "^2.0", - "phpstan/phpstan-nette": "^0.12", - "tracy/tracy": "^2.6" - }, - "suggest": { - "nette/robot-loader": "to use Configurator::createRobotLoader()", - "tracy/tracy": "to use Configurator::enableTracy()" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0-only", - "GPL-3.0-only" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "https://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "https://nette.org/contributors" - } - ], - "description": "🅱 Nette Bootstrap: the simple way to configure and bootstrap your Nette application.", - "homepage": "https://nette.org", - "keywords": [ - "bootstrapping", - "configurator", - "nette" - ], - "support": { - "issues": "https://github.com/nette/bootstrap/issues", - "source": "https://github.com/nette/bootstrap/tree/master" - }, - "time": "2020-05-26T08:46:23+00:00" - }, - { - "name": "nette/di", - "version": "v3.0.6", - "source": { - "type": "git", - "url": "https://github.com/nette/di.git", - "reference": "e639ccfbc0230e022ca08bf59c6b07df7caf2007" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/di/zipball/e639ccfbc0230e022ca08bf59c6b07df7caf2007", - "reference": "e639ccfbc0230e022ca08bf59c6b07df7caf2007", - "shasum": "" - }, - "require": { - "ext-tokenizer": "*", - "nette/neon": "^3.0", - "nette/php-generator": "^3.3.3", - "nette/robot-loader": "^3.2", - "nette/schema": "^1.0", - "nette/utils": "^3.1.4", - "php": ">=7.1 <8.1" - }, - "conflict": { - "nette/bootstrap": "<3.0" - }, - "require-dev": { - "nette/tester": "^2.2", - "phpstan/phpstan": "^0.12", - "tracy/tracy": "^2.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0-only", - "GPL-3.0-only" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "https://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "https://nette.org/contributors" - } - ], - "description": "💎 Nette Dependency Injection Container: Flexible, compiled and full-featured DIC with perfectly usable autowiring and support for all new PHP 7.1 features.", - "homepage": "https://nette.org", - "keywords": [ - "compiled", - "di", - "dic", - "factory", - "ioc", - "nette", - "static" - ], - "support": { - "issues": "https://github.com/nette/di/issues", - "source": "https://github.com/nette/di/tree/v3.0.6" - }, - "time": "2020-11-25T22:42:55+00:00" - }, - { - "name": "nette/finder", - "version": "v2.5.2", - "source": { - "type": "git", - "url": "https://github.com/nette/finder.git", - "reference": "4ad2c298eb8c687dd0e74ae84206a4186eeaed50" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/finder/zipball/4ad2c298eb8c687dd0e74ae84206a4186eeaed50", - "reference": "4ad2c298eb8c687dd0e74ae84206a4186eeaed50", - "shasum": "" - }, - "require": { - "nette/utils": "^2.4 || ^3.0", - "php": ">=7.1" - }, - "conflict": { - "nette/nette": "<2.2" - }, - "require-dev": { - "nette/tester": "^2.0", - "phpstan/phpstan": "^0.12", - "tracy/tracy": "^2.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.5-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0", - "GPL-3.0" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "https://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "https://nette.org/contributors" - } - ], - "description": "🔍 Nette Finder: find files and directories with an intuitive API.", - "homepage": "https://nette.org", - "keywords": [ - "filesystem", - "glob", - "iterator", - "nette" - ], - "support": { - "issues": "https://github.com/nette/finder/issues", - "source": "https://github.com/nette/finder/tree/v2.5.2" - }, - "time": "2020-01-03T20:35:40+00:00" - }, - { - "name": "nette/neon", - "version": "v3.2.1", - "source": { - "type": "git", - "url": "https://github.com/nette/neon.git", - "reference": "a5b3a60833d2ef55283a82d0c30b45d136b29e75" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/neon/zipball/a5b3a60833d2ef55283a82d0c30b45d136b29e75", - "reference": "a5b3a60833d2ef55283a82d0c30b45d136b29e75", - "shasum": "" - }, - "require": { - "ext-iconv": "*", - "ext-json": "*", - "php": ">=7.1" - }, - "require-dev": { - "nette/tester": "^2.0", - "phpstan/phpstan": "^0.12", - "tracy/tracy": "^2.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.2-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0-only", - "GPL-3.0-only" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "https://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "https://nette.org/contributors" - } - ], - "description": "🍸 Nette NEON: encodes and decodes NEON file format.", - "homepage": "https://ne-on.org", - "keywords": [ - "export", - "import", - "neon", - "nette", - "yaml" - ], - "support": { - "issues": "https://github.com/nette/neon/issues", - "source": "https://github.com/nette/neon/tree/master" - }, - "time": "2020-07-31T12:28:05+00:00" - }, - { - "name": "nette/php-generator", - "version": "v3.5.1", - "source": { - "type": "git", - "url": "https://github.com/nette/php-generator.git", - "reference": "fe54415cd22d01bee1307a608058bf131978610a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/php-generator/zipball/fe54415cd22d01bee1307a608058bf131978610a", - "reference": "fe54415cd22d01bee1307a608058bf131978610a", - "shasum": "" - }, - "require": { - "nette/utils": "^3.1.2", - "php": ">=7.1" - }, - "require-dev": { - "nette/tester": "^2.0", - "nikic/php-parser": "^4.4", - "phpstan/phpstan": "^0.12", - "tracy/tracy": "^2.3" - }, - "suggest": { - "nikic/php-parser": "to use ClassType::withBodiesFrom() & GlobalFunction::withBodyFrom()" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.5-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0-only", - "GPL-3.0-only" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "https://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "https://nette.org/contributors" - } - ], - "description": "🐘 Nette PHP Generator: generates neat PHP code for you. Supports new PHP 7.4 features.", - "homepage": "https://nette.org", - "keywords": [ - "code", - "nette", - "php", - "scaffolding" - ], - "support": { - "issues": "https://github.com/nette/php-generator/issues", - "source": "https://github.com/nette/php-generator/tree/v3.5.1" - }, - "time": "2020-11-04T11:26:26+00:00" - }, - { - "name": "nette/robot-loader", - "version": "v3.3.1", - "source": { - "type": "git", - "url": "https://github.com/nette/robot-loader.git", - "reference": "15c1ecd0e6e69e8d908dfc4cca7b14f3b850a96b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/robot-loader/zipball/15c1ecd0e6e69e8d908dfc4cca7b14f3b850a96b", - "reference": "15c1ecd0e6e69e8d908dfc4cca7b14f3b850a96b", - "shasum": "" - }, - "require": { - "ext-tokenizer": "*", - "nette/finder": "^2.5 || ^3.0", - "nette/utils": "^3.0", - "php": ">=7.1" - }, - "require-dev": { - "nette/tester": "^2.0", - "phpstan/phpstan": "^0.12", - "tracy/tracy": "^2.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.3-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0-only", - "GPL-3.0-only" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "https://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "https://nette.org/contributors" - } - ], - "description": "🍀 Nette RobotLoader: high performance and comfortable autoloader that will search and autoload classes within your application.", - "homepage": "https://nette.org", - "keywords": [ - "autoload", - "class", - "interface", - "nette", - "trait" - ], - "support": { - "issues": "https://github.com/nette/robot-loader/issues", - "source": "https://github.com/nette/robot-loader/tree/v3.3.1" - }, - "time": "2020-09-15T15:14:17+00:00" - }, - { - "name": "nette/schema", - "version": "v1.0.3", - "source": { - "type": "git", - "url": "https://github.com/nette/schema.git", - "reference": "34baf9eca75eccdad3d04306c5d6bec0f6b252ad" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/schema/zipball/34baf9eca75eccdad3d04306c5d6bec0f6b252ad", - "reference": "34baf9eca75eccdad3d04306c5d6bec0f6b252ad", - "shasum": "" - }, - "require": { - "nette/utils": "^3.1.4", - "php": ">=7.1 <8.1" - }, - "require-dev": { - "nette/tester": "^2.2", - "phpstan/phpstan-nette": "^0.12", - "tracy/tracy": "^2.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0-only", - "GPL-3.0-only" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "https://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "https://nette.org/contributors" - } - ], - "description": "📐 Nette Schema: validating data structures against a given Schema.", - "homepage": "https://nette.org", - "keywords": [ - "config", - "nette" - ], - "support": { - "issues": "https://github.com/nette/schema/issues", - "source": "https://github.com/nette/schema/tree/v1.0.3" - }, - "time": "2020-11-25T21:54:59+00:00" - }, - { - "name": "nette/utils", - "version": "v3.2.0", - "source": { - "type": "git", - "url": "https://github.com/nette/utils.git", - "reference": "d0427c1811462dbb6c503143eabe5478b26685f7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/utils/zipball/d0427c1811462dbb6c503143eabe5478b26685f7", - "reference": "d0427c1811462dbb6c503143eabe5478b26685f7", - "shasum": "" - }, - "require": { - "php": ">=7.2 <8.1" - }, - "conflict": { - "nette/di": "<3.0.6" - }, - "require-dev": { - "nette/tester": "~2.0", - "phpstan/phpstan": "^0.12", - "tracy/tracy": "^2.3" - }, - "suggest": { - "ext-gd": "to use Image", - "ext-iconv": "to use Strings::webalize(), toAscii(), chr() and reverse()", - "ext-intl": "to use Strings::webalize(), toAscii(), normalize() and compare()", - "ext-json": "to use Nette\\Utils\\Json", - "ext-mbstring": "to use Strings::lower() etc...", - "ext-tokenizer": "to use Nette\\Utils\\Reflection::getUseStatements()", - "ext-xml": "to use Strings::length() etc. when mbstring is not available" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.2-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0-only", - "GPL-3.0-only" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "https://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "https://nette.org/contributors" - } - ], - "description": "🛠 Nette Utils: lightweight utilities for string & array manipulation, image handling, safe JSON encoding/decoding, validation, slug or strong password generating etc.", - "homepage": "https://nette.org", - "keywords": [ - "array", - "core", - "datetime", - "images", - "json", - "nette", - "paginator", - "password", - "slugify", - "string", - "unicode", - "utf-8", - "utility", - "validation" - ], - "support": { - "issues": "https://github.com/nette/utils/issues", - "source": "https://github.com/nette/utils/tree/v3.2.0" - }, - "time": "2020-11-25T23:47:50+00:00" - }, { "name": "nikic/php-parser", "version": "v4.10.3", @@ -4914,28 +4152,27 @@ }, { "name": "phpdocumentor/reflection-docblock", - "version": "5.1.0", + "version": "5.2.2", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "cd72d394ca794d3466a3b2fc09d5a6c1dc86b47e" + "reference": "069a785b2141f5bcf49f3e353548dc1cce6df556" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/cd72d394ca794d3466a3b2fc09d5a6c1dc86b47e", - "reference": "cd72d394ca794d3466a3b2fc09d5a6c1dc86b47e", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/069a785b2141f5bcf49f3e353548dc1cce6df556", + "reference": "069a785b2141f5bcf49f3e353548dc1cce6df556", "shasum": "" }, "require": { - "ext-filter": "^7.1", - "php": "^7.2", - "phpdocumentor/reflection-common": "^2.0", - "phpdocumentor/type-resolver": "^1.0", - "webmozart/assert": "^1" + "ext-filter": "*", + "php": "^7.2 || ^8.0", + "phpdocumentor/reflection-common": "^2.2", + "phpdocumentor/type-resolver": "^1.3", + "webmozart/assert": "^1.9.1" }, "require-dev": { - "doctrine/instantiator": "^1", - "mockery/mockery": "^1" + "mockery/mockery": "~1.3.2" }, "type": "library", "extra": { @@ -4965,9 +4202,9 @@ "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", "support": { "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", - "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.1.0" + "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/master" }, - "time": "2020-02-22T12:28:44+00:00" + "time": "2020-09-03T19:13:55+00:00" }, { "name": "phpdocumentor/type-resolver", @@ -5020,28 +4257,28 @@ }, { "name": "phpspec/prophecy", - "version": "1.11.1", + "version": "1.12.1", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "b20034be5efcdab4fb60ca3a29cba2949aead160" + "reference": "8ce87516be71aae9b956f81906aaf0338e0d8a2d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/b20034be5efcdab4fb60ca3a29cba2949aead160", - "reference": "b20034be5efcdab4fb60ca3a29cba2949aead160", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/8ce87516be71aae9b956f81906aaf0338e0d8a2d", + "reference": "8ce87516be71aae9b956f81906aaf0338e0d8a2d", "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 <9.3" }, "type": "library", "extra": { @@ -5081,128 +4318,44 @@ ], "support": { "issues": "https://github.com/phpspec/prophecy/issues", - "source": "https://github.com/phpspec/prophecy/tree/master" + "source": "https://github.com/phpspec/prophecy/tree/1.12.1" }, - "time": "2020-07-08T12:44:21+00:00" - }, - { - "name": "phpstan/phpdoc-parser", - "version": "0.3.5", - "source": { - "type": "git", - "url": "https://github.com/phpstan/phpdoc-parser.git", - "reference": "8c4ef2aefd9788238897b678a985e1d5c8df6db4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/8c4ef2aefd9788238897b678a985e1d5c8df6db4", - "reference": "8c4ef2aefd9788238897b678a985e1d5c8df6db4", - "shasum": "" - }, - "require": { - "php": "~7.1" - }, - "require-dev": { - "consistence/coding-standard": "^3.5", - "jakub-onderka/php-parallel-lint": "^0.9.2", - "phing/phing": "^2.16.0", - "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": "library", - "extra": { - "branch-alias": { - "dev-master": "0.3-dev" - } - }, - "autoload": { - "psr-4": { - "PHPStan\\PhpDocParser\\": [ - "src/" - ] - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "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" + "time": "2020-09-29T09:10:42+00:00" }, { "name": "phpstan/phpstan", - "version": "0.11.20", + "version": "0.12.59", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "938dcc03a005280e1a9587ec7684345bff06ebfc" + "reference": "cf4107257c8ca2ad967efdd6a00f12b21acbb779" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/938dcc03a005280e1a9587ec7684345bff06ebfc", - "reference": "938dcc03a005280e1a9587ec7684345bff06ebfc", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/cf4107257c8ca2ad967efdd6a00f12b21acbb779", + "reference": "cf4107257c8ca2ad967efdd6a00f12b21acbb779", "shasum": "" }, "require": { - "composer/xdebug-handler": "^1.3.0", - "jean85/pretty-package-versions": "^1.0.3", - "nette/bootstrap": "^2.4 || ^3.0", - "nette/di": "^2.4.7 || ^3.0", - "nette/neon": "^2.4.3 || ^3.0", - "nette/robot-loader": "^3.0.1", - "nette/schema": "^1.0", - "nette/utils": "^2.4.5 || ^3.0", - "nikic/php-parser": "^4.2.3", - "php": "~7.1", - "phpstan/phpdoc-parser": "^0.3.5", - "symfony/console": "~3.2 || ~4.0", - "symfony/finder": "~3.2 || ~4.0" + "php": "^7.1|^8.0" }, "conflict": { - "symfony/console": "3.4.16 || 4.1.5" - }, - "require-dev": { - "brianium/paratest": "^2.0 || ^3.0", - "consistence/coding-standard": "^3.5", - "dealerdirect/phpcodesniffer-composer-installer": "^0.4.4", - "ext-intl": "*", - "ext-mysqli": "*", - "ext-simplexml": "*", - "ext-soap": "*", - "ext-zip": "*", - "jakub-onderka/php-parallel-lint": "^1.0", - "localheinz/composer-normalize": "^1.1.0", - "phing/phing": "^2.16.0", - "phpstan/phpstan-deprecation-rules": "^0.11", - "phpstan/phpstan-php-parser": "^0.11", - "phpstan/phpstan-phpunit": "^0.11", - "phpstan/phpstan-strict-rules": "^0.11", - "phpunit/phpunit": "^7.5.14 || ^8.0", - "slevomat/coding-standard": "^4.7.2", - "squizlabs/php_codesniffer": "^3.3.2" + "phpstan/phpstan-shim": "*" }, "bin": [ - "bin/phpstan" + "phpstan", + "phpstan.phar" ], "type": "library", "extra": { "branch-alias": { - "dev-master": "0.11-dev" + "dev-master": "0.12-dev" } }, "autoload": { - "psr-4": { - "PHPStan\\": [ - "src/" - ] - } + "files": [ + "bootstrap.php" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -5211,7 +4364,7 @@ "description": "PHPStan - PHP Static Analysis Tool", "support": { "issues": "https://github.com/phpstan/phpstan/issues", - "source": "https://github.com/phpstan/phpstan/tree/0.11.20" + "source": "https://github.com/phpstan/phpstan/tree/0.12.59" }, "funding": [ { @@ -5227,40 +4380,40 @@ "type": "tidelift" } ], - "time": "2020-10-12T14:33:05+00:00" + "time": "2020-12-07T14:46:03+00:00" }, { "name": "phpstan/phpstan-deprecation-rules", - "version": "0.11.2", + "version": "0.12.5", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan-deprecation-rules.git", - "reference": "5685fe48873efc5af1f2cc95d9c1b8ae82c728fe" + "reference": "bfabc6a1b4617fbcbff43f03a4c04eae9bafae21" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan-deprecation-rules/zipball/5685fe48873efc5af1f2cc95d9c1b8ae82c728fe", - "reference": "5685fe48873efc5af1f2cc95d9c1b8ae82c728fe", + "url": "https://api.github.com/repos/phpstan/phpstan-deprecation-rules/zipball/bfabc6a1b4617fbcbff43f03a4c04eae9bafae21", + "reference": "bfabc6a1b4617fbcbff43f03a4c04eae9bafae21", "shasum": "" }, "require": { - "nikic/php-parser": "^4.0", - "php": "~7.1", - "phpstan/phpstan": "^0.11.8" + "php": "^7.1 || ^8.0", + "phpstan/phpstan": "^0.12.26" }, "require-dev": { "consistence/coding-standard": "^3.0.1", - "dealerdirect/phpcodesniffer-composer-installer": "^0.4.4", + "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-phpunit": "^0.11", + "phpstan/phpstan-phpunit": "^0.12", "phpunit/phpunit": "^7.0", "slevomat/coding-standard": "^4.5.2" }, "type": "phpstan-extension", "extra": { "branch-alias": { - "dev-master": "0.11-dev" + "dev-master": "0.12-dev" }, "phpstan": { "includes": [ @@ -5280,9 +4433,9 @@ "description": "PHPStan rules for detecting usage of deprecated classes, methods, properties, constants and traits.", "support": { "issues": "https://github.com/phpstan/phpstan-deprecation-rules/issues", - "source": "https://github.com/phpstan/phpstan-deprecation-rules/tree/0.11.2" + "source": "https://github.com/phpstan/phpstan-deprecation-rules/tree/0.12.5" }, - "time": "2019-05-28T19:54:04+00:00" + "time": "2020-07-21T14:52:30+00:00" }, { "name": "phpunit/php-code-coverage", @@ -5604,16 +4757,16 @@ }, { "name": "phpunit/phpunit", - "version": "9.4.0", + "version": "9.5.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "ef533467a7974c4b6c354f3eff42a115910bd4e5" + "reference": "8e16c225d57c3d6808014df6b1dd7598d0a5bbbe" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/ef533467a7974c4b6c354f3eff42a115910bd4e5", - "reference": "ef533467a7974c4b6c354f3eff42a115910bd4e5", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/8e16c225d57c3d6808014df6b1dd7598d0a5bbbe", + "reference": "8e16c225d57c3d6808014df6b1dd7598d0a5bbbe", "shasum": "" }, "require": { @@ -5628,23 +4781,23 @@ "phar-io/manifest": "^2.0.1", "phar-io/version": "^3.0.2", "php": ">=7.3", - "phpspec/prophecy": "^1.11.1", - "phpunit/php-code-coverage": "^9.2", - "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/cli-parser": "^1.0", - "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" + "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": "*", @@ -5660,7 +4813,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "9.4-dev" + "dev-master": "9.5-dev" } }, "autoload": { @@ -5691,7 +4844,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.4.0" + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.0" }, "funding": [ { @@ -5703,7 +4856,7 @@ "type": "github" } ], - "time": "2020-10-02T03:54:37+00:00" + "time": "2020-12-04T05:05:53+00:00" }, { "name": "sebastian/cli-parser", @@ -6736,20 +5889,20 @@ }, { "name": "symfony/finder", - "version": "v4.4.17", + "version": "v5.2.0", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "9f1d1d883b79a91ef320c0c6e803494e042ef36e" + "reference": "fd8305521692f27eae3263895d1ef1571c71a78d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/9f1d1d883b79a91ef320c0c6e803494e042ef36e", - "reference": "9f1d1d883b79a91ef320c0c6e803494e042ef36e", + "url": "https://api.github.com/repos/symfony/finder/zipball/fd8305521692f27eae3263895d1ef1571c71a78d", + "reference": "fd8305521692f27eae3263895d1ef1571c71a78d", "shasum": "" }, "require": { - "php": ">=7.1.3" + "php": ">=7.2.5" }, "type": "library", "autoload": { @@ -6777,7 +5930,7 @@ "description": "Symfony Finder Component", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v4.4.17" + "source": "https://github.com/symfony/finder/tree/v5.2.0" }, "funding": [ { @@ -6793,7 +5946,7 @@ "type": "tidelift" } ], - "time": "2020-11-17T19:45:34+00:00" + "time": "2020-11-18T09:42:36+00:00" }, { "name": "theseer/tokenizer", @@ -6894,23 +6047,24 @@ }, { "name": "webmozart/assert", - "version": "1.8.0", + "version": "1.9.1", "source": { "type": "git", "url": "https://github.com/webmozart/assert.git", - "reference": "ab2cb0b3b559010b75981b1bdce728da3ee90ad6" + "reference": "bafc69caeb4d49c39fd0779086c03a3738cbb389" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozart/assert/zipball/ab2cb0b3b559010b75981b1bdce728da3ee90ad6", - "reference": "ab2cb0b3b559010b75981b1bdce728da3ee90ad6", + "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": { + "phpstan/phpstan": "<0.12.20", "vimeo/psalm": "<3.9.1" }, "require-dev": { @@ -6942,7 +6096,7 @@ "issues": "https://github.com/webmozart/assert/issues", "source": "https://github.com/webmozart/assert/tree/master" }, - "time": "2020-04-18T12:12:48+00:00" + "time": "2020-07-08T17:02:28+00:00" } ], "aliases": [], diff --git a/tests/phpstan/phpstan.neon b/tests/phpstan/phpstan.neon index ba2bf1c68..5802fe911 100644 --- a/tests/phpstan/phpstan.neon +++ b/tests/phpstan/phpstan.neon @@ -1,3 +1,4 @@ +#phpVersion: 70100 includes: #- '../../vendor/phpstan/phpstan-strict-rules/rules.neon' - '../../vendor/phpstan/phpstan-deprecation-rules/rules.neon' @@ -5,11 +6,17 @@ parameters: fileExtensions: - php - dist - bootstrap: tests/phpstan/phpstan-bootstrap.php + bootstrapFiles: + - phpstan-bootstrap.php excludes_analyse: - - system/src/Grav/Common/Errors/Resources/layout.html.php + - */system/src/Grav/Common/Errors/Resources/layout.html.php inferPrivatePropertyTypeFromConstructor: true reportUnmatchedIgnoredErrors: false + + # These checks are new in phpstan 0.12, ignore them for now. + checkMissingIterableValueType: false + checkGenericClassInNonGenericObjectType: false + universalObjectCratesClasses: - Grav\Common\Config\Config - Grav\Common\Config\Languages @@ -23,12 +30,19 @@ parameters: dynamicConstantNames: - GRAV_CLI ignoreErrors: + # New in phpstan 0.12, ignore them for now. + - '#Unsafe usage of new static\(\)#' + - '#Cannot instantiate interface Grav\\Framework\\#' + # TODO: phpstan bug #3875 (fixed, test if can be removed) + - + message: '#Unreachable statement - code above always terminates#' + path: '*/system/src/Grav/Common/Flex/Types/Pages/Storage/PageStorage.php' # FIXME: Bugs that need to be fixed # FIXME: PHP 7.3 bug workaround - message: '#If condition is always false.#' - path: 'system/src/Grav/Framework/Session/Session.php' + path: '*/system/src/Grav/Framework/Session/Session.php' # TODO: Errors that needs some more thinking (bad design?) - '#Access to an undefined property RocketTheme\\Toolbox\\Event\\Event::#' @@ -39,72 +53,71 @@ parameters: - '#Access to an undefined property Grav\\Common\\Media\\Interfaces\\MediaObjectInterface::#' - message: '#Cannot call method path\(\) on string#' - path: 'system/src/Grav/Common/Page/Media.php' + path: '*/system/src/Grav/Common/Page/Media.php' - '"FlexCollectionInterface::filterBy\(\) invoked with 2 parameters"' # TODO: system.twig.umask_fix will not work with Twig 2 anymore - message: '#Call to deprecated method writeCacheFile\(\) of class Twig\\Environment#' - path: 'system/src/Grav/Common/Twig/WriteCacheFileTrait.php' + path: '*/system/src/Grav/Common/Twig/WriteCacheFileTrait.php' # Needed: full coverage (probably with admin plugin...) then redesign constructor - message: '#Grav\\Common\\GPM\\Remote\\GravCore::__construct\(\) does not call parent constructor from Grav\\Common\\GPM\\Remote\\AbstractPackageCollection#' - path: 'system/src/Grav/Common/GPM/Remote/GravCore.php' + path: '*/system/src/Grav/Common/GPM/Remote/GravCore.php' # PSR-16 Exception interfaces do not extend \Throwable - '#PHPDoc tag \@throws with type Psr\\SimpleCache\\(CacheException|InvalidArgumentException) is not subtype of Throwable#' - # Needed: psr-17 (http-factories) support (through decorator or further investigations) - - - message: '#Call to an undefined static method Grav\\Framework\\Psr7\\Stream::create\(\)#' - path: 'system/src/Grav/Framework/Form/FormFlashFile.php' - # Medium __call() methods - '#Call to an undefined method Grav\\Common\\Page\\Medium\\(\w*)Medium::#' # These errors are about plugins (need to find a better solution) - message: '#Call to static method sendEmail\(\) on an unknown class Grav\\Plugin\\Email\\Utils#' - path: 'system/src/Grav/Common/Scheduler/Job.php' + path: '*/system/src/Grav/Common/Scheduler/Job.php' - - message: '#on an unknown class Grav\\Plugin\\Admin#' - path: 'system/src/Grav/Common/Page/Pages.php' + message: '#unknown class Grav\\Plugin\\Admin#' + path: '*/system/src/Grav/Common/Page/Pages.php' - - message: '#on an unknown class Grav\\Plugin\\Admin#' - path: 'system/src/Grav/Common/Flex/Pages/PageObject.php' + message: '#unknown class Grav\\Plugin\\Admin#' + path: '*/system/src/Grav/Common/Flex/Pages/PageObject.php' - - message: '#Call to method getFlash\(\) on an unknown class Grav\\Common\\Grav\\Plugin\\Form\\Forms#' - path: 'system/src/Grav/Common/Session.php' + message: '#unknown class Grav\\Common\\Grav\\Plugin\\Form\\Forms#' + path: '*/system/src/Grav/Common/Session.php' - message: '#unknown class Grav\\Plugin\\Admin\\Admin#' - path: 'system/src/Grav/Common/Flex/Types/Pages/PageObject.php' + path: '*/system/src/Grav/Common/Flex/Types/Pages/PageObject.php' # Can be ignored, after fopen there's always an $http_response_header locally available - message: '#Variable \$http_response_header in isset\(\) always exists and is not nullable#' - path: 'system/src/Grav/Common/GPM/Response.php' + path: '*/system/src/Grav/Common/GPM/Response.php' + # Clockwork does not define functions for __call() call + - + message: '#Call to an undefined method Clockwork\\Clockwork::(info|userData|addEvent|alert)\(\)#' + path: '*/system/src/Grav/Common/Debugger.php' # These errors can be ignored (they depend on installed extensions) - message: '#Instantiated class (Memcache|Memcached|Redis|RedisException) not found#' - path: 'system/src/Grav/Common/Cache.php' + path: '*/system/src/Grav/Common/Cache.php' - message: '#unknown class (Memcache|Memcached|Redis|RedisException)#' - path: 'system/src/Grav/Common/Cache.php' + path: '*/system/src/Grav/Common/Cache.php' - message: '#unknown class Collator#' - path: 'system/src/Grav/Common/Page/Pages.php' + path: '*/system/src/Grav/Common/Page/Pages.php' - message: '#unknown class Collator#' - path: 'system/src/Grav/Common/Flex/Types/Pages/PageCollection.php' + path: '*/system/src/Grav/Common/Flex/Types/Pages/PageCollection.php' - message: '#Ternary operator condition is always true#' - path: 'system/src/Grav/Framework/Cache/AbstractCache.php' + path: '*/system/src/Grav/Framework/Cache/AbstractCache.php' - message: '#Call to function is_object\(\) with int will always evaluate to false#' - path: 'system/src/Grav/Framework/Cache/AbstractCache.php' + path: '*/system/src/Grav/Framework/Cache/AbstractCache.php' # XHprof - '#tideways_xhprof_enable#' @@ -112,37 +125,39 @@ parameters: # Support for deprecated features - message: '#Instantiation of deprecated class Doctrine\\Common\\Cache\\MemcacheCache#' - path: 'system/src/Grav/Common/Cache.php' + path: '*/system/src/Grav/Common/Cache.php' - message: '#Call to deprecated method order#' - path: 'system/src/Grav/Common/Page/Pages.php' + path: '*/system/src/Grav/Common/Page/Pages.php' - message: '#Fetching class constant class of deprecated class Grav\\Common\\User\\User#' - path: 'system/src/Grav/Common/Service/AccountsServiceProvider.php' + path: '*/system/src/Grav/Common/Service/AccountsServiceProvider.php' - message: '#Call to deprecated method getLegacyFiles\(\)#' - path: 'system/src/Grav/Common/Session.php' + path: '*/system/src/Grav/Common/Session.php' - message: '#Call to deprecated method getType\(\) of class#' - path: 'system/src/Grav/Framework/Object/Base/ObjectTrait.php' + path: '*/system/src/Grav/Framework/Object/Base/ObjectTrait.php' - message: '#Call to deprecated method \w+\(\) of class Grav\\Framework\\Flex\\FlexObject#' - path: 'system/src/Grav/Framework/Flex/FlexObject.php' + path: '*/system/src/Grav/Framework/Flex/FlexObject.php' - message: '#Call to deprecated method \w+\(\) of class Grav\\Framework\\Flex\\FlexIndex#' - path: 'system/src/Grav/Framework/Flex/FlexIndex.php' + path: '*/system/src/Grav/Framework/Flex/FlexIndex.php' - message: '#Call to deprecated method \w+\(\) of class Grav\\Framework\\Flex\\FlexCollection#' - path: 'system/src/Grav/Framework/Flex/FlexCollection.php' + path: '*/system/src/Grav/Framework/Flex/FlexCollection.php' - message: '#Call to deprecated method (getAuthorizeScope|getActiveUser)\(\) of class Grav\\Framework\\Flex\\FlexObject#' - path: 'system/src/Grav/Framework/Flex/Pages/Traits/PageAuthorsTrait.php' + path: '*/system/src/Grav/Framework/Flex/Pages/Traits/PageAuthorsTrait.php' - message: '#deprecated class#' - path: 'system/src/Grav/Framework/Uri/Uri.php' + path: '*/system/src/Grav/Framework/Uri/Uri.php' - message: '#Method Symfony\\Contracts\\EventDispatcher\\EventDispatcherInterface::dispatch#' - path: 'system/src/Grav/Common/Grav.php' + path: '*/system/src/Grav/Common/Grav.php' + + - '#has typehint with deprecated class RocketTheme\\Toolbox\\Event\\Event#' - '#Call to deprecated method stopPropagation\(\) of class Symfony\\Component\\EventDispatcher\\Event#' - '#Parameter \#2 \$listener of method Symfony\\Component\\EventDispatcher\\EventDispatcher::addListener\(\)#' - '#Parameter \#2 \$listener of method Symfony\\Component\\EventDispatcher\\EventDispatcher::removeListener\(\)#' diff --git a/tests/phpstan/plugins.neon b/tests/phpstan/plugins.neon index 484fd7f80..500e8fc7d 100644 --- a/tests/phpstan/plugins.neon +++ b/tests/phpstan/plugins.neon @@ -9,8 +9,13 @@ parameters: - %currentWorkingDirectory%/user/plugins/*/tests/* - %currentWorkingDirectory%/user/plugins/gantry5/src/platforms - %currentWorkingDirectory%/user/plugins/gantry5/src/classes/Gantry/Framework/Services/ErrorServiceProvider.php - bootstrap: tests/phpstan/plugins-bootstrap.php + bootstrapFiles: + - plugins-bootstrap.php reportUnmatchedIgnoredErrors: false + # These checks are new in phpstan 0.12, ignore them for now. + checkMissingIterableValueType: false + checkGenericClassInNonGenericObjectType: false + universalObjectCratesClasses: - Grav\Common\Config\Config - Grav\Common\Config\Languages @@ -41,3 +46,6 @@ parameters: - '#Call to deprecated method (stopPropagation|isPropagationStopped)\(\) of class Symfony\\Component\\EventDispatcher\\Event#' - '#Call to an undefined method Grav\\Plugin\\ApartmentData\\Application\\Application::#' - '#Parameter \#1 \$lineNumberStyle of method ScssPhp\\ScssPhp\\Compiler::setLineNumberStyle\(\) expects string, int given#' + + # Deprecated event class + - '#has typehint with deprecated class RocketTheme\\Toolbox\\Event\\Event#'