diff --git a/.gitattributes b/.gitattributes index 5bbaf359701..54d8bd65621 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,15 +1,16 @@ /.appveyor.yml export-ignore +/composer.lock export-ignore +/docs export-ignore +/.doctrine-project.json export-ignore /.gitattributes export-ignore /.github export-ignore /.gitignore export-ignore -/.scrutinizer.yml export-ignore -/.travis.yml export-ignore -/build.properties export-ignore -/build.xml export-ignore -/composer.lock export-ignore -/docs export-ignore /phpcs.xml.dist export-ignore /phpstan.neon.dist export-ignore /phpunit.xml.dist export-ignore /run-all.sh export-ignore +/.scrutinizer.yml export-ignore +/SECURITY.md export-ignore /tests export-ignore +/.travis.yml export-ignore +/UPGRADE.md export-ignore diff --git a/composer.json b/composer.json index e14f7664ee3..7d9fcda6cab 100644 --- a/composer.json +++ b/composer.json @@ -40,7 +40,7 @@ "require-dev": { "doctrine/coding-standard": "^6.0", "jetbrains/phpstorm-stubs": "^2019.1", - "phpstan/phpstan": "^0.11.3", + "phpstan/phpstan": "^0.12", "phpunit/phpunit": "^9.0", "symfony/console": "^2.0.5|^3.0|^4.0|^5.0" }, diff --git a/composer.lock b/composer.lock index 2f2e46802f5..9bcf7a40392 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": "5be45ec5a1bc11259882d3ba66538ee2", + "content-hash": "33232ba3c41c9de6f6bc60c784726991", "packages": [ { "name": "doctrine/cache", @@ -206,50 +206,6 @@ } ], "packages-dev": [ - { - "name": "composer/xdebug-handler", - "version": "1.3.3", - "source": { - "type": "git", - "url": "https://github.com/composer/xdebug-handler.git", - "reference": "46867cbf8ca9fb8d60c506895449eb799db1184f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/46867cbf8ca9fb8d60c506895449eb799db1184f", - "reference": "46867cbf8ca9fb8d60c506895449eb799db1184f", - "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": "2019-05-27T17:52:04+00:00" - }, { "name": "dealerdirect/phpcodesniffer-composer-installer", "version": "v0.5.0", @@ -433,57 +389,6 @@ ], "time": "2019-10-21T16:45:58+00:00" }, - { - "name": "jean85/pretty-package-versions", - "version": "1.2", - "source": { - "type": "git", - "url": "https://github.com/Jean85/pretty-package-versions.git", - "reference": "75c7effcf3f77501d0e0caa75111aff4daa0dd48" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Jean85/pretty-package-versions/zipball/75c7effcf3f77501d0e0caa75111aff4daa0dd48", - "reference": "75c7effcf3f77501d0e0caa75111aff4daa0dd48", - "shasum": "" - }, - "require": { - "ocramius/package-versions": "^1.2.0", - "php": "^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.0" - }, - "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" - ], - "time": "2018-06-13T13:22:40+00:00" - }, { "name": "jetbrains/phpstorm-stubs", "version": "v2019.1", @@ -571,580 +476,6 @@ ], "time": "2020-01-17T21:11:47+00:00" }, - { - "name": "nette/bootstrap", - "version": "v3.0.0", - "source": { - "type": "git", - "url": "https://github.com/nette/bootstrap.git", - "reference": "e1075af05c211915e03e0c86542f3ba5433df4a3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/bootstrap/zipball/e1075af05c211915e03e0c86542f3ba5433df4a3", - "reference": "e1075af05c211915e03e0c86542f3ba5433df4a3", - "shasum": "" - }, - "require": { - "nette/di": "^3.0", - "nette/utils": "^3.0", - "php": ">=7.1" - }, - "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", - "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", - "GPL-3.0" - ], - "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" - ], - "time": "2019-03-26T12:59:07+00:00" - }, - { - "name": "nette/di", - "version": "v3.0.1", - "source": { - "type": "git", - "url": "https://github.com/nette/di.git", - "reference": "4aff517a1c6bb5c36fa09733d4cea089f529de6d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/di/zipball/4aff517a1c6bb5c36fa09733d4cea089f529de6d", - "reference": "4aff517a1c6bb5c36fa09733d4cea089f529de6d", - "shasum": "" - }, - "require": { - "ext-tokenizer": "*", - "nette/neon": "^3.0", - "nette/php-generator": "^3.2.2", - "nette/robot-loader": "^3.2", - "nette/schema": "^1.0", - "nette/utils": "^3.0", - "php": ">=7.1" - }, - "conflict": { - "nette/bootstrap": "<3.0" - }, - "require-dev": { - "nette/tester": "^2.2", - "tracy/tracy": "^2.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ], - "files": [ - "src/compatibility.php" - ] - }, - "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 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" - ], - "time": "2019-08-07T12:11:33+00:00" - }, - { - "name": "nette/finder", - "version": "v2.5.0", - "source": { - "type": "git", - "url": "https://github.com/nette/finder.git", - "reference": "6be1b83ea68ac558aff189d640abe242e0306fe2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/finder/zipball/6be1b83ea68ac558aff189d640abe242e0306fe2", - "reference": "6be1b83ea68ac558aff189d640abe242e0306fe2", - "shasum": "" - }, - "require": { - "nette/utils": "^2.4 || ~3.0.0", - "php": ">=7.1" - }, - "conflict": { - "nette/nette": "<2.2" - }, - "require-dev": { - "nette/tester": "^2.0", - "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" - ], - "time": "2019-02-28T18:13:25+00:00" - }, - { - "name": "nette/neon", - "version": "v3.0.0", - "source": { - "type": "git", - "url": "https://github.com/nette/neon.git", - "reference": "cbff32059cbdd8720deccf9e9eace6ee516f02eb" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/neon/zipball/cbff32059cbdd8720deccf9e9eace6ee516f02eb", - "reference": "cbff32059cbdd8720deccf9e9eace6ee516f02eb", - "shasum": "" - }, - "require": { - "ext-iconv": "*", - "ext-json": "*", - "php": ">=7.0" - }, - "require-dev": { - "nette/tester": "^2.0", - "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", - "GPL-3.0" - ], - "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": "http://ne-on.org", - "keywords": [ - "export", - "import", - "neon", - "nette", - "yaml" - ], - "time": "2019-02-05T21:30:40+00:00" - }, - { - "name": "nette/php-generator", - "version": "v3.2.3", - "source": { - "type": "git", - "url": "https://github.com/nette/php-generator.git", - "reference": "aea6e81437bb238e5f0e5b5ce06337433908e63b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/php-generator/zipball/aea6e81437bb238e5f0e5b5ce06337433908e63b", - "reference": "aea6e81437bb238e5f0e5b5ce06337433908e63b", - "shasum": "" - }, - "require": { - "nette/utils": "^2.4.2 || ~3.0.0", - "php": ">=7.1" - }, - "require-dev": { - "nette/tester": "^2.0", - "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", - "GPL-3.0" - ], - "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.3 features.", - "homepage": "https://nette.org", - "keywords": [ - "code", - "nette", - "php", - "scaffolding" - ], - "time": "2019-07-05T13:01:56+00:00" - }, - { - "name": "nette/robot-loader", - "version": "v3.2.0", - "source": { - "type": "git", - "url": "https://github.com/nette/robot-loader.git", - "reference": "0712a0e39ae7956d6a94c0ab6ad41aa842544b5c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/robot-loader/zipball/0712a0e39ae7956d6a94c0ab6ad41aa842544b5c", - "reference": "0712a0e39ae7956d6a94c0ab6ad41aa842544b5c", - "shasum": "" - }, - "require": { - "ext-tokenizer": "*", - "nette/finder": "^2.5", - "nette/utils": "^3.0", - "php": ">=7.1" - }, - "require-dev": { - "nette/tester": "^2.0", - "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", - "GPL-3.0" - ], - "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" - ], - "time": "2019-03-08T21:57:24+00:00" - }, - { - "name": "nette/schema", - "version": "v1.0.0", - "source": { - "type": "git", - "url": "https://github.com/nette/schema.git", - "reference": "6241d8d4da39e825dd6cb5bfbe4242912f4d7e4d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/schema/zipball/6241d8d4da39e825dd6cb5bfbe4242912f4d7e4d", - "reference": "6241d8d4da39e825dd6cb5bfbe4242912f4d7e4d", - "shasum": "" - }, - "require": { - "nette/utils": "^3.0.1", - "php": ">=7.1" - }, - "require-dev": { - "nette/tester": "^2.2", - "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", - "GPL-3.0" - ], - "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" - ], - "time": "2019-04-03T15:53:25+00:00" - }, - { - "name": "nette/utils", - "version": "v3.0.1", - "source": { - "type": "git", - "url": "https://github.com/nette/utils.git", - "reference": "bd961f49b211997202bda1d0fbc410905be370d4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/utils/zipball/bd961f49b211997202bda1d0fbc410905be370d4", - "reference": "bd961f49b211997202bda1d0fbc410905be370d4", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "require-dev": { - "nette/tester": "~2.0", - "tracy/tracy": "^2.3" - }, - "suggest": { - "ext-gd": "to use Image", - "ext-iconv": "to use Strings::webalize() and toAscii()", - "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-xml": "to use Strings::length() etc. when mbstring is not available" - }, - "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", - "GPL-3.0" - ], - "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" - ], - "time": "2019-03-22T01:00:30+00:00" - }, - { - "name": "nikic/php-parser", - "version": "v4.2.3", - "source": { - "type": "git", - "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "e612609022e935f3d0337c1295176505b41188c8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/e612609022e935f3d0337c1295176505b41188c8", - "reference": "e612609022e935f3d0337c1295176505b41188c8", - "shasum": "" - }, - "require": { - "ext-tokenizer": "*", - "php": ">=7.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0" - }, - "bin": [ - "bin/php-parse" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.2-dev" - } - }, - "autoload": { - "psr-4": { - "PhpParser\\": "lib/PhpParser" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Nikita Popov" - } - ], - "description": "A PHP parser written in PHP", - "keywords": [ - "parser", - "php" - ], - "time": "2019-08-12T20:17:41+00:00" - }, { "name": "phar-io/manifest", "version": "1.0.3", @@ -1510,78 +841,42 @@ }, { "name": "phpstan/phpstan", - "version": "0.11.15", + "version": "0.12.18", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "1be5b3a706db16ac472a4c40ec03cf4c810b118d" + "reference": "1ce27fe29c8660a27926127d350d53d80c4d4286" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/1be5b3a706db16ac472a4c40ec03cf4c810b118d", - "reference": "1be5b3a706db16ac472a4c40ec03cf4c810b118d", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/1ce27fe29c8660a27926127d350d53d80c4d4286", + "reference": "1ce27fe29c8660a27926127d350d53d80c4d4286", "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/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" - }, - "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" + "php": "^7.1" }, "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/", - "build/PHPStan" - ] - } + "files": [ + "bootstrap.php" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "description": "PHPStan - PHP Static Analysis Tool", - "time": "2019-08-18T20:51:53+00:00" + "time": "2020-03-22T16:51:47+00:00" }, { "name": "phpunit/php-code-coverage", @@ -1982,16 +1277,16 @@ }, { "name": "psr/log", - "version": "1.1.0", + "version": "1.1.3", "source": { "type": "git", "url": "https://github.com/php-fig/log.git", - "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd" + "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", - "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", + "url": "https://api.github.com/repos/php-fig/log/zipball/0f73288fd15629204f9d42b7055f72dacbe811fc", + "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc", "shasum": "" }, "require": { @@ -2000,7 +1295,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.1.x-dev" } }, "autoload": { @@ -2025,7 +1320,7 @@ "psr", "psr-3" ], - "time": "2018-11-20T15:27:04+00:00" + "time": "2020-03-23T09:12:05+00:00" }, { "name": "sebastian/code-unit-reverse-lookup", @@ -2932,55 +2227,6 @@ "homepage": "https://symfony.com", "time": "2018-02-28T21:50:02+00:00" }, - { - "name": "symfony/finder", - "version": "v4.3.3", - "source": { - "type": "git", - "url": "https://github.com/symfony/finder.git", - "reference": "9638d41e3729459860bb96f6247ccb61faaa45f2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/9638d41e3729459860bb96f6247ccb61faaa45f2", - "reference": "9638d41e3729459860bb96f6247ccb61faaa45f2", - "shasum": "" - }, - "require": { - "php": "^7.1.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.3-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Finder\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Finder Component", - "homepage": "https://symfony.com", - "time": "2019-06-28T13:16:30+00:00" - }, { "name": "symfony/polyfill-ctype", "version": "v1.14.0", diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 9cf5137d3f7..bd08cc3a8d1 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -5,6 +5,8 @@ parameters: autoload_files: - %currentWorkingDirectory%/tests/phpstan-polyfill.php reportUnmatchedIgnoredErrors: false + checkMissingIterableValueType: false + checkGenericClassInNonGenericObjectType: false ignoreErrors: # extension not available - '~^(Used )?(Function|Constant) sasql_\S+ not found\.\z~i' @@ -23,7 +25,6 @@ parameters: - '~^Property Doctrine\\DBAL\\Schema\\Schema::\$_schemaConfig \(Doctrine\\DBAL\\Schema\\SchemaConfig\) does not accept default value of type false\.\z~' - '~^Method Doctrine\\DBAL\\Schema\\ForeignKeyConstraint::onEvent\(\) should return string\|null but returns false\.\z~' - '~^Method Doctrine\\DBAL\\Schema\\(Oracle|PostgreSql|SQLServer)SchemaManager::_getPortableTableDefinition\(\) should return array but returns string\.\z~' - - '~^Method Doctrine\\DBAL\\Platforms\\(|SQLAnywhere16|Sqlite)Platform::_getTransactionIsolationLevelSQL\(\) should return string but returns int\.\z~' - '~^Method Doctrine\\DBAL\\Driver\\OCI8\\OCI8Connection::lastInsertId\(\) should return string but returns (int|false)\.\z~' - '~^Method Doctrine\\DBAL\\Driver\\SQLSrv\\SQLSrvConnection::errorCode\(\) should return string\|null but returns false\.\z~' @@ -31,11 +32,11 @@ parameters: - '~^Call to an undefined method PDO::sqliteCreateFunction\(\)\.\z~' # https://github.com/phpstan/phpstan/issues/1847 - - '~^Parameter #2 \$registeredAliases of static method Doctrine\\DBAL\\Query\\QueryException::unknownAlias\(\) expects array, array given\.\z~' - - '~^Parameter #2 \$registeredAliases of static method Doctrine\\DBAL\\Query\\QueryException::nonUniqueAlias\(\) expects array, array given\.\z~' + - '~^Parameter #2 \$registeredAliases of static method Doctrine\\DBAL\\Query\\QueryException::unknownAlias\(\) expects array, array given\.\z~' + - '~^Parameter #2 \$registeredAliases of static method Doctrine\\DBAL\\Query\\QueryException::nonUniqueAlias\(\) expects array, array given\.\z~' # PHPStan is too strict about preg_replace(): https://phpstan.org/r/993dc99f-0d43-4b51-868b-d01f982c1463 - - '~^Method Doctrine\\DBAL\\Platforms\\AbstractPlatform::escapeStringForLike\(\) should return string but returns string|null\.\z~' + - '~^Method Doctrine\\DBAL\\Platforms\\AbstractPlatform::escapeStringForLike\(\) should return string but returns string\|null\.\z~' # legacy variadic-like signature - '~^Method Doctrine\\DBAL(\\.*)?Connection::query\(\) invoked with \d+ parameters?, 0 required\.\z~' @@ -55,3 +56,19 @@ parameters: # weird class name, represented in stubs as OCI_(Lob|Collection) - '~unknown class OCI-(Lob|Collection)~' + + # https://github.com/JetBrains/phpstorm-stubs/pull/766 + - '~^Method Doctrine\\DBAL\\Driver\\Mysqli\\MysqliStatement::_fetch\(\) never returns null so it can be removed from the return typehint\.$~' + + # The ReflectionException in the case when the class does not exist is acceptable and does not need to be handled + - '~^Parameter #1 \$argument of class ReflectionClass constructor expects class-string\|T of object, string given\.$~' + + # https://github.com/phpstan/phpstan/issues/3132 + - + message: '~^Call to function in_array\(\) with arguments Doctrine\\DBAL\\Schema\\Column, array and true will always evaluate to false\.$~' + path: %currentWorkingDirectory%/src/Schema/Table.php + + # https://github.com/phpstan/phpstan/issues/3133 + - + message: '~^Cannot cast array\|bool\|string\|null to int\.$~' + path: %currentWorkingDirectory%/src/Tools/Console/Command/RunSqlCommand.php diff --git a/phpunit.xml.dist b/phpunit.xml.dist index ac13dc4fdda..a099b121509 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -44,11 +44,7 @@ - ./tests - ./tests/Performance - - - ./tests/Performance + tests @@ -57,14 +53,4 @@ src - - - - - - - - performance - - diff --git a/src/Cache/ArrayStatement.php b/src/Cache/ArrayStatement.php index 494876c935e..8975cb98514 100644 --- a/src/Cache/ArrayStatement.php +++ b/src/Cache/ArrayStatement.php @@ -45,6 +45,8 @@ public function __construct(array $data) public function closeCursor() { unset($this->data); + + return true; } /** diff --git a/src/Configuration.php b/src/Configuration.php index 2cc0070d0cb..13260cd08bb 100644 --- a/src/Configuration.php +++ b/src/Configuration.php @@ -140,6 +140,8 @@ public function getSchemaAssetsFilter() : ?callable * @see getAutoCommit * * @param bool $autoCommit True to enable auto-commit mode; false to disable it. + * + * @return void */ public function setAutoCommit($autoCommit) { diff --git a/src/Connection.php b/src/Connection.php index bc53ded5d85..b85e0b65431 100644 --- a/src/Connection.php +++ b/src/Connection.php @@ -376,7 +376,7 @@ public function connect() * * @throws DBALException If an invalid platform was specified for this connection. */ - private function detectDatabasePlatform() + private function detectDatabasePlatform() : void { $version = $this->getDatabasePlatformVersion(); @@ -497,6 +497,8 @@ public function isAutoCommit() * @see isAutoCommit * * @param bool $autoCommit True to enable auto-commit mode; false to disable it. + * + * @return void */ public function setAutoCommit($autoCommit) { @@ -1291,7 +1293,7 @@ public function commit() /** * Commits all current nesting transactions. */ - private function commitAll() + private function commitAll() : void { while ($this->transactionNestingLevel !== 0) { if ($this->autoCommit === false && $this->transactionNestingLevel === 1) { @@ -1309,6 +1311,8 @@ private function commitAll() /** * Cancels any database changes done during the current transaction. * + * @return bool + * * @throws ConnectionException If the rollback operation failed. */ public function rollBack() @@ -1348,6 +1352,8 @@ public function rollBack() $this->isRollbackOnly = true; --$this->transactionNestingLevel; } + + return true; } /** diff --git a/src/Connections/MasterSlaveConnection.php b/src/Connections/MasterSlaveConnection.php index 8e6c535f85d..d15d7b67700 100644 --- a/src/Connections/MasterSlaveConnection.php +++ b/src/Connections/MasterSlaveConnection.php @@ -121,7 +121,9 @@ public function isConnectedToMaster() } /** - * {@inheritDoc} + * @param string|null $connectionName + * + * @return bool */ public function connect($connectionName = null) { diff --git a/src/DBALException.php b/src/DBALException.php index 4961af2f35f..fe706daffcf 100644 --- a/src/DBALException.php +++ b/src/DBALException.php @@ -157,7 +157,7 @@ public static function driverException(Driver $driver, Throwable $driverEx) /** * @return self */ - private static function wrapException(Driver $driver, Throwable $driverEx, $msg) + private static function wrapException(Driver $driver, Throwable $driverEx, string $msg) { if ($driverEx instanceof DriverException) { return $driverEx; diff --git a/src/Driver/IBMDB2/DB2Connection.php b/src/Driver/IBMDB2/DB2Connection.php index 80362b8cff3..6d8c94764cb 100644 --- a/src/Driver/IBMDB2/DB2Connection.php +++ b/src/Driver/IBMDB2/DB2Connection.php @@ -9,6 +9,7 @@ use stdClass; use const DB2_AUTOCOMMIT_OFF; use const DB2_AUTOCOMMIT_ON; +use function assert; use function db2_autocommit; use function db2_commit; use function db2_conn_error; @@ -23,6 +24,7 @@ use function db2_rollback; use function db2_server_info; use function db2_stmt_errormsg; +use function is_bool; class DB2Connection implements ServerInfoAwareConnection { @@ -138,7 +140,10 @@ public function lastInsertId($name = null) */ public function beginTransaction() { - db2_autocommit($this->conn, DB2_AUTOCOMMIT_OFF); + $result = db2_autocommit($this->conn, DB2_AUTOCOMMIT_OFF); + assert(is_bool($result)); + + return $result; } /** @@ -149,7 +154,11 @@ public function commit() if (! db2_commit($this->conn)) { throw new DB2Exception(db2_conn_errormsg($this->conn)); } - db2_autocommit($this->conn, DB2_AUTOCOMMIT_ON); + + $result = db2_autocommit($this->conn, DB2_AUTOCOMMIT_ON); + assert(is_bool($result)); + + return $result; } /** @@ -160,7 +169,11 @@ public function rollBack() if (! db2_rollback($this->conn)) { throw new DB2Exception(db2_conn_errormsg($this->conn)); } - db2_autocommit($this->conn, DB2_AUTOCOMMIT_ON); + + $result = db2_autocommit($this->conn, DB2_AUTOCOMMIT_ON); + assert(is_bool($result)); + + return $result; } /** diff --git a/src/Driver/Mysqli/MysqliConnection.php b/src/Driver/Mysqli/MysqliConnection.php index 5799e273418..34f84a5d2d8 100644 --- a/src/Driver/Mysqli/MysqliConnection.php +++ b/src/Driver/Mysqli/MysqliConnection.php @@ -225,7 +225,7 @@ public function errorInfo() * @throws MysqliException When one of of the options is not supported. * @throws MysqliException When applying doesn't work - e.g. due to incorrect value. */ - private function setDriverOptions(array $driverOptions = []) + private function setDriverOptions(array $driverOptions = []) : void { $supportedDriverOptions = [ MYSQLI_OPT_CONNECT_TIMEOUT, @@ -284,7 +284,7 @@ public function ping() * * @throws MysqliException */ - private function setSecureConnection(array $params) + private function setSecureConnection(array $params) : void { if (! isset($params['ssl_key']) && ! isset($params['ssl_cert']) && diff --git a/src/Driver/Mysqli/MysqliStatement.php b/src/Driver/Mysqli/MysqliStatement.php index eff8f88c569..9d0bdbe10ba 100644 --- a/src/Driver/Mysqli/MysqliStatement.php +++ b/src/Driver/Mysqli/MysqliStatement.php @@ -206,12 +206,14 @@ public function execute($params = null) /** * Binds parameters with known types previously bound to the statement */ - private function bindTypedParameters() + private function bindTypedParameters() : void { $streams = $values = []; $types = $this->types; foreach ($this->_bindedValues as $parameter => $value) { + assert(is_int($parameter)); + if (! isset($types[$parameter - 1])) { $types[$parameter - 1] = static::$_paramTypeMap[ParameterType::STRING]; } @@ -242,9 +244,11 @@ private function bindTypedParameters() /** * Handle $this->_longData after regular query parameters have been bound * + * @param array $streams + * * @throws MysqliException */ - private function sendLongData($streams) + private function sendLongData(array $streams) : void { foreach ($streams as $paramNr => $stream) { while (! feof($stream)) { diff --git a/src/Driver/PDOStatement.php b/src/Driver/PDOStatement.php index ae7b78616c4..876f74106eb 100644 --- a/src/Driver/PDOStatement.php +++ b/src/Driver/PDOStatement.php @@ -73,7 +73,13 @@ public function bindValue($param, $value, $type = ParameterType::STRING) } /** - * {@inheritdoc} + * @param mixed $column + * @param mixed $variable + * @param int $type + * @param int|null $length + * @param mixed $driverOptions + * + * @return bool */ public function bindParam($column, &$variable, $type = ParameterType::STRING, $length = null, $driverOptions = null) { diff --git a/src/Driver/SQLSrv/LastInsertId.php b/src/Driver/SQLSrv/LastInsertId.php index 363b260950e..94c19f6effc 100644 --- a/src/Driver/SQLSrv/LastInsertId.php +++ b/src/Driver/SQLSrv/LastInsertId.php @@ -12,6 +12,8 @@ class LastInsertId /** * @param int $id + * + * @return void */ public function setId($id) { diff --git a/src/Driver/SQLSrv/SQLSrvConnection.php b/src/Driver/SQLSrv/SQLSrvConnection.php index e3167ced47d..437ec509e99 100644 --- a/src/Driver/SQLSrv/SQLSrvConnection.php +++ b/src/Driver/SQLSrv/SQLSrvConnection.php @@ -150,6 +150,8 @@ public function beginTransaction() if (! sqlsrv_begin_transaction($this->conn)) { throw SQLSrvException::fromSqlSrvErrors(); } + + return true; } /** @@ -160,6 +162,8 @@ public function commit() if (! sqlsrv_commit($this->conn)) { throw SQLSrvException::fromSqlSrvErrors(); } + + return true; } /** @@ -170,6 +174,8 @@ public function rollBack() if (! sqlsrv_rollback($this->conn)) { throw SQLSrvException::fromSqlSrvErrors(); } + + return true; } /** diff --git a/src/Driver/SQLSrv/SQLSrvStatement.php b/src/Driver/SQLSrv/SQLSrvStatement.php index aad7fb33a90..4ea0aca2418 100644 --- a/src/Driver/SQLSrv/SQLSrvStatement.php +++ b/src/Driver/SQLSrv/SQLSrvStatement.php @@ -156,6 +156,8 @@ public function bindValue($param, $value, $type = ParameterType::STRING) $this->variables[$param] = $value; $this->types[$param] = $type; + + return true; } /** @@ -172,6 +174,8 @@ public function bindParam($column, &$variable, $type = ParameterType::STRING, $l // unset the statement resource if it exists as the new one will need to be bound to the new variable $this->stmt = null; + + return true; } /** @@ -261,6 +265,8 @@ public function execute($params = null) } $this->result = true; + + return true; } /** diff --git a/src/Event/Listeners/OracleSessionInit.php b/src/Event/Listeners/OracleSessionInit.php index 19f2b3fd335..9e374856078 100644 --- a/src/Event/Listeners/OracleSessionInit.php +++ b/src/Event/Listeners/OracleSessionInit.php @@ -49,9 +49,8 @@ public function postConnect(ConnectionEventArgs $args) return; } - array_change_key_case($this->_defaultSessionVars, CASE_UPPER); $vars = []; - foreach ($this->_defaultSessionVars as $option => $value) { + foreach (array_change_key_case($this->_defaultSessionVars, CASE_UPPER) as $option => $value) { if ($option === 'CURRENT_SCHEMA') { $vars[] = $option . ' = ' . $value; } else { diff --git a/src/Id/TableGenerator.php b/src/Id/TableGenerator.php index cb34dcd5c4b..62ad0d35c48 100644 --- a/src/Id/TableGenerator.php +++ b/src/Id/TableGenerator.php @@ -10,6 +10,8 @@ use Throwable; use const CASE_LOWER; use function array_change_key_case; +use function assert; +use function is_int; /** * Table ID Generator for those poor languages that are missing sequences. @@ -111,6 +113,8 @@ public function nextValue($sequenceName) $value = $row['sequence_value']; $value++; + assert(is_int($value)); + if ($row['sequence_increment_by'] > 1) { $this->sequences[$sequenceName] = [ 'value' => $value, diff --git a/src/Platforms/AbstractPlatform.php b/src/Platforms/AbstractPlatform.php index 3d833dfaaeb..f805b3d8c52 100644 --- a/src/Platforms/AbstractPlatform.php +++ b/src/Platforms/AbstractPlatform.php @@ -156,6 +156,8 @@ public function __construct() /** * Sets the EventManager used by the Platform. + * + * @return void */ public function setEventManager(EventManager $eventManager) { @@ -391,6 +393,8 @@ abstract public function getName(); * @param string $dbType * @param string $doctrineType * + * @return void + * * @throws DBALException If the type is not found. */ public function registerDoctrineTypeMapping($dbType, $doctrineType) @@ -3291,6 +3295,8 @@ public function hasNativeJsonType() /** * @deprecated * + * @return string + * * @todo Remove in 3.0 */ public function getIdentityColumnNullInsertSQL() diff --git a/src/Platforms/DB2Platform.php b/src/Platforms/DB2Platform.php index 58e9490527a..95d4f3c3749 100644 --- a/src/Platforms/DB2Platform.php +++ b/src/Platforms/DB2Platform.php @@ -628,7 +628,7 @@ public function getAlterTableSQL(TableDiff $diff) * @param string[] $sql The sequence of table alteration statements to fill. * @param mixed[] $queryParts The sequence of column alteration clauses to fill. */ - private function gatherAlterColumnSQL(Identifier $table, ColumnDiff $columnDiff, array &$sql, array &$queryParts) + private function gatherAlterColumnSQL(Identifier $table, ColumnDiff $columnDiff, array &$sql, array &$queryParts) : void { $alterColumnClauses = $this->getAlterColumnClausesSQL($columnDiff); diff --git a/src/Platforms/MySqlPlatform.php b/src/Platforms/MySqlPlatform.php index 5fad73aa301..a6b51d30004 100644 --- a/src/Platforms/MySqlPlatform.php +++ b/src/Platforms/MySqlPlatform.php @@ -175,7 +175,10 @@ public function getListViewsSQL($database) } /** - * {@inheritDoc} + * @param string $table + * @param string|null $database + * + * @return string */ public function getListTableForeignKeysSQL($table, $database = null) { diff --git a/src/Platforms/OraclePlatform.php b/src/Platforms/OraclePlatform.php index 25e4094f82d..a1c477ffafe 100644 --- a/src/Platforms/OraclePlatform.php +++ b/src/Platforms/OraclePlatform.php @@ -37,6 +37,8 @@ class OraclePlatform extends AbstractPlatform * * @param string $identifier * + * @return void + * * @throws DBALException */ public static function assertValidIdentifier($identifier) @@ -59,7 +61,9 @@ public function getSubstringExpression($value, $position, $length = null) } /** - * {@inheritDoc} + * @param string $type + * + * @return string */ public function getNowExpression($type = 'timestamp') { diff --git a/src/Platforms/PostgreSQL94Platform.php b/src/Platforms/PostgreSQL94Platform.php index ad55e6d501d..f1de7379b3e 100644 --- a/src/Platforms/PostgreSQL94Platform.php +++ b/src/Platforms/PostgreSQL94Platform.php @@ -67,6 +67,8 @@ class PostgreSQL94Platform extends AbstractPlatform * Enables use of 'true'/'false' or otherwise 1 and 0 instead. * * @param bool $flag + * + * @return void */ public function setUseBooleanTrueFalseStrings($flag) { @@ -275,7 +277,10 @@ public function getListViewsSQL($database) } /** - * {@inheritDoc} + * @param string $table + * @param string|null $database + * + * @return string */ public function getListTableForeignKeysSQL($table, $database = null) { diff --git a/src/Platforms/SQLAnywhere16Platform.php b/src/Platforms/SQLAnywhere16Platform.php index 1241778a0a2..e427ac33c64 100644 --- a/src/Platforms/SQLAnywhere16Platform.php +++ b/src/Platforms/SQLAnywhere16Platform.php @@ -629,15 +629,12 @@ public function getForeignKeyMatchClauseSQL($type) case self::FOREIGN_KEY_MATCH_SIMPLE: return 'SIMPLE'; - break; case self::FOREIGN_KEY_MATCH_FULL: return 'FULL'; - break; case self::FOREIGN_KEY_MATCH_SIMPLE_UNIQUE: return 'UNIQUE SIMPLE'; - break; case self::FOREIGN_KEY_MATCH_FULL_UNIQUE: return 'UNIQUE FULL'; default: @@ -1369,13 +1366,13 @@ protected function _getTransactionIsolationLevelSQL($level) { switch ($level) { case TransactionIsolationLevel::READ_UNCOMMITTED: - return 0; + return '0'; case TransactionIsolationLevel::READ_COMMITTED: - return 1; + return '1'; case TransactionIsolationLevel::REPEATABLE_READ: - return 2; + return '2'; case TransactionIsolationLevel::SERIALIZABLE: - return 3; + return '3'; default: throw new InvalidArgumentException('Invalid isolation level:' . $level); } diff --git a/src/Platforms/SQLServer2012Platform.php b/src/Platforms/SQLServer2012Platform.php index c62d921a42f..94a8452f033 100644 --- a/src/Platforms/SQLServer2012Platform.php +++ b/src/Platforms/SQLServer2012Platform.php @@ -994,7 +994,10 @@ public function getListTableColumnsSQL($table, $database = null) } /** - * {@inheritDoc} + * @param string $table + * @param string|null $database + * + * @return string */ public function getListTableForeignKeysSQL($table, $database = null) { diff --git a/src/Platforms/SqlitePlatform.php b/src/Platforms/SqlitePlatform.php index af3d279cb4d..3f6e4346e81 100644 --- a/src/Platforms/SqlitePlatform.php +++ b/src/Platforms/SqlitePlatform.php @@ -55,7 +55,9 @@ public function getGuidExpression() } /** - * {@inheritDoc} + * @param string $type + * + * @return string */ public function getNowExpression($type = 'timestamp') { @@ -166,11 +168,11 @@ protected function _getTransactionIsolationLevelSQL($level) { switch ($level) { case TransactionIsolationLevel::READ_UNCOMMITTED: - return 0; + return '0'; case TransactionIsolationLevel::READ_COMMITTED: case TransactionIsolationLevel::REPEATABLE_READ: case TransactionIsolationLevel::SERIALIZABLE: - return 1; + return '1'; default: return parent::_getTransactionIsolationLevelSQL($level); } @@ -222,7 +224,9 @@ public function getBigIntTypeDeclarationSQL(array $field) } /** - * {@inheritDoc} + * @param array $field + * + * @return string */ public function getTinyIntTypeDeclarationSql(array $field) { @@ -248,7 +252,9 @@ public function getSmallIntTypeDeclarationSQL(array $field) } /** - * {@inheritDoc} + * @param array $field + * + * @return string */ public function getMediumIntTypeDeclarationSql(array $field) { @@ -600,7 +606,7 @@ public static function udfLocate($str, $substr, $offset = 0) /** * {@inheritDoc} */ - public function getForUpdateSql() + public function getForUpdateSQL() { return ''; } @@ -810,7 +816,10 @@ public function getCreateTableSQL(Table $table, $createFlags = null) } /** - * {@inheritDoc} + * @param string $table + * @param string|null $database + * + * @return string */ public function getListTableForeignKeysSQL($table, $database = null) { diff --git a/src/Query/QueryBuilder.php b/src/Query/QueryBuilder.php index b33fce72689..40e52261719 100644 --- a/src/Query/QueryBuilder.php +++ b/src/Query/QueryBuilder.php @@ -1186,7 +1186,7 @@ private function getFromClauses() * * @throws QueryException */ - private function verifyAllAliasesAreKnown(array $knownAliases) + private function verifyAllAliasesAreKnown(array $knownAliases) : void { foreach ($this->sqlParts['join'] as $fromAlias => $joins) { if (! isset($knownAliases[$fromAlias])) { diff --git a/src/Schema/DB2SchemaManager.php b/src/Schema/DB2SchemaManager.php index b1fe64afef4..ae2af864f97 100644 --- a/src/Schema/DB2SchemaManager.php +++ b/src/Schema/DB2SchemaManager.php @@ -178,7 +178,9 @@ protected function _getPortableTableForeignKeysList($tableForeignKeys) } /** - * {@inheritdoc} + * @param string $def + * + * @return string|null */ protected function _getPortableForeignKeyRuleDef($def) { @@ -220,7 +222,10 @@ public function listTableDetails($tableName) : Table $sql = $platform->getListTableCommentsSQL($tableName); $tableOptions = $this->_conn->fetchAssoc($sql); - $table->addOption('comment', $tableOptions['REMARKS']); + + if ($tableOptions !== false) { + $table->addOption('comment', $tableOptions['REMARKS']); + } return $table; } diff --git a/src/Schema/ForeignKeyConstraint.php b/src/Schema/ForeignKeyConstraint.php index 270f3dda312..3611b77dccd 100644 --- a/src/Schema/ForeignKeyConstraint.php +++ b/src/Schema/ForeignKeyConstraint.php @@ -365,7 +365,7 @@ private function onEvent($event) } } - return false; + return null; } /** diff --git a/src/Schema/OracleSchemaManager.php b/src/Schema/OracleSchemaManager.php index afe610ddbc4..9718f932ef5 100644 --- a/src/Schema/OracleSchemaManager.php +++ b/src/Schema/OracleSchemaManager.php @@ -399,7 +399,10 @@ public function listTableDetails($tableName) : Table $sql = $platform->getListTableCommentsSQL($tableName); $tableOptions = $this->_conn->fetchAssoc($sql); - $table->addOption('comment', $tableOptions['COMMENTS']); + + if ($tableOptions !== false) { + $table->addOption('comment', $tableOptions['COMMENTS']); + } return $table; } diff --git a/src/Schema/PostgreSqlSchemaManager.php b/src/Schema/PostgreSqlSchemaManager.php index 77b56bbf1ca..7159b3160ff 100644 --- a/src/Schema/PostgreSqlSchemaManager.php +++ b/src/Schema/PostgreSqlSchemaManager.php @@ -500,7 +500,9 @@ public function listTableDetails($tableName) : Table $tableOptions = $this->_conn->fetchAssoc($sql); - $table->addOption('comment', $tableOptions['table_comment']); + if ($tableOptions !== false) { + $table->addOption('comment', $tableOptions['table_comment']); + } return $table; } diff --git a/src/Schema/SQLAnywhereSchemaManager.php b/src/Schema/SQLAnywhereSchemaManager.php index 0fa4c072b31..7dfb3b82332 100644 --- a/src/Schema/SQLAnywhereSchemaManager.php +++ b/src/Schema/SQLAnywhereSchemaManager.php @@ -47,6 +47,8 @@ public function dropDatabase($database) * Starts a database. * * @param string $database The name of the database to start. + * + * @return void */ public function startDatabase($database) { @@ -58,6 +60,8 @@ public function startDatabase($database) * Stops a database. * * @param string $database The name of the database to stop. + * + * @return void */ public function stopDatabase($database) { diff --git a/src/Schema/SqliteSchemaManager.php b/src/Schema/SqliteSchemaManager.php index ac758015a0f..68e1e1f8487 100644 --- a/src/Schema/SqliteSchemaManager.php +++ b/src/Schema/SqliteSchemaManager.php @@ -223,9 +223,11 @@ protected function _getPortableTableIndexesList($tableIndexes, $tableName = null } /** - * {@inheritdoc} - * * @deprecated + * + * @param array $tableIndex + * + * @return array */ protected function _getPortableTableIndexDefinition($tableIndex) { diff --git a/src/Schema/Synchronizer/AbstractSchemaSynchronizer.php b/src/Schema/Synchronizer/AbstractSchemaSynchronizer.php index b597b8db9b2..9b1974747e7 100644 --- a/src/Schema/Synchronizer/AbstractSchemaSynchronizer.php +++ b/src/Schema/Synchronizer/AbstractSchemaSynchronizer.php @@ -20,6 +20,8 @@ public function __construct(Connection $conn) /** * @param string[] $sql + * + * @return void */ protected function processSqlSafely(array $sql) { @@ -33,6 +35,8 @@ protected function processSqlSafely(array $sql) /** * @param string[] $sql + * + * @return void */ protected function processSql(array $sql) { diff --git a/src/Schema/Table.php b/src/Schema/Table.php index 8e613320f79..842d1fccf67 100644 --- a/src/Schema/Table.php +++ b/src/Schema/Table.php @@ -300,6 +300,8 @@ public function addColumn($columnName, $typeName, array $options = []) * @param string $oldColumnName * @param string $newColumnName * + * @return void + * * @throws DBALException */ public function renameColumn($oldColumnName, $newColumnName) diff --git a/src/Schema/Visitor/NamespaceVisitor.php b/src/Schema/Visitor/NamespaceVisitor.php index 186fe1b4213..b0548d6064a 100644 --- a/src/Schema/Visitor/NamespaceVisitor.php +++ b/src/Schema/Visitor/NamespaceVisitor.php @@ -11,6 +11,8 @@ interface NamespaceVisitor * Accepts a schema namespace name. * * @param string $namespaceName The schema namespace name to accept. + * + * @return void */ public function acceptNamespace($namespaceName); } diff --git a/src/Schema/Visitor/SchemaDiffVisitor.php b/src/Schema/Visitor/SchemaDiffVisitor.php index 5ec843d9be6..040b59f5549 100644 --- a/src/Schema/Visitor/SchemaDiffVisitor.php +++ b/src/Schema/Visitor/SchemaDiffVisitor.php @@ -14,26 +14,37 @@ interface SchemaDiffVisitor { /** * Visit an orphaned foreign key whose table was deleted. + * + * @return void */ public function visitOrphanedForeignKey(ForeignKeyConstraint $foreignKey); /** * Visit a sequence that has changed. + * + * @return void */ public function visitChangedSequence(Sequence $sequence); /** * Visit a sequence that has been removed. + * + * @return void */ public function visitRemovedSequence(Sequence $sequence); + /** @return void */ public function visitNewSequence(Sequence $sequence); + /** @return void */ public function visitNewTable(Table $table); + /** @return void */ public function visitNewTableForeignKey(Table $table, ForeignKeyConstraint $foreignKey); + /** @return void */ public function visitRemovedTable(Table $table); + /** @return void */ public function visitChangedTable(TableDiff $tableDiff); } diff --git a/src/Tools/Console/Command/ReservedWordsCommand.php b/src/Tools/Console/Command/ReservedWordsCommand.php index f7e2e6cd998..d41117d6e73 100644 --- a/src/Tools/Console/Command/ReservedWordsCommand.php +++ b/src/Tools/Console/Command/ReservedWordsCommand.php @@ -54,9 +54,7 @@ public function setKeywordListClass($name, $class) $this->keywordListClasses[$name] = $class; } - /** - * {@inheritdoc} - */ + /** @return void */ protected function configure() { $this diff --git a/src/Tools/Console/Command/RunSqlCommand.php b/src/Tools/Console/Command/RunSqlCommand.php index b479baec2ee..5111a6505db 100644 --- a/src/Tools/Console/Command/RunSqlCommand.php +++ b/src/Tools/Console/Command/RunSqlCommand.php @@ -21,9 +21,7 @@ */ class RunSqlCommand extends Command { - /** - * {@inheritdoc} - */ + /** @return void */ protected function configure() { $this diff --git a/src/Tools/Console/ConsoleRunner.php b/src/Tools/Console/ConsoleRunner.php index 0df6f086f2c..1e7e19038fd 100644 --- a/src/Tools/Console/ConsoleRunner.php +++ b/src/Tools/Console/ConsoleRunner.php @@ -61,6 +61,8 @@ public static function addCommands(Application $cli) /** * Prints the instructions to create a configuration file + * + * @return void */ public static function printCliConfigTemplate() { diff --git a/src/Tools/Dumper.php b/src/Tools/Dumper.php index 3668efbe4d1..8cb8f4b8689 100644 --- a/src/Tools/Dumper.php +++ b/src/Tools/Dumper.php @@ -17,7 +17,6 @@ use function extension_loaded; use function get_class; use function html_entity_decode; -use function ini_get; use function ini_set; use function is_array; use function is_object; @@ -55,14 +54,11 @@ private function __construct() */ public static function dump($var, int $maxDepth = 2) : string { - $html = ini_get('html_errors'); - - if ($html !== true) { - ini_set('html_errors', true); - } + $html = ini_set('html_errors', '1'); + assert(is_string($html)); if (extension_loaded('xdebug')) { - ini_set('xdebug.var_display_max_depth', $maxDepth); + ini_set('xdebug.var_display_max_depth', (string) $maxDepth); } $var = self::export($var, $maxDepth); diff --git a/src/Types/ConversionException.php b/src/Types/ConversionException.php index 87f79a91cdc..82c6df912b7 100644 --- a/src/Types/ConversionException.php +++ b/src/Types/ConversionException.php @@ -90,6 +90,13 @@ public static function conversionFailedInvalidType( ), 0, $previous); } + /** + * @param mixed $value + * @param string $format + * @param string $error + * + * @return ConversionException + */ public static function conversionFailedSerialization($value, $format, $error) { $actualType = is_object($value) ? get_class($value) : gettype($value); diff --git a/tests/Performance/TypeConversionPerformanceTest.php b/tests/Performance/TypeConversionPerformanceTest.php deleted file mode 100644 index 39e7f655641..00000000000 --- a/tests/Performance/TypeConversionPerformanceTest.php +++ /dev/null @@ -1,44 +0,0 @@ -connection->getDatabasePlatform(); - $this->startTiming(); - for ($i = 0; $i < $count; $i++) { - $type->convertToDatabaseValue($value, $platform); - } - $this->stopTiming(); - } - - /** - * @return mixed[][] - */ - public static function itemCountProvider() : iterable - { - return [ - '100 items' => [100], - '1000 items' => [1000], - '10000 items' => [10000], - '100000 items' => [100000], - ]; - } -} diff --git a/tests/PerformanceTestCase.php b/tests/PerformanceTestCase.php deleted file mode 100644 index afa8df28fc2..00000000000 --- a/tests/PerformanceTestCase.php +++ /dev/null @@ -1,63 +0,0 @@ -startTime, 'Test timing was started'); - self::assertNotNull($this->runTime, 'Test timing was stopped'); - } - - /** - * begin timing - */ - protected function startTiming() : void - { - $this->startTime = microtime(true); - } - - /** - * end timing - */ - protected function stopTiming() : void - { - $this->runTime = microtime(true) - $this->startTime; - } - - /** - * @return float elapsed test execution time - */ - public function getTime() : float - { - return $this->runTime; - } -} diff --git a/tests/PerformanceTestListener.php b/tests/PerformanceTestListener.php deleted file mode 100644 index 4df16403f89..00000000000 --- a/tests/PerformanceTestListener.php +++ /dev/null @@ -1,65 +0,0 @@ -timings[$class])) { - $this->timings[$class] = []; - } - - // Store timing data for each test in the order they were run. - $this->timings[$class][$test->getName(true)] = $test->getTime(); - } - - /** - * Report performance test timings. - * - * Note: __destruct is used here because PHPUnit doesn't have a - * 'All tests over' hook. - */ - public function __destruct() - { - if (empty($this->timings)) { - return; - } - - // Report timings. - print "\nPerformance test results:\n\n"; - - foreach ($this->timings as $class => $tests) { - printf("%s:\n", $class); - foreach ($tests as $test => $time) { - printf("\t%s: %.3f seconds\n", $test, $time); - } - } - } -} diff --git a/tests/StatementTest.php b/tests/StatementTest.php index 1f86c0b432e..c80b3ab17d1 100644 --- a/tests/StatementTest.php +++ b/tests/StatementTest.php @@ -8,6 +8,7 @@ use Doctrine\DBAL\Driver; use Doctrine\DBAL\Driver\Connection as DriverConnection; use Doctrine\DBAL\Driver\Statement as DriverStatement; +use Doctrine\DBAL\FetchMode; use Doctrine\DBAL\Logging\SQLLogger; use Doctrine\DBAL\ParameterType; use Doctrine\DBAL\Statement; @@ -148,4 +149,15 @@ public function testExecuteCallsLoggerStopQueryOnException() : void $statement->execute(); } + + public function testPDOCustomClassConstructorArgs() : void + { + $statement = new Statement('', $this->conn); + + $this->driverStatement->expects($this->once()) + ->method('fetchAll') + ->with(self::equalTo(FetchMode::CUSTOM_OBJECT), self::equalTo('Example'), self::equalTo(['arg1'])); + + $statement->fetchAll(FetchMode::CUSTOM_OBJECT, 'Example', ['arg1']); + } }