diff --git a/composer.json b/composer.json index 1fc9a23ffa3..bfbbcc0af37 100644 --- a/composer.json +++ b/composer.json @@ -45,9 +45,10 @@ "phpstan/phpstan-phpunit": "^0.12", "phpstan/phpstan-strict-rules": "^0.12.2", "phpunit/phpunit": "^9.1.1", + "psalm/plugin-phpunit": "^0.10.0", "slevomat/coding-standard": "^6.3.6", "symfony/console": "^2.0.5|^3.0|^4.0|^5.0", - "vimeo/psalm": "^3.11" + "vimeo/psalm": "^3.11.4" }, "suggest": { "symfony/console": "For helpful console commands such as SQL execution and import of files." diff --git a/composer.lock b/composer.lock index 15cadd33a87..cea89bdbdb3 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": "ec7d2054f95cb2a24421dcf208e65186", + "content-hash": "443135f1aaa5ecf64132fd13d99efb6c", "packages": [ { "name": "doctrine/cache", @@ -208,16 +208,16 @@ "packages-dev": [ { "name": "amphp/amp", - "version": "v2.4.2", + "version": "v2.4.4", "source": { "type": "git", "url": "https://github.com/amphp/amp.git", - "reference": "feca077369a47263b22156b3c6389e55f3809f24" + "reference": "1e58d53e4af390efc7813e36cd215bd82cba4b06" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/amphp/amp/zipball/feca077369a47263b22156b3c6389e55f3809f24", - "reference": "feca077369a47263b22156b3c6389e55f3809f24", + "url": "https://api.github.com/repos/amphp/amp/zipball/1e58d53e4af390efc7813e36cd215bd82cba4b06", + "reference": "1e58d53e4af390efc7813e36cd215bd82cba4b06", "shasum": "" }, "require": { @@ -230,7 +230,7 @@ "jetbrains/phpstorm-stubs": "^2019.3", "phpunit/phpunit": "^6.0.9 | ^7", "react/promise": "^2", - "vimeo/psalm": "^3.9@dev" + "vimeo/psalm": "^3.11@dev" }, "type": "library", "extra": { @@ -282,7 +282,7 @@ "non-blocking", "promise" ], - "time": "2020-04-04T15:05:26+00:00" + "time": "2020-04-30T04:54:50+00:00" }, { "name": "amphp/byte-stream", @@ -589,20 +589,20 @@ }, { "name": "doctrine/instantiator", - "version": "1.3.0", + "version": "1.3.1", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", - "reference": "ae466f726242e637cebdd526a7d991b9433bacf1" + "reference": "f350df0268e904597e3bd9c4685c53e0e333feea" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/ae466f726242e637cebdd526a7d991b9433bacf1", - "reference": "ae466f726242e637cebdd526a7d991b9433bacf1", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/f350df0268e904597e3bd9c4685c53e0e333feea", + "reference": "f350df0268e904597e3bd9c4685c53e0e333feea", "shasum": "" }, "require": { - "php": "^7.1" + "php": "^7.1 || ^8.0" }, "require-dev": { "doctrine/coding-standard": "^6.0", @@ -641,7 +641,21 @@ "constructor", "instantiate" ], - "time": "2019-10-21T16:45:58+00:00" + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator", + "type": "tidelift" + } + ], + "time": "2020-05-29T17:27:14+00:00" }, { "name": "felixfbecker/advanced-json-rpc", @@ -733,25 +747,30 @@ }, { "name": "jetbrains/phpstorm-stubs", - "version": "v2019.1", + "version": "v2019.3", "source": { "type": "git", "url": "https://github.com/JetBrains/phpstorm-stubs.git", - "reference": "9e309771f362e979ecfb429303ad7a402c657234" + "reference": "883b6facd78e01c0743b554af86fa590c2573f40" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/JetBrains/phpstorm-stubs/zipball/9e309771f362e979ecfb429303ad7a402c657234", - "reference": "9e309771f362e979ecfb429303ad7a402c657234", + "url": "https://api.github.com/repos/JetBrains/phpstorm-stubs/zipball/883b6facd78e01c0743b554af86fa590c2573f40", + "reference": "883b6facd78e01c0743b554af86fa590c2573f40", "shasum": "" }, "require-dev": { - "nikic/php-parser": "v4.0.1", + "nikic/php-parser": "^4", "php": "^7.1", "phpdocumentor/reflection-docblock": "^4.3", - "phpunit/phpunit": "7.1.4" + "phpunit/phpunit": "^7" }, "type": "library", + "autoload": { + "files": [ + "PhpStormStubsMap.php" + ] + }, "notification-url": "https://packagist.org/downloads/", "license": [ "Apache-2.0" @@ -768,7 +787,7 @@ "stubs", "type" ], - "time": "2019-03-25T16:59:23+00:00" + "time": "2019-12-05T16:56:26+00:00" }, { "name": "myclabs/deep-copy", @@ -820,16 +839,16 @@ }, { "name": "netresearch/jsonmapper", - "version": "v2.0.0", + "version": "v2.1.0", "source": { "type": "git", "url": "https://github.com/cweiske/jsonmapper.git", - "reference": "e245890383c3ed38b6d202ee373c23ccfebc0f54" + "reference": "e0f1e33a71587aca81be5cffbb9746510e1fe04e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/cweiske/jsonmapper/zipball/e245890383c3ed38b6d202ee373c23ccfebc0f54", - "reference": "e245890383c3ed38b6d202ee373c23ccfebc0f54", + "url": "https://api.github.com/repos/cweiske/jsonmapper/zipball/e0f1e33a71587aca81be5cffbb9746510e1fe04e", + "reference": "e0f1e33a71587aca81be5cffbb9746510e1fe04e", "shasum": "" }, "require": { @@ -862,7 +881,7 @@ } ], "description": "Map nested JSON structures onto PHP classes", - "time": "2020-03-04T17:23:33+00:00" + "time": "2020-04-16T18:48:43+00:00" }, { "name": "nikic/php-parser", @@ -1069,24 +1088,21 @@ }, { "name": "phpdocumentor/reflection-common", - "version": "2.0.0", + "version": "2.1.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionCommon.git", - "reference": "63a995caa1ca9e5590304cd845c15ad6d482a62a" + "reference": "6568f4687e5b41b054365f9ae03fcb1ed5f2069b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/63a995caa1ca9e5590304cd845c15ad6d482a62a", - "reference": "63a995caa1ca9e5590304cd845c15ad6d482a62a", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/6568f4687e5b41b054365f9ae03fcb1ed5f2069b", + "reference": "6568f4687e5b41b054365f9ae03fcb1ed5f2069b", "shasum": "" }, "require": { "php": ">=7.1" }, - "require-dev": { - "phpunit/phpunit": "~6" - }, "type": "library", "extra": { "branch-alias": { @@ -1117,7 +1133,7 @@ "reflection", "static analysis" ], - "time": "2018-08-07T13:53:10+00:00" + "time": "2020-04-27T09:25:28+00:00" }, { "name": "phpdocumentor/reflection-docblock", @@ -1478,16 +1494,16 @@ }, { "name": "phpunit/php-code-coverage", - "version": "8.0.1", + "version": "8.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "31e94ccc084025d6abee0585df533eb3a792b96a" + "reference": "ca6647ffddd2add025ab3f21644a441d7c146cdc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/31e94ccc084025d6abee0585df533eb3a792b96a", - "reference": "31e94ccc084025d6abee0585df533eb3a792b96a", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/ca6647ffddd2add025ab3f21644a441d7c146cdc", + "reference": "ca6647ffddd2add025ab3f21644a441d7c146cdc", "shasum": "" }, "require": { @@ -1538,20 +1554,26 @@ "testing", "xunit" ], - "time": "2020-02-19T13:41:19+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-05-23T08:02:54+00:00" }, { "name": "phpunit/php-file-iterator", - "version": "3.0.0", + "version": "3.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "354d4a5faa7449a377a18b94a2026ca3415e3d7a" + "reference": "4ac5b3e13df14829daa60a2eb4fdd2f2b7d33cf4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/354d4a5faa7449a377a18b94a2026ca3415e3d7a", - "reference": "354d4a5faa7449a377a18b94a2026ca3415e3d7a", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/4ac5b3e13df14829daa60a2eb4fdd2f2b7d33cf4", + "reference": "4ac5b3e13df14829daa60a2eb4fdd2f2b7d33cf4", "shasum": "" }, "require": { @@ -1588,7 +1610,13 @@ "filesystem", "iterator" ], - "time": "2020-02-07T06:05:22+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-04-18T05:02:12+00:00" }, { "name": "phpunit/php-invoker", @@ -1691,16 +1719,16 @@ }, { "name": "phpunit/php-timer", - "version": "3.0.0", + "version": "3.1.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "4118013a4d0f97356eae8e7fb2f6c6472575d1df" + "reference": "dc9368fae6ef2ffa57eba80a7410bcef81df6258" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/4118013a4d0f97356eae8e7fb2f6c6472575d1df", - "reference": "4118013a4d0f97356eae8e7fb2f6c6472575d1df", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/dc9368fae6ef2ffa57eba80a7410bcef81df6258", + "reference": "dc9368fae6ef2ffa57eba80a7410bcef81df6258", "shasum": "" }, "require": { @@ -1712,7 +1740,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-master": "3.1-dev" } }, "autoload": { @@ -1736,20 +1764,26 @@ "keywords": [ "timer" ], - "time": "2020-02-07T06:08:11+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-04-20T06:00:37+00:00" }, { "name": "phpunit/php-token-stream", - "version": "4.0.0", + "version": "4.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "b2560a0c33f7710e4d7f8780964193e8e8f8effe" + "reference": "cdc0db5aed8fbfaf475fbd95bfd7bab83c7a779c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/b2560a0c33f7710e4d7f8780964193e8e8f8effe", - "reference": "b2560a0c33f7710e4d7f8780964193e8e8f8effe", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/cdc0db5aed8fbfaf475fbd95bfd7bab83c7a779c", + "reference": "cdc0db5aed8fbfaf475fbd95bfd7bab83c7a779c", "shasum": "" }, "require": { @@ -1785,20 +1819,26 @@ "keywords": [ "tokenizer" ], - "time": "2020-02-07T06:19:00+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-05-06T09:56:31+00:00" }, { "name": "phpunit/phpunit", - "version": "9.1.1", + "version": "9.1.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "848f6521c906500e66229668768576d35de0227e" + "reference": "1b570cd7edbe136055bf5f651857dc8af6b829d2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/848f6521c906500e66229668768576d35de0227e", - "reference": "848f6521c906500e66229668768576d35de0227e", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/1b570cd7edbe136055bf5f651857dc8af6b829d2", + "reference": "1b570cd7edbe136055bf5f651857dc8af6b829d2", "shasum": "" }, "require": { @@ -1818,8 +1858,8 @@ "phpunit/php-file-iterator": "^3.0", "phpunit/php-invoker": "^3.0", "phpunit/php-text-template": "^2.0", - "phpunit/php-timer": "^3.0", - "sebastian/code-unit": "^1.0", + "phpunit/php-timer": "^3.1.4", + "sebastian/code-unit": "^1.0.2", "sebastian/comparator": "^4.0", "sebastian/diff": "^4.0", "sebastian/environment": "^5.0.1", @@ -1831,7 +1871,8 @@ "sebastian/version": "^3.0" }, "require-dev": { - "ext-pdo": "*" + "ext-pdo": "*", + "phpspec/prophecy-phpunit": "^2.0" }, "suggest": { "ext-soap": "*", @@ -1882,7 +1923,58 @@ "type": "github" } ], - "time": "2020-04-03T14:40:04+00:00" + "time": "2020-05-22T13:54:05+00:00" + }, + { + "name": "psalm/plugin-phpunit", + "version": "0.10.1", + "source": { + "type": "git", + "url": "https://github.com/psalm/psalm-plugin-phpunit.git", + "reference": "138998ffd32b76a2e69eb1ff94ef2bf110967273" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/psalm/psalm-plugin-phpunit/zipball/138998ffd32b76a2e69eb1ff94ef2bf110967273", + "reference": "138998ffd32b76a2e69eb1ff94ef2bf110967273", + "shasum": "" + }, + "require": { + "composer/semver": "^1.4", + "ext-simplexml": "*", + "ocramius/package-versions": "^1.3", + "php": "^7.1.3", + "phpunit/phpunit": "^7.5 || ^8.0 || ^9.0", + "vimeo/psalm": "^3.6.2 || dev-master" + }, + "require-dev": { + "codeception/codeception": "^4.0.3", + "squizlabs/php_codesniffer": "^3.3.1", + "weirdan/codeception-psalm-module": "^0.7.1" + }, + "type": "psalm-plugin", + "extra": { + "psalm": { + "pluginClass": "Psalm\\PhpUnitPlugin\\Plugin" + } + }, + "autoload": { + "psr-4": { + "Psalm\\PhpUnitPlugin\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Matt Brown", + "email": "github@muglug.com" + } + ], + "description": "Psalm plugin for PHPUnit", + "time": "2020-05-24T20:30:10+00:00" }, { "name": "psr/log", @@ -1933,16 +2025,16 @@ }, { "name": "sebastian/code-unit", - "version": "1.0.0", + "version": "1.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/code-unit.git", - "reference": "8d8f09bd47c75159921e6e84fdef146343962866" + "reference": "ac958085bc19fcd1d36425c781ef4cbb5b06e2a5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/8d8f09bd47c75159921e6e84fdef146343962866", - "reference": "8d8f09bd47c75159921e6e84fdef146343962866", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/ac958085bc19fcd1d36425c781ef4cbb5b06e2a5", + "reference": "ac958085bc19fcd1d36425c781ef4cbb5b06e2a5", "shasum": "" }, "require": { @@ -1981,7 +2073,7 @@ "type": "github" } ], - "time": "2020-03-30T11:59:20+00:00" + "time": "2020-04-30T05:58:10+00:00" }, { "name": "sebastian/code-unit-reverse-lookup", @@ -2094,16 +2186,16 @@ }, { "name": "sebastian/diff", - "version": "4.0.0", + "version": "4.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "c0c26c9188b538bfa985ae10c9f05d278f12060d" + "reference": "3e523c576f29dacecff309f35e4cc5a5c168e78a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/c0c26c9188b538bfa985ae10c9f05d278f12060d", - "reference": "c0c26c9188b538bfa985ae10c9f05d278f12060d", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/3e523c576f29dacecff309f35e4cc5a5c168e78a", + "reference": "3e523c576f29dacecff309f35e4cc5a5c168e78a", "shasum": "" }, "require": { @@ -2111,7 +2203,7 @@ }, "require-dev": { "phpunit/phpunit": "^9.0", - "symfony/process": "^4 || ^5" + "symfony/process": "^4.2 || ^5" }, "type": "library", "extra": { @@ -2146,20 +2238,26 @@ "unidiff", "unified diff" ], - "time": "2020-02-07T06:09:38+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-05-08T05:01:12+00:00" }, { "name": "sebastian/environment", - "version": "5.0.2", + "version": "5.1.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "c39c1db0a5cffc98173f3de5a17d489d1043fd7b" + "reference": "c753f04d68cd489b6973cf9b4e505e191af3b05c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/c39c1db0a5cffc98173f3de5a17d489d1043fd7b", - "reference": "c39c1db0a5cffc98173f3de5a17d489d1043fd7b", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/c753f04d68cd489b6973cf9b4e505e191af3b05c", + "reference": "c753f04d68cd489b6973cf9b4e505e191af3b05c", "shasum": "" }, "require": { @@ -2205,7 +2303,7 @@ "type": "github" } ], - "time": "2020-03-31T12:14:15+00:00" + "time": "2020-04-14T13:36:52+00:00" }, { "name": "sebastian/exporter", @@ -2913,16 +3011,16 @@ }, { "name": "symfony/polyfill-ctype", - "version": "v1.15.0", + "version": "v1.17.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "4719fa9c18b0464d399f1a63bf624b42b6fa8d14" + "reference": "e94c8b1bbe2bc77507a1056cdb06451c75b427f9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/4719fa9c18b0464d399f1a63bf624b42b6fa8d14", - "reference": "4719fa9c18b0464d399f1a63bf624b42b6fa8d14", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/e94c8b1bbe2bc77507a1056cdb06451c75b427f9", + "reference": "e94c8b1bbe2bc77507a1056cdb06451c75b427f9", "shasum": "" }, "require": { @@ -2934,7 +3032,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.15-dev" + "dev-master": "1.17-dev" } }, "autoload": { @@ -2981,7 +3079,7 @@ "type": "tidelift" } ], - "time": "2020-02-27T09:26:54+00:00" + "time": "2020-05-12T16:14:59+00:00" }, { "name": "symfony/polyfill-mbstring", @@ -3075,8 +3173,8 @@ "authors": [ { "name": "Arne Blankerts", - "role": "Developer", - "email": "arne@blankerts.de" + "email": "arne@blankerts.de", + "role": "Developer" } ], "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", @@ -3084,16 +3182,16 @@ }, { "name": "vimeo/psalm", - "version": "3.11.2", + "version": "3.11.5", "source": { "type": "git", "url": "https://github.com/vimeo/psalm.git", - "reference": "d470903722cfcbc1cd04744c5491d3e6d13ec3d9" + "reference": "3c60609c218d4d4b3b257728b8089094e5c6c6c2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vimeo/psalm/zipball/d470903722cfcbc1cd04744c5491d3e6d13ec3d9", - "reference": "d470903722cfcbc1cd04744c5491d3e6d13ec3d9", + "url": "https://api.github.com/repos/vimeo/psalm/zipball/3c60609c218d4d4b3b257728b8089094e5c6c6c2", + "reference": "3c60609c218d4d4b3b257728b8089094e5c6c6c2", "shasum": "" }, "require": { @@ -3155,8 +3253,7 @@ }, "autoload": { "psr-4": { - "Psalm\\Plugin\\": "src/Psalm/Plugin", - "Psalm\\": "src/Psalm" + "Psalm\\": "src/Psalm/" }, "files": [ "src/functions.php", @@ -3178,20 +3275,20 @@ "inspection", "php" ], - "time": "2020-04-13T12:47:11+00:00" + "time": "2020-05-27T15:12:09+00:00" }, { "name": "webmozart/assert", - "version": "1.7.0", + "version": "1.8.0", "source": { "type": "git", "url": "https://github.com/webmozart/assert.git", - "reference": "aed98a490f9a8f78468232db345ab9cf606cf598" + "reference": "ab2cb0b3b559010b75981b1bdce728da3ee90ad6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozart/assert/zipball/aed98a490f9a8f78468232db345ab9cf606cf598", - "reference": "aed98a490f9a8f78468232db345ab9cf606cf598", + "url": "https://api.github.com/repos/webmozart/assert/zipball/ab2cb0b3b559010b75981b1bdce728da3ee90ad6", + "reference": "ab2cb0b3b559010b75981b1bdce728da3ee90ad6", "shasum": "" }, "require": { @@ -3199,7 +3296,7 @@ "symfony/polyfill-ctype": "^1.8" }, "conflict": { - "vimeo/psalm": "<3.6.0" + "vimeo/psalm": "<3.9.1" }, "require-dev": { "phpunit/phpunit": "^4.8.36 || ^7.5.13" @@ -3226,7 +3323,7 @@ "check", "validate" ], - "time": "2020-02-14T12:15:55+00:00" + "time": "2020-04-18T12:12:48+00:00" }, { "name": "webmozart/glob", diff --git a/phpcs.xml.dist b/phpcs.xml.dist index bf0ef96c117..dc9c9974dd9 100644 --- a/phpcs.xml.dist +++ b/phpcs.xml.dist @@ -113,7 +113,7 @@ - - src/Driver/SQLSrv/SQLSrvStatement.php + + lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvStatement.php diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 98f48e4902c..e61c3bb873f 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -109,6 +109,31 @@ parameters: - message: '~^Call to an undefined method Doctrine\\DBAL\\Driver::createDatabasePlatformForVersion\(\)\.$~' path: %currentWorkingDirectory%/tests/Driver/AbstractDriverTest.php + + # Caused by phpdoc annotations intended for Psalm + - + message: '~Unable to resolve the template type T in call to method static method Doctrine\\DBAL\\DriverManager::getConnection\(\)~' + paths: + - %currentWorkingDirectory%/src/Id/TableGenerator.php + - %currentWorkingDirectory%/src/Schema/SqliteSchemaManager.php + - %currentWorkingDirectory%/tests/ConnectionTest.php + - %currentWorkingDirectory%/tests/DriverManagerTest.php + - %currentWorkingDirectory%/tests/Functional/ConnectionTest.php + - %currentWorkingDirectory%/tests/Functional/Driver/PDOPgsqlConnectionTest.php + - %currentWorkingDirectory%/tests/Functional/Driver/SQLAnywhere/ConnectionTest.php + - %currentWorkingDirectory%/tests/Functional/Driver/SQLAnywhere/StatementTest.php + - %currentWorkingDirectory%/tests/Functional/ExceptionTest.php + - %currentWorkingDirectory%/tests/Functional/MasterSlaveConnectionTest.php + - %currentWorkingDirectory%/tests/Functional/PortabilityTest.php + - %currentWorkingDirectory%/tests/Functional/Schema/MySqlSchemaManagerTest.php + - %currentWorkingDirectory%/tests/Schema/Synchronizer/SingleDatabaseSynchronizerTest.php + - %currentWorkingDirectory%/tests/TestUtil.php + + - + message: '~Method Doctrine\\DBAL\\Driver\\PDOSqlsrv\\Connection\:\:lastInsertId\(\) should return string but returns string\|false\|null\.~' + paths: + - %currentWorkingDirectory%/src/Driver/PDOSqlsrv/Connection.php + includes: - vendor/phpstan/phpstan-phpunit/extension.neon - vendor/phpstan/phpstan-phpunit/rules.neon diff --git a/psalm.xml b/psalm.xml index cd78f08d8b1..559315a2fff 100644 --- a/psalm.xml +++ b/psalm.xml @@ -1,7 +1,7 @@ driverClass: * The driver class to use. * - * @param mixed[] $params The parameters. - * @param Configuration|null $config The configuration to use. - * @param EventManager|null $eventManager The event manager to use. + * @param array{wrapperClass?: class-string} $params + * @param Configuration|null $config The configuration to use. + * @param EventManager|null $eventManager The event manager to use. * * @throws DBALException + * + * @phpstan-param mixed[] $params + * @psalm-return ($params is array{wrapperClass:mixed} ? T : Connection) + * @template T of Connection */ public static function getConnection( array $params, diff --git a/src/Platforms/AbstractPlatform.php b/src/Platforms/AbstractPlatform.php index 92da9c4073b..58b53c71b26 100644 --- a/src/Platforms/AbstractPlatform.php +++ b/src/Platforms/AbstractPlatform.php @@ -746,8 +746,6 @@ public function getSubstringExpression(string $string, string $start, ?string $l /** * Returns a SQL snippet to concatenate the given strings. - * - * @param string[] ...$string */ public function getConcatExpression(string ...$string) : string { diff --git a/src/SQLParserUtils.php b/src/SQLParserUtils.php index 73d09e36505..782ea53fbf4 100644 --- a/src/SQLParserUtils.php +++ b/src/SQLParserUtils.php @@ -100,9 +100,9 @@ private static function collectPlaceholders(string $statement, string $match, st /** * For a positional query this method can rewrite the sql statement with regard to array parameters. * - * @param string $query The SQL query to execute. - * @param mixed[] $params The parameters to bind to the query. - * @param int[]|string[] $types The types the previous parameters are in. + * @param string $query The SQL query to execute. + * @param mixed[] $params The parameters to bind to the query. + * @param array $types The types the previous parameters are in. * * @return mixed[] * diff --git a/tests/ConnectionTest.php b/tests/ConnectionTest.php index 8489bacc49b..6f94bb93df4 100644 --- a/tests/ConnectionTest.php +++ b/tests/ConnectionTest.php @@ -112,9 +112,7 @@ public function testGetDriver() : void public function testConnectDispatchEvent() : void { - $listenerMock = $this->getMockBuilder($this->getMockClass('ConnectDispatchEventListener')) - ->addMethods(['postConnect']) - ->getMock(); + $listenerMock = $this->createMock(ConnectDispatchEventListener::class); $listenerMock->expects(self::once())->method('postConnect'); $eventManager = new EventManager(); @@ -839,3 +837,8 @@ public function testExecuteCacheQueryStripsPlatformFromConnectionParamsBeforeGen $connection->executeCacheQuery($query, [], [], $queryCacheProfile); } } + +interface ConnectDispatchEventListener +{ + public function postConnect() : void; +} diff --git a/tests/Driver/AbstractDriverTest.php b/tests/Driver/AbstractDriverTest.php index 0139651ce5c..94a0a49e87a 100644 --- a/tests/Driver/AbstractDriverTest.php +++ b/tests/Driver/AbstractDriverTest.php @@ -185,9 +185,7 @@ abstract protected function createSchemaManager(Connection $connection) : Abstra */ protected function getConnectionMock() : Connection { - return $this->getMockBuilder(Connection::class) - ->disableOriginalConstructor() - ->getMock(); + return $this->createMock(Connection::class); } /** @@ -199,7 +197,7 @@ protected function getDatabasePlatformsForVersions() : array } /** - * @return mixed[][] + * @return iterable */ public static function exceptionConversionProvider() : iterable { diff --git a/tests/DriverManagerTest.php b/tests/DriverManagerTest.php index d2e051ccb18..f64ac021ac7 100644 --- a/tests/DriverManagerTest.php +++ b/tests/DriverManagerTest.php @@ -69,6 +69,7 @@ public function testCustomWrapper() : void /** * @requires extension pdo_sqlite + * @psalm-suppress InvalidArgument */ public function testInvalidWrapperClass() : void { @@ -158,7 +159,7 @@ public function testDatabaseUrl($url, $expected) : void } /** - * @return array + * @return array> */ public function databaseUrls() : iterable { @@ -257,7 +258,7 @@ public function databaseUrls() : iterable ], ], 'query params from URL are used as extra params' => [ - 'url' => 'mysql://foo:bar@localhost/dbname?charset=UTF-8', + 'mysql://foo:bar@localhost/dbname?charset=UTF-8', ['charset' => 'UTF-8'], ], 'simple URL with fallthrough scheme not defined in map' => [ diff --git a/tests/Functional/DataAccessTest.php b/tests/Functional/DataAccessTest.php index 3f23c1f9b6b..217dbf3ed2c 100644 --- a/tests/Functional/DataAccessTest.php +++ b/tests/Functional/DataAccessTest.php @@ -432,6 +432,7 @@ public function testPrepareQueryBindValueDateTimeType() : void { $sql = 'SELECT count(*) AS c FROM fetch_table WHERE test_datetime = ?'; $stmt = $this->connection->prepare($sql); + self::assertInstanceOf(Statement::class, $stmt); $stmt->bindValue(1, new DateTime('2010-01-01 10:10:10'), Types::DATETIME_MUTABLE); $stmt->execute(); diff --git a/tests/Functional/Platform/DateExpressionTest.php b/tests/Functional/Platform/DateExpressionTest.php index 7a6f37a0870..220d8179839 100644 --- a/tests/Functional/Platform/DateExpressionTest.php +++ b/tests/Functional/Platform/DateExpressionTest.php @@ -34,7 +34,7 @@ public function testDifference(string $date1, string $date2, int $expected) : vo } /** - * @return string[][]|int[][] + * @return array> */ public static function differenceProvider() : iterable { diff --git a/tests/Functional/ResultCacheTest.php b/tests/Functional/ResultCacheTest.php index 19e4391fde6..2aa61f164c6 100644 --- a/tests/Functional/ResultCacheTest.php +++ b/tests/Functional/ResultCacheTest.php @@ -21,7 +21,7 @@ */ class ResultCacheTest extends FunctionalTestCase { - /** @var array> */ + /** @var list */ private $expectedResult = [['test_int' => 100, 'test_string' => 'foo'], ['test_int' => 200, 'test_string' => 'bar'], ['test_int' => 300, 'test_string' => 'baz']]; /** @var DebugStack */ @@ -195,7 +195,7 @@ public function testFetchColumn() : void } /** - * @param array $expectedResult + * @param array>|list $expectedResult */ private function assertCacheNonCacheSelectSameFetchModeAreEqual(array $expectedResult, callable $fetchMode) : void { diff --git a/tests/Functional/Schema/ColumnCommentTest.php b/tests/Functional/Schema/ColumnCommentTest.php index 49a1c21dcc3..ac5e8fe752d 100644 --- a/tests/Functional/Schema/ColumnCommentTest.php +++ b/tests/Functional/Schema/ColumnCommentTest.php @@ -47,7 +47,7 @@ public function testColumnComment(string $name, string $type, array $options) : } /** - * @return mixed[][] + * @return iterable */ public static function columnProvider() : iterable { diff --git a/tests/Functional/Schema/SchemaManagerFunctionalTestCase.php b/tests/Functional/Schema/SchemaManagerFunctionalTestCase.php index 1f3744d6b30..c597c5f64e1 100644 --- a/tests/Functional/Schema/SchemaManagerFunctionalTestCase.php +++ b/tests/Functional/Schema/SchemaManagerFunctionalTestCase.php @@ -353,10 +353,7 @@ public function testListTableColumnsDispatchEvent() : void $this->schemaManager->dropAndCreateTable($table); - $listenerMock = $this->getMockBuilder($this->getMockClass('ListTableColumnsDispatchEventListener')) - ->addMethods(['onSchemaColumnDefinition']) - ->getMock(); - + $listenerMock = $this->createMock(ListTableColumnsDispatchEventListener::class); $listenerMock ->expects(self::exactly(7)) ->method('onSchemaColumnDefinition'); @@ -382,9 +379,7 @@ public function testListTableIndexesDispatchEvent() : void $this->schemaManager->dropAndCreateTable($table); - $listenerMock = $this->getMockBuilder($this->getMockClass('ListTableIndexesDispatchEventListener')) - ->addMethods(['onSchemaIndexDefinition']) - ->getMock(); + $listenerMock = $this->createMock(ListTableIndexesDispatchEventListener::class); $listenerMock ->expects(self::exactly(3)) ->method('onSchemaIndexDefinition'); @@ -1327,3 +1322,13 @@ public function testSchemaDiffForeignKeys() : void } } } + +interface ListTableColumnsDispatchEventListener +{ + public function onSchemaColumnDefinition() : void; +} + +interface ListTableIndexesDispatchEventListener +{ + public function onSchemaIndexDefinition() : void; +} diff --git a/tests/Platforms/AbstractPlatformTestCase.php b/tests/Platforms/AbstractPlatformTestCase.php index 8d89d959b0c..9fdc8b1c581 100644 --- a/tests/Platforms/AbstractPlatformTestCase.php +++ b/tests/Platforms/AbstractPlatformTestCase.php @@ -385,9 +385,7 @@ public function testGetCustomColumnDeclarationSql() : void public function testGetCreateTableSqlDispatchEvent() : void { - $listenerMock = $this->getMockBuilder($this->getMockClass('GetCreateTableSqlDispatchEvenListener')) - ->addMethods(['onSchemaCreateTable', 'onSchemaCreateTableColumn']) - ->getMock(); + $listenerMock = $this->createMock(GetCreateTableSqlDispatchEventListener::class); $listenerMock ->expects(self::once()) ->method('onSchemaCreateTable'); @@ -409,9 +407,7 @@ public function testGetCreateTableSqlDispatchEvent() : void public function testGetDropTableSqlDispatchEvent() : void { - $listenerMock = $this->getMockBuilder($this->getMockClass('GetDropTableSqlDispatchEventListener')) - ->addMethods(['onSchemaDropTable']) - ->getMock(); + $listenerMock = $this->createMock(GetDropTableSqlDispatchEventListener::class); $listenerMock ->expects(self::once()) ->method('onSchemaDropTable'); @@ -426,17 +422,7 @@ public function testGetDropTableSqlDispatchEvent() : void public function testGetAlterTableSqlDispatchEvent() : void { - $events = [ - 'onSchemaAlterTable', - 'onSchemaAlterTableAddColumn', - 'onSchemaAlterTableRemoveColumn', - 'onSchemaAlterTableChangeColumn', - 'onSchemaAlterTableRenameColumn', - ]; - - $listenerMock = $this->getMockBuilder($this->getMockClass('GetAlterTableSqlDispatchEvenListener')) - ->addMethods($events) - ->getMock(); + $listenerMock = $this->createMock(GetAlterTableSqlDispatchEventListener::class); $listenerMock ->expects(self::once()) ->method('onSchemaAlterTable'); @@ -1622,3 +1608,28 @@ public function testZeroOffsetWithoutLimitIsIgnored() : void ); } } + +interface GetCreateTableSqlDispatchEventListener +{ + public function onSchemaCreateTable() : void; + + public function onSchemaCreateTableColumn() : void; +} + +interface GetAlterTableSqlDispatchEventListener +{ + public function onSchemaAlterTable() : void; + + public function onSchemaAlterTableAddColumn() : void; + + public function onSchemaAlterTableRemoveColumn() : void; + + public function onSchemaAlterTableChangeColumn() : void; + + public function onSchemaAlterTableRenameColumn() : void; +} + +interface GetDropTableSqlDispatchEventListener +{ + public function onSchemaDropTable() : void; +} diff --git a/tests/Platforms/AbstractPostgreSQLPlatformTestCase.php b/tests/Platforms/AbstractPostgreSQLPlatformTestCase.php index 29a74770e4c..e586e000425 100644 --- a/tests/Platforms/AbstractPostgreSQLPlatformTestCase.php +++ b/tests/Platforms/AbstractPostgreSQLPlatformTestCase.php @@ -4,6 +4,8 @@ namespace Doctrine\DBAL\Tests\Platforms; +use Doctrine\DBAL\Platforms\AbstractPlatform; +use Doctrine\DBAL\Platforms\PostgreSQL100Platform; use Doctrine\DBAL\Platforms\PostgreSQL94Platform; use Doctrine\DBAL\Schema\Column; use Doctrine\DBAL\Schema\ColumnDiff; @@ -19,9 +21,12 @@ abstract class AbstractPostgreSQLPlatformTestCase extends AbstractPlatformTestCase { - /** @var PostgreSQL94Platform */ + /** @var PostgreSQL94Platform|PostgreSQL100Platform */ protected $platform; + /** @return PostgreSQL94Platform|PostgreSQL100Platform */ + abstract public function createPlatform() : AbstractPlatform; + public function getGenerateTableSql() : string { return 'CREATE TABLE test (id SERIAL NOT NULL, test VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id))'; diff --git a/tests/Platforms/AbstractSQLServerPlatformTestCase.php b/tests/Platforms/AbstractSQLServerPlatformTestCase.php index 2b5d7ba8602..2a6abf258b1 100644 --- a/tests/Platforms/AbstractSQLServerPlatformTestCase.php +++ b/tests/Platforms/AbstractSQLServerPlatformTestCase.php @@ -15,10 +15,12 @@ use Doctrine\DBAL\Schema\TableDiff; use Doctrine\DBAL\TransactionIsolationLevel; use Doctrine\DBAL\Types\Type; -use function assert; abstract class AbstractSQLServerPlatformTestCase extends AbstractPlatformTestCase { + /** @var SQLServer2012Platform */ + protected $platform; + public function getGenerateTableSql() : string { return 'CREATE TABLE test (id INT IDENTITY NOT NULL, test NVARCHAR(255), PRIMARY KEY (id))'; @@ -1083,7 +1085,6 @@ protected function getQuotesDropConstraintSQL() : string */ public function testGeneratesIdentifierNamesInDefaultConstraintDeclarationSQL(string $table, array $column, string $expectedSql) : void { - assert($this->platform instanceof SQLServer2012Platform); self::assertSame($expectedSql, $this->platform->getDefaultConstraintDeclarationSQL($table, $column)); } diff --git a/tests/Platforms/OraclePlatformTest.php b/tests/Platforms/OraclePlatformTest.php index fd5d56e960c..11d26abab0c 100644 --- a/tests/Platforms/OraclePlatformTest.php +++ b/tests/Platforms/OraclePlatformTest.php @@ -18,7 +18,6 @@ use Doctrine\DBAL\TransactionIsolationLevel; use Doctrine\DBAL\Types\Type; use function array_walk; -use function assert; use function preg_replace; use function sprintf; use function strtoupper; @@ -26,6 +25,9 @@ class OraclePlatformTest extends AbstractPlatformTestCase { + /** @var OraclePlatform */ + protected $platform; + /** * @return mixed[][] */ @@ -78,6 +80,9 @@ public function testInvalidIdentifiers(string $identifier) : void OraclePlatform::assertValidIdentifier($identifier); } + /** + * @return OraclePlatform + */ public function createPlatform() : AbstractPlatform { return new OraclePlatform(); @@ -695,8 +700,6 @@ public function getAlterTableRenameColumnSQL() : array */ public function testReturnsDropAutoincrementSQL(string $table, array $expectedSql) : void { - assert($this->platform instanceof OraclePlatform); - self::assertSame($expectedSql, $this->platform->getDropAutoincrementSql($table)); } diff --git a/tests/Platforms/SQLAnywhere16PlatformTest.php b/tests/Platforms/SQLAnywhere16PlatformTest.php index 308bf6146ba..420e0933e62 100644 --- a/tests/Platforms/SQLAnywhere16PlatformTest.php +++ b/tests/Platforms/SQLAnywhere16PlatformTest.php @@ -345,14 +345,14 @@ public function testGeneratesPrimaryKeyDeclarationSQL() : void self::assertEquals( 'CONSTRAINT pk PRIMARY KEY CLUSTERED (a, b)', $this->platform->getPrimaryKeyDeclarationSQL( - new Index(null, ['a', 'b'], true, true, ['clustered']), + new Index('', ['a', 'b'], true, true, ['clustered']), 'pk' ) ); self::assertEquals( 'PRIMARY KEY (a, b)', $this->platform->getPrimaryKeyDeclarationSQL( - new Index(null, ['a', 'b'], true, true) + new Index('', ['a', 'b'], true, true) ) ); } diff --git a/tests/Platforms/SqlitePlatformTest.php b/tests/Platforms/SqlitePlatformTest.php index dd6f9bb4468..18758ed5c28 100644 --- a/tests/Platforms/SqlitePlatformTest.php +++ b/tests/Platforms/SqlitePlatformTest.php @@ -12,10 +12,15 @@ use Doctrine\DBAL\Schema\TableDiff; use Doctrine\DBAL\TransactionIsolationLevel; use Doctrine\DBAL\Types\Type; -use function assert; class SqlitePlatformTest extends AbstractPlatformTestCase { + /** @var SqlitePlatform */ + protected $platform; + + /** + * @return SqlitePlatform + */ public function createPlatform() : AbstractPlatform { return new SqlitePlatform(); @@ -83,8 +88,6 @@ public function testIgnoresUnsignedIntegerDeclarationForAutoIncrementalIntegers( */ public function testGeneratesTypeDeclarationForTinyIntegers() : void { - assert($this->platform instanceof SqlitePlatform); - self::assertEquals( 'TINYINT', $this->platform->getTinyIntTypeDeclarationSQL([]) @@ -115,8 +118,6 @@ public function testGeneratesTypeDeclarationForTinyIntegers() : void */ public function testGeneratesTypeDeclarationForSmallIntegers() : void { - assert($this->platform instanceof SqlitePlatform); - self::assertEquals( 'SMALLINT', $this->platform->getSmallIntTypeDeclarationSQL([]) @@ -151,8 +152,6 @@ public function testGeneratesTypeDeclarationForSmallIntegers() : void */ public function testGeneratesTypeDeclarationForMediumIntegers() : void { - assert($this->platform instanceof SqlitePlatform); - self::assertEquals( 'MEDIUMINT', $this->platform->getMediumIntTypeDeclarationSQL([]) diff --git a/tests/Schema/ComparatorTest.php b/tests/Schema/ComparatorTest.php index ccf3c829c63..b0c772c06ea 100644 --- a/tests/Schema/ComparatorTest.php +++ b/tests/Schema/ComparatorTest.php @@ -875,6 +875,7 @@ public function testChangedSequence() : void /** * @group DBAL-106 + * @psalm-suppress NullArgument */ public function testDiffDecimalWithNullPrecision() : void { diff --git a/tests/Schema/MySqlSchemaManagerTest.php b/tests/Schema/MySqlSchemaManagerTest.php index bce53eb7063..b91d208fd25 100644 --- a/tests/Schema/MySqlSchemaManagerTest.php +++ b/tests/Schema/MySqlSchemaManagerTest.php @@ -20,7 +20,7 @@ class MySqlSchemaManagerTest extends TestCase /** @var AbstractSchemaManager */ private $manager; - /** @var Connection|MockObject */ + /** @var Connection&MockObject */ private $conn; protected function setUp() : void diff --git a/tests/StatementTest.php b/tests/StatementTest.php index 4f20b471f41..1962e667f17 100644 --- a/tests/StatementTest.php +++ b/tests/StatementTest.php @@ -19,13 +19,13 @@ class StatementTest extends TestCase { - /** @var Connection|MockObject */ + /** @var Connection&MockObject */ private $conn; - /** @var Configuration|MockObject */ + /** @var Configuration&MockObject */ private $configuration; - /** @var DriverStatement|MockObject */ + /** @var DriverStatement&MockObject */ private $driverStatement; protected function setUp() : void diff --git a/tests/Tools/Console/RunSqlCommandTest.php b/tests/Tools/Console/RunSqlCommandTest.php index aec2e5d1a35..f95adca89ff 100644 --- a/tests/Tools/Console/RunSqlCommandTest.php +++ b/tests/Tools/Console/RunSqlCommandTest.php @@ -21,7 +21,7 @@ class RunSqlCommandTest extends TestCase /** @var RunSqlCommand */ private $command; - /** @var Connection|MockObject */ + /** @var Connection&MockObject */ private $connectionMock; protected function setUp() : void diff --git a/tests/Types/TypeTest.php b/tests/Types/TypeTest.php index 6746bc7a942..44fa4a5bf53 100644 --- a/tests/Types/TypeTest.php +++ b/tests/Types/TypeTest.php @@ -19,7 +19,7 @@ public function testDefaultTypesAreRegistered(string $name) : void } /** - * @return string[][] + * @return iterable */ public function defaultTypesProvider() : iterable { @@ -28,7 +28,10 @@ public function defaultTypesProvider() : iterable continue; } - yield [$constant->getValue()]; + $constantValue = $constant->getValue(); + self::assertIsString($constantValue); + + yield [$constantValue]; } } }