Unverified Commit 9f2e25c8 authored by Grégoire Paris's avatar Grégoire Paris Committed by GitHub

Merge pull request #3977 from greg0ire/psalm-6

Psalm 6
parents 2348831a 1bc66b34
...@@ -42,9 +42,10 @@ ...@@ -42,9 +42,10 @@
"jetbrains/phpstorm-stubs": "^2019.1", "jetbrains/phpstorm-stubs": "^2019.1",
"nikic/php-parser": "^4.4", "nikic/php-parser": "^4.4",
"phpstan/phpstan": "^0.12", "phpstan/phpstan": "^0.12",
"phpunit/phpunit": "^8.4.1", "phpunit/phpunit": "^8.5.5",
"psalm/plugin-phpunit": "^0.10.0",
"symfony/console": "^2.0.5|^3.0|^4.0|^5.0", "symfony/console": "^2.0.5|^3.0|^4.0|^5.0",
"vimeo/psalm": "^3.11" "vimeo/psalm": "^3.11.4"
}, },
"suggest": { "suggest": {
"symfony/console": "For helpful console commands such as SQL execution and import of files." "symfony/console": "For helpful console commands such as SQL execution and import of files."
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "6bf4905b268231ccd58bdbe30d4ecf81", "content-hash": "0372454a0ee2de4c2051cc13cbb23b72",
"packages": [ "packages": [
{ {
"name": "doctrine/cache", "name": "doctrine/cache",
...@@ -158,16 +158,16 @@ ...@@ -158,16 +158,16 @@
"packages-dev": [ "packages-dev": [
{ {
"name": "amphp/amp", "name": "amphp/amp",
"version": "v2.4.2", "version": "v2.4.4",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/amphp/amp.git", "url": "https://github.com/amphp/amp.git",
"reference": "feca077369a47263b22156b3c6389e55f3809f24" "reference": "1e58d53e4af390efc7813e36cd215bd82cba4b06"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/amphp/amp/zipball/feca077369a47263b22156b3c6389e55f3809f24", "url": "https://api.github.com/repos/amphp/amp/zipball/1e58d53e4af390efc7813e36cd215bd82cba4b06",
"reference": "feca077369a47263b22156b3c6389e55f3809f24", "reference": "1e58d53e4af390efc7813e36cd215bd82cba4b06",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
...@@ -180,7 +180,7 @@ ...@@ -180,7 +180,7 @@
"jetbrains/phpstorm-stubs": "^2019.3", "jetbrains/phpstorm-stubs": "^2019.3",
"phpunit/phpunit": "^6.0.9 | ^7", "phpunit/phpunit": "^6.0.9 | ^7",
"react/promise": "^2", "react/promise": "^2",
"vimeo/psalm": "^3.9@dev" "vimeo/psalm": "^3.11@dev"
}, },
"type": "library", "type": "library",
"extra": { "extra": {
...@@ -232,7 +232,7 @@ ...@@ -232,7 +232,7 @@
"non-blocking", "non-blocking",
"promise" "promise"
], ],
"time": "2020-04-04T15:05:26+00:00" "time": "2020-04-30T04:54:50+00:00"
}, },
{ {
"name": "amphp/byte-stream", "name": "amphp/byte-stream",
...@@ -683,25 +683,30 @@ ...@@ -683,25 +683,30 @@
}, },
{ {
"name": "jetbrains/phpstorm-stubs", "name": "jetbrains/phpstorm-stubs",
"version": "v2019.1", "version": "v2019.3",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/JetBrains/phpstorm-stubs.git", "url": "https://github.com/JetBrains/phpstorm-stubs.git",
"reference": "9e309771f362e979ecfb429303ad7a402c657234" "reference": "883b6facd78e01c0743b554af86fa590c2573f40"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/JetBrains/phpstorm-stubs/zipball/9e309771f362e979ecfb429303ad7a402c657234", "url": "https://api.github.com/repos/JetBrains/phpstorm-stubs/zipball/883b6facd78e01c0743b554af86fa590c2573f40",
"reference": "9e309771f362e979ecfb429303ad7a402c657234", "reference": "883b6facd78e01c0743b554af86fa590c2573f40",
"shasum": "" "shasum": ""
}, },
"require-dev": { "require-dev": {
"nikic/php-parser": "v4.0.1", "nikic/php-parser": "^4",
"php": "^7.1", "php": "^7.1",
"phpdocumentor/reflection-docblock": "^4.3", "phpdocumentor/reflection-docblock": "^4.3",
"phpunit/phpunit": "7.1.4" "phpunit/phpunit": "^7"
}, },
"type": "library", "type": "library",
"autoload": {
"files": [
"PhpStormStubsMap.php"
]
},
"notification-url": "https://packagist.org/downloads/", "notification-url": "https://packagist.org/downloads/",
"license": [ "license": [
"Apache-2.0" "Apache-2.0"
...@@ -718,7 +723,7 @@ ...@@ -718,7 +723,7 @@
"stubs", "stubs",
"type" "type"
], ],
"time": "2019-03-25T16:59:23+00:00" "time": "2019-12-05T16:56:26+00:00"
}, },
{ {
"name": "myclabs/deep-copy", "name": "myclabs/deep-copy",
...@@ -770,16 +775,16 @@ ...@@ -770,16 +775,16 @@
}, },
{ {
"name": "netresearch/jsonmapper", "name": "netresearch/jsonmapper",
"version": "v2.0.0", "version": "v2.1.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/cweiske/jsonmapper.git", "url": "https://github.com/cweiske/jsonmapper.git",
"reference": "e245890383c3ed38b6d202ee373c23ccfebc0f54" "reference": "e0f1e33a71587aca81be5cffbb9746510e1fe04e"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/cweiske/jsonmapper/zipball/e245890383c3ed38b6d202ee373c23ccfebc0f54", "url": "https://api.github.com/repos/cweiske/jsonmapper/zipball/e0f1e33a71587aca81be5cffbb9746510e1fe04e",
"reference": "e245890383c3ed38b6d202ee373c23ccfebc0f54", "reference": "e0f1e33a71587aca81be5cffbb9746510e1fe04e",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
...@@ -812,7 +817,7 @@ ...@@ -812,7 +817,7 @@
} }
], ],
"description": "Map nested JSON structures onto PHP classes", "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", "name": "nikic/php-parser",
...@@ -1069,24 +1074,21 @@ ...@@ -1069,24 +1074,21 @@
}, },
{ {
"name": "phpdocumentor/reflection-common", "name": "phpdocumentor/reflection-common",
"version": "2.0.0", "version": "2.1.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/phpDocumentor/ReflectionCommon.git", "url": "https://github.com/phpDocumentor/ReflectionCommon.git",
"reference": "63a995caa1ca9e5590304cd845c15ad6d482a62a" "reference": "6568f4687e5b41b054365f9ae03fcb1ed5f2069b"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/63a995caa1ca9e5590304cd845c15ad6d482a62a", "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/6568f4687e5b41b054365f9ae03fcb1ed5f2069b",
"reference": "63a995caa1ca9e5590304cd845c15ad6d482a62a", "reference": "6568f4687e5b41b054365f9ae03fcb1ed5f2069b",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=7.1" "php": ">=7.1"
}, },
"require-dev": {
"phpunit/phpunit": "~6"
},
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
...@@ -1117,44 +1119,42 @@ ...@@ -1117,44 +1119,42 @@
"reflection", "reflection",
"static analysis" "static analysis"
], ],
"time": "2018-08-07T13:53:10+00:00" "time": "2020-04-27T09:25:28+00:00"
}, },
{ {
"name": "phpdocumentor/reflection-docblock", "name": "phpdocumentor/reflection-docblock",
"version": "4.3.2", "version": "5.1.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git",
"reference": "b83ff7cfcfee7827e1e78b637a5904fe6a96698e" "reference": "cd72d394ca794d3466a3b2fc09d5a6c1dc86b47e"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/b83ff7cfcfee7827e1e78b637a5904fe6a96698e", "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/cd72d394ca794d3466a3b2fc09d5a6c1dc86b47e",
"reference": "b83ff7cfcfee7827e1e78b637a5904fe6a96698e", "reference": "cd72d394ca794d3466a3b2fc09d5a6c1dc86b47e",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": "^7.0", "ext-filter": "^7.1",
"phpdocumentor/reflection-common": "^1.0.0 || ^2.0.0", "php": "^7.2",
"phpdocumentor/type-resolver": "~0.4 || ^1.0.0", "phpdocumentor/reflection-common": "^2.0",
"webmozart/assert": "^1.0" "phpdocumentor/type-resolver": "^1.0",
"webmozart/assert": "^1"
}, },
"require-dev": { "require-dev": {
"doctrine/instantiator": "^1.0.5", "doctrine/instantiator": "^1",
"mockery/mockery": "^1.0", "mockery/mockery": "^1"
"phpunit/phpunit": "^6.4"
}, },
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "4.x-dev" "dev-master": "5.x-dev"
} }
}, },
"autoload": { "autoload": {
"psr-4": { "psr-4": {
"phpDocumentor\\Reflection\\": [ "phpDocumentor\\Reflection\\": "src"
"src/"
]
} }
}, },
"notification-url": "https://packagist.org/downloads/", "notification-url": "https://packagist.org/downloads/",
...@@ -1165,33 +1165,36 @@ ...@@ -1165,33 +1165,36 @@
{ {
"name": "Mike van Riel", "name": "Mike van Riel",
"email": "me@mikevanriel.com" "email": "me@mikevanriel.com"
},
{
"name": "Jaap van Otterdijk",
"email": "account@ijaap.nl"
} }
], ],
"description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.",
"time": "2019-09-12T14:27:41+00:00" "time": "2020-02-22T12:28:44+00:00"
}, },
{ {
"name": "phpdocumentor/type-resolver", "name": "phpdocumentor/type-resolver",
"version": "1.0.1", "version": "1.1.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/phpDocumentor/TypeResolver.git", "url": "https://github.com/phpDocumentor/TypeResolver.git",
"reference": "2e32a6d48972b2c1976ed5d8967145b6cec4a4a9" "reference": "7462d5f123dfc080dfdf26897032a6513644fc95"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/2e32a6d48972b2c1976ed5d8967145b6cec4a4a9", "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/7462d5f123dfc080dfdf26897032a6513644fc95",
"reference": "2e32a6d48972b2c1976ed5d8967145b6cec4a4a9", "reference": "7462d5f123dfc080dfdf26897032a6513644fc95",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": "^7.1", "php": "^7.2",
"phpdocumentor/reflection-common": "^2.0" "phpdocumentor/reflection-common": "^2.0"
}, },
"require-dev": { "require-dev": {
"ext-tokenizer": "^7.1", "ext-tokenizer": "^7.2",
"mockery/mockery": "~1", "mockery/mockery": "~1"
"phpunit/phpunit": "^7.0"
}, },
"type": "library", "type": "library",
"extra": { "extra": {
...@@ -1215,7 +1218,7 @@ ...@@ -1215,7 +1218,7 @@
} }
], ],
"description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names",
"time": "2019-08-22T18:11:29+00:00" "time": "2020-02-18T18:59:58+00:00"
}, },
{ {
"name": "phpspec/prophecy", "name": "phpspec/prophecy",
...@@ -1622,16 +1625,16 @@ ...@@ -1622,16 +1625,16 @@
}, },
{ {
"name": "phpunit/phpunit", "name": "phpunit/phpunit",
"version": "8.4.1", "version": "8.5.5",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git", "url": "https://github.com/sebastianbergmann/phpunit.git",
"reference": "366a4a0f2b971fd43b7c351d621e8dd7d7131869" "reference": "63dda3b212a0025d380a745f91bdb4d8c985adb7"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/366a4a0f2b971fd43b7c351d621e8dd7d7131869", "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/63dda3b212a0025d380a745f91bdb4d8c985adb7",
"reference": "366a4a0f2b971fd43b7c351d621e8dd7d7131869", "reference": "63dda3b212a0025d380a745f91bdb4d8c985adb7",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
...@@ -1675,7 +1678,7 @@ ...@@ -1675,7 +1678,7 @@
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "8.4-dev" "dev-master": "8.5-dev"
} }
}, },
"autoload": { "autoload": {
...@@ -1701,7 +1704,68 @@ ...@@ -1701,7 +1704,68 @@
"testing", "testing",
"xunit" "xunit"
], ],
"time": "2019-10-07T12:57:41+00:00" "funding": [
{
"url": "https://phpunit.de/donate.html",
"type": "custom"
},
{
"url": "https://github.com/sebastianbergmann",
"type": "github"
}
],
"time": "2020-05-22T13:51:52+00:00"
},
{
"name": "psalm/plugin-phpunit",
"version": "0.10.0",
"source": {
"type": "git",
"url": "https://github.com/psalm/psalm-plugin-phpunit.git",
"reference": "12b3978cea0e9ad3aa3a127a93d3b8a1ce0eb2af"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/psalm/psalm-plugin-phpunit/zipball/12b3978cea0e9ad3aa3a127a93d3b8a1ce0eb2af",
"reference": "12b3978cea0e9ad3aa3a127a93d3b8a1ce0eb2af",
"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.4.0"
},
"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-04-05T22:49:26+00:00"
}, },
{ {
"name": "psr/container", "name": "psr/container",
...@@ -1754,16 +1818,16 @@ ...@@ -1754,16 +1818,16 @@
}, },
{ {
"name": "psr/log", "name": "psr/log",
"version": "1.1.2", "version": "1.1.3",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/php-fig/log.git", "url": "https://github.com/php-fig/log.git",
"reference": "446d54b4cb6bf489fc9d75f55843658e6f25d801" "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/php-fig/log/zipball/446d54b4cb6bf489fc9d75f55843658e6f25d801", "url": "https://api.github.com/repos/php-fig/log/zipball/0f73288fd15629204f9d42b7055f72dacbe811fc",
"reference": "446d54b4cb6bf489fc9d75f55843658e6f25d801", "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
...@@ -1797,7 +1861,7 @@ ...@@ -1797,7 +1861,7 @@
"psr", "psr",
"psr-3" "psr-3"
], ],
"time": "2019-11-01T11:05:21+00:00" "time": "2020-03-23T09:12:05+00:00"
}, },
{ {
"name": "sebastian/code-unit-reverse-lookup", "name": "sebastian/code-unit-reverse-lookup",
...@@ -2656,16 +2720,16 @@ ...@@ -2656,16 +2720,16 @@
}, },
{ {
"name": "symfony/polyfill-ctype", "name": "symfony/polyfill-ctype",
"version": "v1.12.0", "version": "v1.17.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/polyfill-ctype.git", "url": "https://github.com/symfony/polyfill-ctype.git",
"reference": "550ebaac289296ce228a706d0867afc34687e3f4" "reference": "e94c8b1bbe2bc77507a1056cdb06451c75b427f9"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/550ebaac289296ce228a706d0867afc34687e3f4", "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/e94c8b1bbe2bc77507a1056cdb06451c75b427f9",
"reference": "550ebaac289296ce228a706d0867afc34687e3f4", "reference": "e94c8b1bbe2bc77507a1056cdb06451c75b427f9",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
...@@ -2677,7 +2741,7 @@ ...@@ -2677,7 +2741,7 @@
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "1.12-dev" "dev-master": "1.17-dev"
} }
}, },
"autoload": { "autoload": {
...@@ -2710,7 +2774,21 @@ ...@@ -2710,7 +2774,21 @@
"polyfill", "polyfill",
"portable" "portable"
], ],
"time": "2019-08-06T08:03:45+00:00" "funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-05-12T16:14:59+00:00"
}, },
{ {
"name": "symfony/polyfill-mbstring", "name": "symfony/polyfill-mbstring",
...@@ -2929,16 +3007,16 @@ ...@@ -2929,16 +3007,16 @@
}, },
{ {
"name": "vimeo/psalm", "name": "vimeo/psalm",
"version": "3.11.2", "version": "3.11.5",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/vimeo/psalm.git", "url": "https://github.com/vimeo/psalm.git",
"reference": "d470903722cfcbc1cd04744c5491d3e6d13ec3d9" "reference": "3c60609c218d4d4b3b257728b8089094e5c6c6c2"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/vimeo/psalm/zipball/d470903722cfcbc1cd04744c5491d3e6d13ec3d9", "url": "https://api.github.com/repos/vimeo/psalm/zipball/3c60609c218d4d4b3b257728b8089094e5c6c6c2",
"reference": "d470903722cfcbc1cd04744c5491d3e6d13ec3d9", "reference": "3c60609c218d4d4b3b257728b8089094e5c6c6c2",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
...@@ -3000,8 +3078,7 @@ ...@@ -3000,8 +3078,7 @@
}, },
"autoload": { "autoload": {
"psr-4": { "psr-4": {
"Psalm\\Plugin\\": "src/Psalm/Plugin", "Psalm\\": "src/Psalm/"
"Psalm\\": "src/Psalm"
}, },
"files": [ "files": [
"src/functions.php", "src/functions.php",
...@@ -3023,35 +3100,33 @@ ...@@ -3023,35 +3100,33 @@
"inspection", "inspection",
"php" "php"
], ],
"time": "2020-04-13T12:47:11+00:00" "time": "2020-05-27T15:12:09+00:00"
}, },
{ {
"name": "webmozart/assert", "name": "webmozart/assert",
"version": "1.5.0", "version": "1.8.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/webmozart/assert.git", "url": "https://github.com/webmozart/assert.git",
"reference": "88e6d84706d09a236046d686bbea96f07b3a34f4" "reference": "ab2cb0b3b559010b75981b1bdce728da3ee90ad6"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/webmozart/assert/zipball/88e6d84706d09a236046d686bbea96f07b3a34f4", "url": "https://api.github.com/repos/webmozart/assert/zipball/ab2cb0b3b559010b75981b1bdce728da3ee90ad6",
"reference": "88e6d84706d09a236046d686bbea96f07b3a34f4", "reference": "ab2cb0b3b559010b75981b1bdce728da3ee90ad6",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": "^5.3.3 || ^7.0", "php": "^5.3.3 || ^7.0",
"symfony/polyfill-ctype": "^1.8" "symfony/polyfill-ctype": "^1.8"
}, },
"conflict": {
"vimeo/psalm": "<3.9.1"
},
"require-dev": { "require-dev": {
"phpunit/phpunit": "^4.8.36 || ^7.5.13" "phpunit/phpunit": "^4.8.36 || ^7.5.13"
}, },
"type": "library", "type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.3-dev"
}
},
"autoload": { "autoload": {
"psr-4": { "psr-4": {
"Webmozart\\Assert\\": "src/" "Webmozart\\Assert\\": "src/"
...@@ -3073,7 +3148,7 @@ ...@@ -3073,7 +3148,7 @@
"check", "check",
"validate" "validate"
], ],
"time": "2019-08-24T08:43:50+00:00" "time": "2020-04-18T12:12:48+00:00"
}, },
{ {
"name": "webmozart/glob", "name": "webmozart/glob",
......
...@@ -1035,8 +1035,8 @@ class Connection implements DriverConnection ...@@ -1035,8 +1035,8 @@ class Connection implements DriverConnection
* This method supports PDO binding types as well as DBAL mapping types. * This method supports PDO binding types as well as DBAL mapping types.
* *
* @param string $query The SQL query. * @param string $query The SQL query.
* @param mixed[] $params The query parameters. * @param array<mixed> $params The query parameters.
* @param int[]|string[] $types The parameter types. * @param array<int|string|null> $types The parameter types.
* *
* @return int The number of affected rows. * @return int The number of affected rows.
* *
......
...@@ -33,6 +33,8 @@ class Driver extends \Doctrine\DBAL\Driver\PDOMySql\Driver ...@@ -33,6 +33,8 @@ class Driver extends \Doctrine\DBAL\Driver\PDOMySql\Driver
/** /**
* {@inheritdoc} * {@inheritdoc}
*
* @return DrizzlePlatform
*/ */
public function getDatabasePlatform() public function getDatabasePlatform()
{ {
...@@ -41,6 +43,8 @@ class Driver extends \Doctrine\DBAL\Driver\PDOMySql\Driver ...@@ -41,6 +43,8 @@ class Driver extends \Doctrine\DBAL\Driver\PDOMySql\Driver
/** /**
* {@inheritdoc} * {@inheritdoc}
*
* @return DrizzleSchemaManager
*/ */
public function getSchemaManager(\Doctrine\DBAL\Connection $conn) public function getSchemaManager(\Doctrine\DBAL\Connection $conn)
{ {
......
...@@ -200,6 +200,8 @@ class MysqliConnection implements Connection, PingableConnection, ServerInfoAwar ...@@ -200,6 +200,8 @@ class MysqliConnection implements Connection, PingableConnection, ServerInfoAwar
/** /**
* {@inheritdoc} * {@inheritdoc}
*
* @return int
*/ */
public function errorCode() public function errorCode()
{ {
...@@ -208,6 +210,8 @@ class MysqliConnection implements Connection, PingableConnection, ServerInfoAwar ...@@ -208,6 +210,8 @@ class MysqliConnection implements Connection, PingableConnection, ServerInfoAwar
/** /**
* {@inheritdoc} * {@inheritdoc}
*
* @return string
*/ */
public function errorInfo() public function errorInfo()
{ {
......
...@@ -401,6 +401,8 @@ class MysqliStatement implements IteratorAggregate, Statement ...@@ -401,6 +401,8 @@ class MysqliStatement implements IteratorAggregate, Statement
/** /**
* {@inheritdoc} * {@inheritdoc}
*
* @return string
*/ */
public function errorInfo() public function errorInfo()
{ {
......
...@@ -148,6 +148,8 @@ class OCI8Connection implements Connection, ServerInfoAwareConnection ...@@ -148,6 +148,8 @@ class OCI8Connection implements Connection, ServerInfoAwareConnection
/** /**
* {@inheritdoc} * {@inheritdoc}
*
* @return int|false
*/ */
public function lastInsertId($name = null) public function lastInsertId($name = null)
{ {
......
...@@ -56,12 +56,15 @@ class PDOConnection extends PDO implements Connection, ServerInfoAwareConnection ...@@ -56,12 +56,15 @@ class PDOConnection extends PDO implements Connection, ServerInfoAwareConnection
* @param string $prepareString * @param string $prepareString
* @param array<int, int> $driverOptions * @param array<int, int> $driverOptions
* *
* @return Statement * @return \PDOStatement
*/ */
public function prepare($prepareString, $driverOptions = []) public function prepare($prepareString, $driverOptions = [])
{ {
try { try {
return parent::prepare($prepareString, $driverOptions); $statement = parent::prepare($prepareString, $driverOptions);
assert($statement instanceof \PDOStatement);
return $statement;
} catch (\PDOException $exception) { } catch (\PDOException $exception) {
throw new PDOException($exception); throw new PDOException($exception);
} }
...@@ -69,6 +72,8 @@ class PDOConnection extends PDO implements Connection, ServerInfoAwareConnection ...@@ -69,6 +72,8 @@ class PDOConnection extends PDO implements Connection, ServerInfoAwareConnection
/** /**
* {@inheritdoc} * {@inheritdoc}
*
* @return \PDOStatement
*/ */
public function query() public function query()
{ {
......
...@@ -115,11 +115,15 @@ final class DriverManager ...@@ -115,11 +115,15 @@ final class DriverManager
* <b>driverClass</b>: * <b>driverClass</b>:
* The driver class to use. * The driver class to use.
* *
* @param mixed[] $params The parameters. * @param array{wrapperClass?: class-string<T>} $params
* @param Configuration|null $config The configuration to use. * @param Configuration|null $config The configuration to use.
* @param EventManager|null $eventManager The event manager to use. * @param EventManager|null $eventManager The event manager to use.
* *
* @throws DBALException * @throws DBALException
*
* @phpstan-param mixed[] $params
* @psalm-return ($params is array{wrapperClass:mixed} ? T : Connection)
* @template T of Connection
*/ */
public static function getConnection( public static function getConnection(
array $params, array $params,
......
...@@ -12,7 +12,7 @@ interface SQLLogger ...@@ -12,7 +12,7 @@ interface SQLLogger
* *
* @param string $sql The SQL to be executed. * @param string $sql The SQL to be executed.
* @param mixed[]|null $params The SQL parameters. * @param mixed[]|null $params The SQL parameters.
* @param int[]|string[]|null $types The SQL parameter types. * @param array<int|string|null> $types The SQL parameter types.
* *
* @return void * @return void
*/ */
......
...@@ -2817,7 +2817,7 @@ abstract class AbstractPlatform ...@@ -2817,7 +2817,7 @@ abstract class AbstractPlatform
/** /**
* @param string $table * @param string $table
* @param string|null $database * @param string $database
* *
* @return string * @return string
* *
......
...@@ -108,6 +108,8 @@ class Connection extends \Doctrine\DBAL\Connection ...@@ -108,6 +108,8 @@ class Connection extends \Doctrine\DBAL\Connection
/** /**
* {@inheritdoc} * {@inheritdoc}
*
* @return Statement
*/ */
public function prepare($statement) public function prepare($statement)
{ {
......
...@@ -120,7 +120,7 @@ class SQLParserUtils ...@@ -120,7 +120,7 @@ class SQLParserUtils
* *
* @param string $query The SQL query to execute. * @param string $query The SQL query to execute.
* @param mixed[] $params The parameters to bind to the query. * @param mixed[] $params The parameters to bind to the query.
* @param int[]|string[] $types The types the previous parameters are in. * @param array<string|int|null> $types The types the previous parameters are in.
* *
* @return mixed[] * @return mixed[]
* *
......
...@@ -83,3 +83,15 @@ parameters: ...@@ -83,3 +83,15 @@ parameters:
# Needs Generics # Needs Generics
- '~Method Doctrine\\DBAL\\Schema\\SchemaDiff::getNewTablesSortedByDependencies\(\) should return array<Doctrine\\DBAL\\Schema\\Table> but returns array<object>.~' - '~Method Doctrine\\DBAL\\Schema\\SchemaDiff::getNewTablesSortedByDependencies\(\) should return array<Doctrine\\DBAL\\Schema\\Table> but returns array<object>.~'
# 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%/lib/Doctrine/DBAL/Id/TableGenerator.php
- %currentWorkingDirectory%/lib/Doctrine/DBAL/Schema/SqliteSchemaManager.php
-
message: '~Method Doctrine\\DBAL\\Driver\\PDOSqlsrv\\Connection\:\:lastInsertId\(\) should return string but returns string\|false\|null\.~'
paths:
- %currentWorkingDirectory%/lib/Doctrine/DBAL/Driver/PDOSqlsrv/Connection.php
<?xml version="1.0"?> <?xml version="1.0"?>
<psalm <psalm
totallyTyped="false" totallyTyped="false"
errorLevel="7" errorLevel="6"
resolveFromConfigFile="true" resolveFromConfigFile="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://getpsalm.org/schema/config" xmlns="https://getpsalm.org/schema/config"
......
...@@ -21,7 +21,7 @@ class QueryCacheProfileTest extends DbalTestCase ...@@ -21,7 +21,7 @@ class QueryCacheProfileTest extends DbalTestCase
/** @var int[] */ /** @var int[] */
private $params = [666]; private $params = [666];
/** @var string[] */ /** @var int[] */
private $types = [ParameterType::INTEGER]; private $types = [ParameterType::INTEGER];
/** @var string[] */ /** @var string[] */
......
...@@ -22,7 +22,6 @@ use Doctrine\DBAL\Logging\DebugStack; ...@@ -22,7 +22,6 @@ use Doctrine\DBAL\Logging\DebugStack;
use Doctrine\DBAL\Logging\EchoSQLLogger; use Doctrine\DBAL\Logging\EchoSQLLogger;
use Doctrine\DBAL\ParameterType; use Doctrine\DBAL\ParameterType;
use Doctrine\DBAL\Platforms\AbstractPlatform; use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\VersionAwarePlatformDriver;
use Doctrine\Tests\DbalTestCase; use Doctrine\Tests\DbalTestCase;
use Exception; use Exception;
use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\MockObject\MockObject;
...@@ -145,9 +144,7 @@ class ConnectionTest extends DbalTestCase ...@@ -145,9 +144,7 @@ class ConnectionTest extends DbalTestCase
public function testConnectDispatchEvent() : void public function testConnectDispatchEvent() : void
{ {
$listenerMock = $this->getMockBuilder($this->getMockClass('ConnectDispatchEventListener')) $listenerMock = $this->createMock(ConnectDispatchEventListener::class);
->addMethods(['postConnect'])
->getMock();
$listenerMock->expects($this->once())->method('postConnect'); $listenerMock->expects($this->once())->method('postConnect');
$eventManager = new EventManager(); $eventManager = new EventManager();
...@@ -762,7 +759,7 @@ class ConnectionTest extends DbalTestCase ...@@ -762,7 +759,7 @@ class ConnectionTest extends DbalTestCase
*/ */
public function testPlatformDetectionIsTriggerOnlyOnceOnRetrievingPlatform() : void public function testPlatformDetectionIsTriggerOnlyOnceOnRetrievingPlatform() : void
{ {
$driverMock = $this->createMock([Driver::class, VersionAwarePlatformDriver::class]); $driverMock = $this->createMock(FutureVersionAwarePlatformDriver::class);
$driverConnectionMock = $this->createMock(ServerInfoAwareConnection::class); $driverConnectionMock = $this->createMock(ServerInfoAwareConnection::class);
...@@ -883,7 +880,7 @@ class ConnectionTest extends DbalTestCase ...@@ -883,7 +880,7 @@ class ConnectionTest extends DbalTestCase
*/ */
public function testRethrowsOriginalExceptionOnDeterminingPlatformWhenConnectingToNonExistentDatabase() : void public function testRethrowsOriginalExceptionOnDeterminingPlatformWhenConnectingToNonExistentDatabase() : void
{ {
$driverMock = $this->createMock([Driver::class, VersionAwarePlatformDriver::class]); $driverMock = $this->createMock(FutureVersionAwarePlatformDriver::class);
$connection = new Connection(['dbname' => 'foo'], $driverMock); $connection = new Connection(['dbname' => 'foo'], $driverMock);
$originalException = new Exception('Original exception'); $originalException = new Exception('Original exception');
...@@ -949,3 +946,8 @@ class ConnectionTest extends DbalTestCase ...@@ -949,3 +946,8 @@ class ConnectionTest extends DbalTestCase
$connection->executeCacheQuery($query, [], [], $queryCacheProfile); $connection->executeCacheQuery($query, [], [], $queryCacheProfile);
} }
} }
interface ConnectDispatchEventListener
{
public function postConnect() : void;
}
...@@ -28,6 +28,7 @@ use Doctrine\DBAL\Platforms\AbstractPlatform; ...@@ -28,6 +28,7 @@ use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\Schema\AbstractSchemaManager; use Doctrine\DBAL\Schema\AbstractSchemaManager;
use Doctrine\DBAL\VersionAwarePlatformDriver; use Doctrine\DBAL\VersionAwarePlatformDriver;
use Doctrine\Tests\DbalTestCase; use Doctrine\Tests\DbalTestCase;
use PHPUnit\Framework\MockObject\MockObject;
use ReflectionProperty; use ReflectionProperty;
use function array_merge; use function array_merge;
use function get_class; use function get_class;
...@@ -198,11 +199,12 @@ abstract class AbstractDriverTest extends DbalTestCase ...@@ -198,11 +199,12 @@ abstract class AbstractDriverTest extends DbalTestCase
*/ */
abstract protected function createSchemaManager(Connection $connection) : AbstractSchemaManager; abstract protected function createSchemaManager(Connection $connection) : AbstractSchemaManager;
/**
* @return Connection&MockObject
*/
protected function getConnectionMock() : Connection protected function getConnectionMock() : Connection
{ {
return $this->getMockBuilder(Connection::class) return $this->createMock(Connection::class);
->disableOriginalConstructor()
->getMock();
} }
/** /**
...@@ -214,7 +216,7 @@ abstract class AbstractDriverTest extends DbalTestCase ...@@ -214,7 +216,7 @@ abstract class AbstractDriverTest extends DbalTestCase
} }
/** /**
* @return mixed[][] * @return iterable<mixed[]>
*/ */
public static function exceptionConversionProvider() : iterable public static function exceptionConversionProvider() : iterable
{ {
......
...@@ -43,6 +43,8 @@ class StatementIteratorTest extends DbalTestCase ...@@ -43,6 +43,8 @@ class StatementIteratorTest extends DbalTestCase
} }
/** /**
* @param class-string<Statement> $class
*
* @dataProvider statementProvider() * @dataProvider statementProvider()
*/ */
public function testStatementIterationCallsFetchOncePerStep(string $class) : void public function testStatementIterationCallsFetchOncePerStep(string $class) : void
...@@ -80,7 +82,7 @@ class StatementIteratorTest extends DbalTestCase ...@@ -80,7 +82,7 @@ class StatementIteratorTest extends DbalTestCase
} }
/** /**
* @return string[][] * @return iterable<array{0: class-string<Statement>}>
*/ */
public static function statementProvider() : iterable public static function statementProvider() : iterable
{ {
......
...@@ -107,6 +107,7 @@ class DriverManagerTest extends DbalTestCase ...@@ -107,6 +107,7 @@ class DriverManagerTest extends DbalTestCase
/** /**
* @requires extension pdo_sqlite * @requires extension pdo_sqlite
* @psalm-suppress InvalidArgument
*/ */
public function testInvalidWrapperClass() : void public function testInvalidWrapperClass() : void
{ {
...@@ -242,7 +243,7 @@ class DriverManagerTest extends DbalTestCase ...@@ -242,7 +243,7 @@ class DriverManagerTest extends DbalTestCase
} }
/** /**
* @return array<string, array<int, mixed>> * @return array<string, list<mixed>>
*/ */
public function databaseUrls() : iterable public function databaseUrls() : iterable
{ {
...@@ -341,7 +342,7 @@ class DriverManagerTest extends DbalTestCase ...@@ -341,7 +342,7 @@ class DriverManagerTest extends DbalTestCase
], ],
], ],
'query params from URL are used as extra params' => [ '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'], ['charset' => 'UTF-8'],
], ],
'simple URL with fallthrough scheme not defined in map' => [ 'simple URL with fallthrough scheme not defined in map' => [
......
...@@ -27,7 +27,7 @@ class StatementTest extends DbalFunctionalTestCase ...@@ -27,7 +27,7 @@ class StatementTest extends DbalFunctionalTestCase
public function testFailureToPrepareResultsInException() : void public function testFailureToPrepareResultsInException() : void
{ {
// use the driver connection directly to avoid having exception wrapped // use the driver connection directly to avoid having exception wrapped
$stmt = $this->connection->getWrappedConnection()->prepare(null); $stmt = $this->connection->getWrappedConnection()->prepare('');
// it's impossible to prepare the statement without bound variables for SQL Server, // it's impossible to prepare the statement without bound variables for SQL Server,
// so the preparation happens before the first execution when variables are already in place // so the preparation happens before the first execution when variables are already in place
......
...@@ -21,7 +21,7 @@ use const CASE_LOWER; ...@@ -21,7 +21,7 @@ use const CASE_LOWER;
*/ */
class ResultCacheTest extends DbalFunctionalTestCase class ResultCacheTest extends DbalFunctionalTestCase
{ {
/** @var array<int, array<int, int|string>> */ /** @var list<array{test_int: int, test_string: string}> */
private $expectedResult = [['test_int' => 100, 'test_string' => 'foo'], ['test_int' => 200, 'test_string' => 'bar'], ['test_int' => 300, 'test_string' => 'baz']]; private $expectedResult = [['test_int' => 100, 'test_string' => 'foo'], ['test_int' => 200, 'test_string' => 'bar'], ['test_int' => 300, 'test_string' => 'baz']];
/** @var DebugStack */ /** @var DebugStack */
...@@ -195,7 +195,7 @@ class ResultCacheTest extends DbalFunctionalTestCase ...@@ -195,7 +195,7 @@ class ResultCacheTest extends DbalFunctionalTestCase
} }
/** /**
* @param array<int, array<int, int|string>> $expectedResult * @param array<int, array<int, int|string>>|list<int> $expectedResult
*/ */
private function assertCacheNonCacheSelectSameFetchModeAreEqual(array $expectedResult, int $fetchMode) : void private function assertCacheNonCacheSelectSameFetchModeAreEqual(array $expectedResult, int $fetchMode) : void
{ {
......
...@@ -7,6 +7,7 @@ use Doctrine\DBAL\Platforms\PostgreSQL94Platform; ...@@ -7,6 +7,7 @@ use Doctrine\DBAL\Platforms\PostgreSQL94Platform;
use Doctrine\DBAL\Schema; use Doctrine\DBAL\Schema;
use Doctrine\DBAL\Schema\Comparator; use Doctrine\DBAL\Schema\Comparator;
use Doctrine\DBAL\Schema\ForeignKeyConstraint; use Doctrine\DBAL\Schema\ForeignKeyConstraint;
use Doctrine\DBAL\Schema\PostgreSqlSchemaManager;
use Doctrine\DBAL\Schema\Table; use Doctrine\DBAL\Schema\Table;
use Doctrine\DBAL\Schema\TableDiff; use Doctrine\DBAL\Schema\TableDiff;
use Doctrine\DBAL\Types\BlobType; use Doctrine\DBAL\Types\BlobType;
...@@ -20,6 +21,9 @@ use function strtolower; ...@@ -20,6 +21,9 @@ use function strtolower;
class PostgreSqlSchemaManagerTest extends SchemaManagerFunctionalTestCase class PostgreSqlSchemaManagerTest extends SchemaManagerFunctionalTestCase
{ {
/** @var PostgreSqlSchemaManager */
protected $schemaManager;
protected function tearDown() : void protected function tearDown() : void
{ {
parent::tearDown(); parent::tearDown();
...@@ -28,7 +32,7 @@ class PostgreSqlSchemaManagerTest extends SchemaManagerFunctionalTestCase ...@@ -28,7 +32,7 @@ class PostgreSqlSchemaManagerTest extends SchemaManagerFunctionalTestCase
return; return;
} }
$this->connection->getConfiguration()->setFilterSchemaAssetsExpression(null); $this->connection->getConfiguration()->setSchemaAssetsFilter(null);
} }
/** /**
......
...@@ -60,7 +60,7 @@ abstract class SchemaManagerFunctionalTestCase extends DbalFunctionalTestCase ...@@ -60,7 +60,7 @@ abstract class SchemaManagerFunctionalTestCase extends DbalFunctionalTestCase
$e = explode('\\', $class); $e = explode('\\', $class);
$testClass = end($e); $testClass = end($e);
return strtolower(str_replace('SchemaManagerTest', null, $testClass)); return strtolower(str_replace('SchemaManagerTest', '', $testClass));
} }
protected function setUp() : void protected function setUp() : void
...@@ -369,10 +369,7 @@ abstract class SchemaManagerFunctionalTestCase extends DbalFunctionalTestCase ...@@ -369,10 +369,7 @@ abstract class SchemaManagerFunctionalTestCase extends DbalFunctionalTestCase
$this->schemaManager->dropAndCreateTable($table); $this->schemaManager->dropAndCreateTable($table);
$listenerMock = $this->getMockBuilder($this->getMockClass('ListTableColumnsDispatchEventListener')) $listenerMock = $this->createMock(ListTableColumnsDispatchEventListener::class);
->addMethods(['onSchemaColumnDefinition'])
->getMock();
$listenerMock $listenerMock
->expects($this->exactly(7)) ->expects($this->exactly(7))
->method('onSchemaColumnDefinition'); ->method('onSchemaColumnDefinition');
...@@ -397,9 +394,7 @@ abstract class SchemaManagerFunctionalTestCase extends DbalFunctionalTestCase ...@@ -397,9 +394,7 @@ abstract class SchemaManagerFunctionalTestCase extends DbalFunctionalTestCase
$this->schemaManager->dropAndCreateTable($table); $this->schemaManager->dropAndCreateTable($table);
$listenerMock = $this->getMockBuilder($this->getMockClass('ListTableIndexesDispatchEventListener')) $listenerMock = $this->createMock(ListTableIndexesDispatchEventListener::class);
->addMethods(['onSchemaIndexDefinition'])
->getMock();
$listenerMock $listenerMock
->expects($this->exactly(3)) ->expects($this->exactly(3))
->method('onSchemaIndexDefinition'); ->method('onSchemaIndexDefinition');
...@@ -1653,3 +1648,13 @@ abstract class SchemaManagerFunctionalTestCase extends DbalFunctionalTestCase ...@@ -1653,3 +1648,13 @@ abstract class SchemaManagerFunctionalTestCase extends DbalFunctionalTestCase
} }
} }
} }
interface ListTableColumnsDispatchEventListener
{
public function onSchemaColumnDefinition() : void;
}
interface ListTableIndexesDispatchEventListener
{
public function onSchemaIndexDefinition() : void;
}
...@@ -98,7 +98,7 @@ EOS ...@@ -98,7 +98,7 @@ EOS
new Schema\ForeignKeyConstraint( new Schema\ForeignKeyConstraint(
['log'], ['log'],
'log', 'log',
[null], [''],
'FK_3', 'FK_3',
['onUpdate' => 'SET NULL', 'onDelete' => 'NO ACTION', 'deferrable' => false, 'deferred' => false] ['onUpdate' => 'SET NULL', 'onDelete' => 'NO ACTION', 'deferrable' => false, 'deferred' => false]
), ),
......
...@@ -7,6 +7,7 @@ use Doctrine\DBAL\Driver\DriverException; ...@@ -7,6 +7,7 @@ use Doctrine\DBAL\Driver\DriverException;
use Doctrine\DBAL\ParameterType; use Doctrine\DBAL\ParameterType;
use Doctrine\DBAL\Schema\Sequence; use Doctrine\DBAL\Schema\Sequence;
use Doctrine\DBAL\Schema\Table; use Doctrine\DBAL\Schema\Table;
use Doctrine\DBAL\Statement;
use Doctrine\DBAL\Types\Type; use Doctrine\DBAL\Types\Type;
use Doctrine\Tests\DbalFunctionalTestCase; use Doctrine\Tests\DbalFunctionalTestCase;
use Throwable; use Throwable;
...@@ -94,6 +95,7 @@ class WriteTest extends DbalFunctionalTestCase ...@@ -94,6 +95,7 @@ class WriteTest extends DbalFunctionalTestCase
$sql = 'INSERT INTO write_table (test_int, test_string) VALUES (?, ?)'; $sql = 'INSERT INTO write_table (test_int, test_string) VALUES (?, ?)';
$stmt = $this->connection->prepare($sql); $stmt = $this->connection->prepare($sql);
self::assertInstanceOf(Statement::class, $stmt);
$stmt->bindValue(1, 1, Type::getType('integer')); $stmt->bindValue(1, 1, Type::getType('integer'));
$stmt->bindValue(2, 'foo', Type::getType('string')); $stmt->bindValue(2, 'foo', Type::getType('string'));
$stmt->execute(); $stmt->execute();
...@@ -106,6 +108,7 @@ class WriteTest extends DbalFunctionalTestCase ...@@ -106,6 +108,7 @@ class WriteTest extends DbalFunctionalTestCase
$sql = 'INSERT INTO write_table (test_int, test_string) VALUES (?, ?)'; $sql = 'INSERT INTO write_table (test_int, test_string) VALUES (?, ?)';
$stmt = $this->connection->prepare($sql); $stmt = $this->connection->prepare($sql);
self::assertInstanceOf(Statement::class, $stmt);
$stmt->bindValue(1, 1, 'integer'); $stmt->bindValue(1, 1, 'integer');
$stmt->bindValue(2, 'foo', 'string'); $stmt->bindValue(2, 'foo', 'string');
$stmt->execute(); $stmt->execute();
......
<?php
declare(strict_types=1);
namespace Doctrine\Tests\DBAL;
use Doctrine\DBAL\Driver;
use Doctrine\DBAL\VersionAwarePlatformDriver;
/**
* Remove me in 3.0.x
*/
interface FutureVersionAwarePlatformDriver extends VersionAwarePlatformDriver, Driver
{
}
...@@ -372,9 +372,7 @@ abstract class AbstractPlatformTestCase extends DbalTestCase ...@@ -372,9 +372,7 @@ abstract class AbstractPlatformTestCase extends DbalTestCase
public function testGetCreateTableSqlDispatchEvent() : void public function testGetCreateTableSqlDispatchEvent() : void
{ {
$listenerMock = $this->getMockBuilder($this->getMockClass('GetCreateTableSqlDispatchEvenListener')) $listenerMock = $this->createMock(GetCreateTableSqlDispatchEventListener::class);
->addMethods(['onSchemaCreateTable', 'onSchemaCreateTableColumn'])
->getMock();
$listenerMock $listenerMock
->expects($this->once()) ->expects($this->once())
->method('onSchemaCreateTable'); ->method('onSchemaCreateTable');
...@@ -396,9 +394,7 @@ abstract class AbstractPlatformTestCase extends DbalTestCase ...@@ -396,9 +394,7 @@ abstract class AbstractPlatformTestCase extends DbalTestCase
public function testGetDropTableSqlDispatchEvent() : void public function testGetDropTableSqlDispatchEvent() : void
{ {
$listenerMock = $this->getMockBuilder($this->getMockClass('GetDropTableSqlDispatchEventListener')) $listenerMock = $this->createMock(GetDropTableSqlDispatchEventListener::class);
->addMethods(['onSchemaDropTable'])
->getMock();
$listenerMock $listenerMock
->expects($this->once()) ->expects($this->once())
->method('onSchemaDropTable'); ->method('onSchemaDropTable');
...@@ -413,17 +409,7 @@ abstract class AbstractPlatformTestCase extends DbalTestCase ...@@ -413,17 +409,7 @@ abstract class AbstractPlatformTestCase extends DbalTestCase
public function testGetAlterTableSqlDispatchEvent() : void public function testGetAlterTableSqlDispatchEvent() : void
{ {
$events = [ $listenerMock = $this->createMock(GetAlterTableSqlDispatchEventListener::class);
'onSchemaAlterTable',
'onSchemaAlterTableAddColumn',
'onSchemaAlterTableRemoveColumn',
'onSchemaAlterTableChangeColumn',
'onSchemaAlterTableRenameColumn',
];
$listenerMock = $this->getMockBuilder($this->getMockClass('GetAlterTableSqlDispatchEvenListener'))
->addMethods($events)
->getMock();
$listenerMock $listenerMock
->expects($this->once()) ->expects($this->once())
->method('onSchemaAlterTable'); ->method('onSchemaAlterTable');
...@@ -1532,3 +1518,28 @@ abstract class AbstractPlatformTestCase extends DbalTestCase ...@@ -1532,3 +1518,28 @@ abstract class AbstractPlatformTestCase extends DbalTestCase
); );
} }
} }
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;
}
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
namespace Doctrine\Tests\DBAL\Platforms; namespace Doctrine\Tests\DBAL\Platforms;
use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\Platforms\PostgreSqlPlatform;
use Doctrine\DBAL\Schema\Column; use Doctrine\DBAL\Schema\Column;
use Doctrine\DBAL\Schema\ColumnDiff; use Doctrine\DBAL\Schema\ColumnDiff;
use Doctrine\DBAL\Schema\Comparator; use Doctrine\DBAL\Schema\Comparator;
...@@ -16,6 +18,14 @@ use function sprintf; ...@@ -16,6 +18,14 @@ use function sprintf;
abstract class AbstractPostgreSqlPlatformTestCase extends AbstractPlatformTestCase abstract class AbstractPostgreSqlPlatformTestCase extends AbstractPlatformTestCase
{ {
/** @var PostgreSqlPlatform */
protected $platform;
/**
* @return PostgreSqlPlatform
*/
abstract public function createPlatform() : AbstractPlatform;
public function getGenerateTableSql() : string public function getGenerateTableSql() : string
{ {
return 'CREATE TABLE test (id SERIAL NOT NULL, test VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id))'; return 'CREATE TABLE test (id SERIAL NOT NULL, test VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id))';
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
namespace Doctrine\Tests\DBAL\Platforms; namespace Doctrine\Tests\DBAL\Platforms;
use Doctrine\DBAL\DBALException; use Doctrine\DBAL\DBALException;
use Doctrine\DBAL\Platforms\SQLServerPlatform;
use Doctrine\DBAL\Schema\Column; use Doctrine\DBAL\Schema\Column;
use Doctrine\DBAL\Schema\ColumnDiff; use Doctrine\DBAL\Schema\ColumnDiff;
use Doctrine\DBAL\Schema\Index; use Doctrine\DBAL\Schema\Index;
...@@ -14,6 +15,9 @@ use function sprintf; ...@@ -14,6 +15,9 @@ use function sprintf;
abstract class AbstractSQLServerPlatformTestCase extends AbstractPlatformTestCase abstract class AbstractSQLServerPlatformTestCase extends AbstractPlatformTestCase
{ {
/** @var SQLServerPlatform */
protected $platform;
public function getGenerateTableSql() : string public function getGenerateTableSql() : string
{ {
return 'CREATE TABLE test (id INT IDENTITY NOT NULL, test NVARCHAR(255), PRIMARY KEY (id))'; return 'CREATE TABLE test (id INT IDENTITY NOT NULL, test NVARCHAR(255), PRIMARY KEY (id))';
......
...@@ -22,6 +22,9 @@ use function uniqid; ...@@ -22,6 +22,9 @@ use function uniqid;
class OraclePlatformTest extends AbstractPlatformTestCase class OraclePlatformTest extends AbstractPlatformTestCase
{ {
/** @var OraclePlatform */
protected $platform;
/** /**
* @return mixed[][] * @return mixed[][]
*/ */
...@@ -76,6 +79,9 @@ class OraclePlatformTest extends AbstractPlatformTestCase ...@@ -76,6 +79,9 @@ class OraclePlatformTest extends AbstractPlatformTestCase
$platform->assertValidIdentifier($identifier); $platform->assertValidIdentifier($identifier);
} }
/**
* @return OraclePlatform
*/
public function createPlatform() : AbstractPlatform public function createPlatform() : AbstractPlatform
{ {
return new OraclePlatform(); return new OraclePlatform();
......
...@@ -8,6 +8,14 @@ use Doctrine\DBAL\Types\Types; ...@@ -8,6 +8,14 @@ use Doctrine\DBAL\Types\Types;
class PostgreSQL92PlatformTest extends AbstractPostgreSqlPlatformTestCase class PostgreSQL92PlatformTest extends AbstractPostgreSqlPlatformTestCase
{ {
/** @var PostgreSQL92Platform */
protected $platform;
/**
* {@inheritdoc}
*
* @return PostgreSQL92Platform
*/
public function createPlatform() : AbstractPlatform public function createPlatform() : AbstractPlatform
{ {
return new PostgreSQL92Platform(); return new PostgreSQL92Platform();
......
...@@ -52,7 +52,7 @@ class SQLAnywhere12PlatformTest extends SQLAnywhere11PlatformTest ...@@ -52,7 +52,7 @@ class SQLAnywhere12PlatformTest extends SQLAnywhere11PlatformTest
); );
self::assertEquals( self::assertEquals(
'SELECT sequence_name, increment_by, start_with, min_value FROM SYS.SYSSEQUENCE', 'SELECT sequence_name, increment_by, start_with, min_value FROM SYS.SYSSEQUENCE',
$this->platform->getListSequencesSQL(null) $this->platform->getListSequencesSQL('')
); );
} }
......
...@@ -348,14 +348,14 @@ class SQLAnywherePlatformTest extends AbstractPlatformTestCase ...@@ -348,14 +348,14 @@ class SQLAnywherePlatformTest extends AbstractPlatformTestCase
self::assertEquals( self::assertEquals(
'CONSTRAINT pk PRIMARY KEY CLUSTERED (a, b)', 'CONSTRAINT pk PRIMARY KEY CLUSTERED (a, b)',
$this->platform->getPrimaryKeyDeclarationSQL( $this->platform->getPrimaryKeyDeclarationSQL(
new Index(null, ['a', 'b'], true, true, ['clustered']), new Index('', ['a', 'b'], true, true, ['clustered']),
'pk' 'pk'
) )
); );
self::assertEquals( self::assertEquals(
'PRIMARY KEY (a, b)', 'PRIMARY KEY (a, b)',
$this->platform->getPrimaryKeyDeclarationSQL( $this->platform->getPrimaryKeyDeclarationSQL(
new Index(null, ['a', 'b'], true, true) new Index('', ['a', 'b'], true, true)
) )
); );
} }
...@@ -391,12 +391,12 @@ class SQLAnywherePlatformTest extends AbstractPlatformTestCase ...@@ -391,12 +391,12 @@ class SQLAnywherePlatformTest extends AbstractPlatformTestCase
'CONSTRAINT unique_constraint UNIQUE CLUSTERED (a, b)', 'CONSTRAINT unique_constraint UNIQUE CLUSTERED (a, b)',
$this->platform->getUniqueConstraintDeclarationSQL( $this->platform->getUniqueConstraintDeclarationSQL(
'unique_constraint', 'unique_constraint',
new Index(null, ['a', 'b'], true, false, ['clustered']) new Index('', ['a', 'b'], true, false, ['clustered'])
) )
); );
self::assertEquals( self::assertEquals(
'UNIQUE (a, b)', 'UNIQUE (a, b)',
$this->platform->getUniqueConstraintDeclarationSQL(null, new Index(null, ['a', 'b'], true, false)) $this->platform->getUniqueConstraintDeclarationSQL('', new Index('', ['a', 'b'], true, false))
); );
} }
...@@ -517,6 +517,9 @@ class SQLAnywherePlatformTest extends AbstractPlatformTestCase ...@@ -517,6 +517,9 @@ class SQLAnywherePlatformTest extends AbstractPlatformTestCase
)); ));
} }
/**
* @psalm-suppress InvalidArgument
*/
public function testCannotGenerateDropIndexSQLWithInvalidIndexParameter() : void public function testCannotGenerateDropIndexSQLWithInvalidIndexParameter() : void
{ {
$this->expectException(InvalidArgumentException::class); $this->expectException(InvalidArgumentException::class);
...@@ -524,6 +527,9 @@ class SQLAnywherePlatformTest extends AbstractPlatformTestCase ...@@ -524,6 +527,9 @@ class SQLAnywherePlatformTest extends AbstractPlatformTestCase
$this->platform->getDropIndexSQL(['index'], 'table'); $this->platform->getDropIndexSQL(['index'], 'table');
} }
/**
* @psalm-suppress InvalidArgument
*/
public function testCannotGenerateDropIndexSQLWithInvalidTableParameter() : void public function testCannotGenerateDropIndexSQLWithInvalidTableParameter() : void
{ {
$this->expectException(InvalidArgumentException::class); $this->expectException(InvalidArgumentException::class);
...@@ -596,7 +602,7 @@ class SQLAnywherePlatformTest extends AbstractPlatformTestCase ...@@ -596,7 +602,7 @@ class SQLAnywherePlatformTest extends AbstractPlatformTestCase
self::assertEquals( self::assertEquals(
"REVERSE(SUBSTR(REVERSE(SUBSTR(column, PATINDEX('%[^' + c + ']%', column))), PATINDEX('%[^' + c + ']%', " . "REVERSE(SUBSTR(REVERSE(SUBSTR(column, PATINDEX('%[^' + c + ']%', column))), PATINDEX('%[^' + c + ']%', " .
"REVERSE(SUBSTR(column, PATINDEX('%[^' + c + ']%', column))))))", "REVERSE(SUBSTR(column, PATINDEX('%[^' + c + ']%', column))))))",
$this->platform->getTrimExpression('column', null, 'c') $this->platform->getTrimExpression('column', TrimMode::UNSPECIFIED, 'c')
); );
self::assertEquals( self::assertEquals(
"REVERSE(SUBSTR(REVERSE(SUBSTR(column, PATINDEX('%[^' + c + ']%', column))), PATINDEX('%[^' + c + ']%', " . "REVERSE(SUBSTR(REVERSE(SUBSTR(column, PATINDEX('%[^' + c + ']%', column))), PATINDEX('%[^' + c + ']%', " .
......
...@@ -13,6 +13,12 @@ use Doctrine\DBAL\Types\Type; ...@@ -13,6 +13,12 @@ use Doctrine\DBAL\Types\Type;
class SqlitePlatformTest extends AbstractPlatformTestCase class SqlitePlatformTest extends AbstractPlatformTestCase
{ {
/** @var SqlitePlatform */
protected $platform;
/**
* @return SqlitePlatform
*/
public function createPlatform() : AbstractPlatform public function createPlatform() : AbstractPlatform
{ {
return new SqlitePlatform(); return new SqlitePlatform();
......
...@@ -872,6 +872,7 @@ class ComparatorTest extends TestCase ...@@ -872,6 +872,7 @@ class ComparatorTest extends TestCase
/** /**
* @group DBAL-106 * @group DBAL-106
* @psalm-suppress NullArgument
*/ */
public function testDiffDecimalWithNullPrecision() : void public function testDiffDecimalWithNullPrecision() : void
{ {
......
...@@ -10,6 +10,7 @@ use Doctrine\DBAL\Platforms\MySqlPlatform; ...@@ -10,6 +10,7 @@ use Doctrine\DBAL\Platforms\MySqlPlatform;
use Doctrine\DBAL\Schema\AbstractSchemaManager; use Doctrine\DBAL\Schema\AbstractSchemaManager;
use Doctrine\DBAL\Schema\ForeignKeyConstraint; use Doctrine\DBAL\Schema\ForeignKeyConstraint;
use Doctrine\DBAL\Schema\MySqlSchemaManager; use Doctrine\DBAL\Schema\MySqlSchemaManager;
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase; use PHPUnit\Framework\TestCase;
use function array_map; use function array_map;
...@@ -18,7 +19,7 @@ class MySqlSchemaManagerTest extends TestCase ...@@ -18,7 +19,7 @@ class MySqlSchemaManagerTest extends TestCase
/** @var AbstractSchemaManager */ /** @var AbstractSchemaManager */
private $manager; private $manager;
/** @var Connection */ /** @var Connection&MockObject */
private $conn; private $conn;
protected function setUp() : void protected function setUp() : void
......
...@@ -5,6 +5,7 @@ namespace Doctrine\Tests\DBAL\Sharding\SQLAzure; ...@@ -5,6 +5,7 @@ namespace Doctrine\Tests\DBAL\Sharding\SQLAzure;
use Doctrine\DBAL\Connection; use Doctrine\DBAL\Connection;
use Doctrine\DBAL\Sharding\ShardingException; use Doctrine\DBAL\Sharding\ShardingException;
use Doctrine\DBAL\Sharding\SQLAzure\SQLAzureShardManager; use Doctrine\DBAL\Sharding\SQLAzure\SQLAzureShardManager;
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase; use PHPUnit\Framework\TestCase;
class SQLAzureShardManagerTest extends TestCase class SQLAzureShardManagerTest extends TestCase
...@@ -81,6 +82,8 @@ class SQLAzureShardManagerTest extends TestCase ...@@ -81,6 +82,8 @@ class SQLAzureShardManagerTest extends TestCase
/** /**
* @param mixed[] $params * @param mixed[] $params
*
* @return Connection&MockObject
*/ */
private function createConnection(array $params) : Connection private function createConnection(array $params) : Connection
{ {
......
...@@ -14,16 +14,17 @@ use Doctrine\DBAL\Statement; ...@@ -14,16 +14,17 @@ use Doctrine\DBAL\Statement;
use Doctrine\Tests\DbalTestCase; use Doctrine\Tests\DbalTestCase;
use Exception; use Exception;
use PDOStatement; use PDOStatement;
use PHPUnit\Framework\MockObject\MockObject;
class StatementTest extends DbalTestCase class StatementTest extends DbalTestCase
{ {
/** @var Connection */ /** @var Connection&MockObject */
private $conn; private $conn;
/** @var Configuration */ /** @var Configuration&MockObject */
private $configuration; private $configuration;
/** @var PDOStatement */ /** @var PDOStatement&MockObject */
private $pdoStatement; private $pdoStatement;
protected function setUp() : void protected function setUp() : void
......
...@@ -6,6 +6,7 @@ use Doctrine\DBAL\Connection; ...@@ -6,6 +6,7 @@ use Doctrine\DBAL\Connection;
use Doctrine\DBAL\Tools\Console\Command\RunSqlCommand; use Doctrine\DBAL\Tools\Console\Command\RunSqlCommand;
use Doctrine\DBAL\Tools\Console\ConsoleRunner; use Doctrine\DBAL\Tools\Console\ConsoleRunner;
use LogicException; use LogicException;
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase; use PHPUnit\Framework\TestCase;
use RuntimeException; use RuntimeException;
use Symfony\Component\Console\Application; use Symfony\Component\Console\Application;
...@@ -18,7 +19,7 @@ class RunSqlCommandTest extends TestCase ...@@ -18,7 +19,7 @@ class RunSqlCommandTest extends TestCase
/** @var RunSqlCommand */ /** @var RunSqlCommand */
private $command; private $command;
/** @var Connection */ /** @var Connection&MockObject */
private $connectionMock; private $connectionMock;
protected function setUp() : void protected function setUp() : void
......
...@@ -19,7 +19,7 @@ class TypeTest extends TestCase ...@@ -19,7 +19,7 @@ class TypeTest extends TestCase
} }
/** /**
* @return string[][] * @return iterable<string[]>
*/ */
public function defaultTypesProvider() : iterable public function defaultTypesProvider() : iterable
{ {
...@@ -28,7 +28,10 @@ class TypeTest extends TestCase ...@@ -28,7 +28,10 @@ class TypeTest extends TestCase
continue; continue;
} }
yield [$constant->getValue()]; $constantValue = $constant->getValue();
self::assertIsString($constantValue);
yield [$constantValue];
} }
} }
} }
...@@ -16,7 +16,7 @@ class DbalPerformanceTestListener implements TestListener ...@@ -16,7 +16,7 @@ class DbalPerformanceTestListener implements TestListener
{ {
use TestListenerDefaultImplementation; use TestListenerDefaultImplementation;
/** @var string[][] */ /** @var array<string, array<string, float>> */
private $timings = []; private $timings = [];
public function endTest(Test $test, float $time) : void public function endTest(Test $test, float $time) : void
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment