From 24cefe5d83a8e0ccc49b18fe774b11105a7fbcd9 Mon Sep 17 00:00:00 2001 From: Craig Duncan Date: Tue, 10 Mar 2020 15:53:44 +0000 Subject: [PATCH 01/16] Ensure the constructor arguments are passed to custom classes --- lib/Doctrine/DBAL/Statement.php | 6 +----- tests/Doctrine/Tests/DBAL/StatementTest.php | 14 +++++++++++++- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/lib/Doctrine/DBAL/Statement.php b/lib/Doctrine/DBAL/Statement.php index 09913bb56ae..13140a6a600 100644 --- a/lib/Doctrine/DBAL/Statement.php +++ b/lib/Doctrine/DBAL/Statement.php @@ -249,11 +249,7 @@ public function fetch($fetchMode = null, $cursorOrientation = PDO::FETCH_ORI_NEX */ public function fetchAll($fetchMode = null, $fetchArgument = null, $ctorArgs = null) { - if ($fetchArgument) { - return $this->stmt->fetchAll($fetchMode, $fetchArgument); - } - - return $this->stmt->fetchAll($fetchMode); + return $this->stmt->fetchAll($fetchMode, $fetchArgument, $ctorArgs); } /** diff --git a/tests/Doctrine/Tests/DBAL/StatementTest.php b/tests/Doctrine/Tests/DBAL/StatementTest.php index bb86e9cab3c..1c0794ac4cc 100644 --- a/tests/Doctrine/Tests/DBAL/StatementTest.php +++ b/tests/Doctrine/Tests/DBAL/StatementTest.php @@ -7,6 +7,7 @@ use Doctrine\DBAL\DBALException; use Doctrine\DBAL\Driver; use Doctrine\DBAL\Driver\Connection as DriverConnection; +use Doctrine\DBAL\FetchMode; use Doctrine\DBAL\Logging\SQLLogger; use Doctrine\DBAL\ParameterType; use Doctrine\DBAL\Statement; @@ -28,7 +29,7 @@ class StatementTest extends DbalTestCase protected function setUp() : void { $this->pdoStatement = $this->getMockBuilder(PDOStatement::class) - ->onlyMethods(['execute', 'bindParam', 'bindValue']) + ->onlyMethods(['execute', 'bindParam', 'bindValue', 'fetchAll']) ->getMock(); $driverConnection = $this->createMock(DriverConnection::class); @@ -150,4 +151,15 @@ public function testExecuteCallsLoggerStopQueryOnException() : void $statement->execute(); } + + public function testPDOCustomClassConstructorArgs() : void + { + $statement = new Statement('', $this->conn); + + $this->pdoStatement->expects($this->once()) + ->method('fetchAll') + ->with(self::equalTo(FetchMode::CUSTOM_OBJECT), self::equalTo('Example'), self::equalTo(['arg1'])); + + $statement->fetchAll(FetchMode::CUSTOM_OBJECT, 'Example', ['arg1']); + } } From cb81e4007cec44b5a97dc573e6aff6b2fde314a1 Mon Sep 17 00:00:00 2001 From: Sergei Morozov Date: Sat, 28 Mar 2020 11:01:54 -0700 Subject: [PATCH 02/16] Removed performance tests --- phpunit.xml.dist | 16 +---- .../TypeConversionPerformanceTest.php | 44 ------------- .../Tests/DbalPerformanceTestCase.php | 63 ------------------ .../Tests/DbalPerformanceTestListener.php | 65 ------------------- 4 files changed, 1 insertion(+), 187 deletions(-) delete mode 100644 tests/Doctrine/Tests/DBAL/Performance/TypeConversionPerformanceTest.php delete mode 100644 tests/Doctrine/Tests/DbalPerformanceTestCase.php delete mode 100644 tests/Doctrine/Tests/DbalPerformanceTestListener.php diff --git a/phpunit.xml.dist b/phpunit.xml.dist index f62532ed9f9..cef52e33c5b 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -44,11 +44,7 @@ - ./tests/Doctrine/Tests/DBAL - ./tests/Doctrine/Tests/DBAL/Performance - - - ./tests/Doctrine/Tests/DBAL/Performance + tests/Doctrine/Tests/DBAL @@ -57,14 +53,4 @@ lib/Doctrine - - - - - - - - performance - - diff --git a/tests/Doctrine/Tests/DBAL/Performance/TypeConversionPerformanceTest.php b/tests/Doctrine/Tests/DBAL/Performance/TypeConversionPerformanceTest.php deleted file mode 100644 index 6a76e90f897..00000000000 --- a/tests/Doctrine/Tests/DBAL/Performance/TypeConversionPerformanceTest.php +++ /dev/null @@ -1,44 +0,0 @@ -connection->getDatabasePlatform(); - $this->startTiming(); - for ($i = 0; $i < $count; $i++) { - $type->convertToDatabaseValue($value, $platform); - } - $this->stopTiming(); - } - - /** - * @return mixed[][] - */ - public static function itemCountProvider() : iterable - { - return [ - '100 items' => [100], - '1000 items' => [1000], - '10000 items' => [10000], - '100000 items' => [100000], - ]; - } -} diff --git a/tests/Doctrine/Tests/DbalPerformanceTestCase.php b/tests/Doctrine/Tests/DbalPerformanceTestCase.php deleted file mode 100644 index ac0beb3c5de..00000000000 --- a/tests/Doctrine/Tests/DbalPerformanceTestCase.php +++ /dev/null @@ -1,63 +0,0 @@ -startTime, 'Test timing was started'); - self::assertNotNull($this->runTime, 'Test timing was stopped'); - } - - /** - * begin timing - */ - protected function startTiming() : void - { - $this->startTime = microtime(true); - } - - /** - * end timing - */ - protected function stopTiming() : void - { - $this->runTime = microtime(true) - $this->startTime; - } - - /** - * @return float elapsed test execution time - */ - public function getTime() : float - { - return $this->runTime; - } -} diff --git a/tests/Doctrine/Tests/DbalPerformanceTestListener.php b/tests/Doctrine/Tests/DbalPerformanceTestListener.php deleted file mode 100644 index e9265c0f35f..00000000000 --- a/tests/Doctrine/Tests/DbalPerformanceTestListener.php +++ /dev/null @@ -1,65 +0,0 @@ -timings[$class])) { - $this->timings[$class] = []; - } - - // Store timing data for each test in the order they were run. - $this->timings[$class][$test->getName(true)] = $test->getTime(); - } - - /** - * Report performance test timings. - * - * Note: __destruct is used here because PHPUnit doesn't have a - * 'All tests over' hook. - */ - public function __destruct() - { - if (empty($this->timings)) { - return; - } - - // Report timings. - print "\nPerformance test results:\n\n"; - - foreach ($this->timings as $class => $tests) { - printf("%s:\n", $class); - foreach ($tests as $test => $time) { - printf("\t%s: %.3f seconds\n", $test, $time); - } - } - } -} From fcf472ad58511e8d663da3d011307f20cf6eeb6d Mon Sep 17 00:00:00 2001 From: Sergei Morozov Date: Sat, 28 Mar 2020 11:59:23 -0700 Subject: [PATCH 03/16] Actualize the content of the .gitattributes file 1. Removed no longer existing entries 2. Added new entries 3. Sorted using `sort` (ignores case and the leading dot, same as `ls`) --- .gitattributes | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.gitattributes b/.gitattributes index 5bbaf359701..54d8bd65621 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,15 +1,16 @@ /.appveyor.yml export-ignore +/composer.lock export-ignore +/docs export-ignore +/.doctrine-project.json export-ignore /.gitattributes export-ignore /.github export-ignore /.gitignore export-ignore -/.scrutinizer.yml export-ignore -/.travis.yml export-ignore -/build.properties export-ignore -/build.xml export-ignore -/composer.lock export-ignore -/docs export-ignore /phpcs.xml.dist export-ignore /phpstan.neon.dist export-ignore /phpunit.xml.dist export-ignore /run-all.sh export-ignore +/.scrutinizer.yml export-ignore +/SECURITY.md export-ignore /tests export-ignore +/.travis.yml export-ignore +/UPGRADE.md export-ignore From ab88b96026df54b1f9f49bf3585100ff2ac04b44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lu=C3=ADs=20Cobucci?= Date: Mon, 30 Dec 2019 12:51:50 +0100 Subject: [PATCH 04/16] Upgrade to PHPStan v0.12 Allowing us to use more advanced checks and have full generic support. This also adds a baseline file, since we have new violations being reported but don't want to address them right now. --- composer.json | 2 +- composer.lock | 1090 ++++++++++--------------------------------------- 2 files changed, 228 insertions(+), 864 deletions(-) diff --git a/composer.json b/composer.json index 4a426e4881a..52eaf21f5bc 100644 --- a/composer.json +++ b/composer.json @@ -40,7 +40,7 @@ "require-dev": { "doctrine/coding-standard": "^6.0", "jetbrains/phpstorm-stubs": "^2019.1", - "phpstan/phpstan": "^0.11.3", + "phpstan/phpstan": "^0.12", "phpunit/phpunit": "^8.4.1", "symfony/console": "^2.0.5|^3.0|^4.0|^5.0" }, diff --git a/composer.lock b/composer.lock index aa0428c2019..e66402ad6c9 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": "120172ae44052999ec9a50b1121414cc", + "content-hash": "c5e7640a7c04d2174aa72c365cf067eb", "packages": [ { "name": "doctrine/cache", @@ -156,50 +156,6 @@ } ], "packages-dev": [ - { - "name": "composer/xdebug-handler", - "version": "1.3.3", - "source": { - "type": "git", - "url": "https://github.com/composer/xdebug-handler.git", - "reference": "46867cbf8ca9fb8d60c506895449eb799db1184f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/46867cbf8ca9fb8d60c506895449eb799db1184f", - "reference": "46867cbf8ca9fb8d60c506895449eb799db1184f", - "shasum": "" - }, - "require": { - "php": "^5.3.2 || ^7.0", - "psr/log": "^1.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5" - }, - "type": "library", - "autoload": { - "psr-4": { - "Composer\\XdebugHandler\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "John Stevenson", - "email": "john-stevenson@blueyonder.co.uk" - } - ], - "description": "Restarts a process without xdebug.", - "keywords": [ - "Xdebug", - "performance" - ], - "time": "2019-05-27T17:52:04+00:00" - }, { "name": "dealerdirect/phpcodesniffer-composer-installer", "version": "v0.5.0", @@ -383,57 +339,6 @@ ], "time": "2019-03-17T17:37:11+00:00" }, - { - "name": "jean85/pretty-package-versions", - "version": "1.2", - "source": { - "type": "git", - "url": "https://github.com/Jean85/pretty-package-versions.git", - "reference": "75c7effcf3f77501d0e0caa75111aff4daa0dd48" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Jean85/pretty-package-versions/zipball/75c7effcf3f77501d0e0caa75111aff4daa0dd48", - "reference": "75c7effcf3f77501d0e0caa75111aff4daa0dd48", - "shasum": "" - }, - "require": { - "ocramius/package-versions": "^1.2.0", - "php": "^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Jean85\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Alessandro Lai", - "email": "alessandro.lai85@gmail.com" - } - ], - "description": "A wrapper for ocramius/package-versions to get pretty versions strings", - "keywords": [ - "composer", - "package", - "release", - "versions" - ], - "time": "2018-06-13T13:22:40+00:00" - }, { "name": "jetbrains/phpstorm-stubs", "version": "v2019.1", @@ -508,554 +413,31 @@ ] }, "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Create deep copies (clones) of your objects", - "keywords": [ - "clone", - "copy", - "duplicate", - "object", - "object graph" - ], - "time": "2019-08-09T12:45:53+00:00" - }, - { - "name": "nette/bootstrap", - "version": "v3.0.0", - "source": { - "type": "git", - "url": "https://github.com/nette/bootstrap.git", - "reference": "e1075af05c211915e03e0c86542f3ba5433df4a3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/bootstrap/zipball/e1075af05c211915e03e0c86542f3ba5433df4a3", - "reference": "e1075af05c211915e03e0c86542f3ba5433df4a3", - "shasum": "" - }, - "require": { - "nette/di": "^3.0", - "nette/utils": "^3.0", - "php": ">=7.1" - }, - "require-dev": { - "latte/latte": "^2.2", - "nette/application": "^3.0", - "nette/caching": "^3.0", - "nette/database": "^3.0", - "nette/forms": "^3.0", - "nette/http": "^3.0", - "nette/mail": "^3.0", - "nette/robot-loader": "^3.0", - "nette/safe-stream": "^2.2", - "nette/security": "^3.0", - "nette/tester": "^2.0", - "tracy/tracy": "^2.6" - }, - "suggest": { - "nette/robot-loader": "to use Configurator::createRobotLoader()", - "tracy/tracy": "to use Configurator::enableTracy()" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0", - "GPL-3.0" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "https://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "https://nette.org/contributors" - } - ], - "description": "🅱 Nette Bootstrap: the simple way to configure and bootstrap your Nette application.", - "homepage": "https://nette.org", - "keywords": [ - "bootstrapping", - "configurator", - "nette" - ], - "time": "2019-03-26T12:59:07+00:00" - }, - { - "name": "nette/di", - "version": "v3.0.1", - "source": { - "type": "git", - "url": "https://github.com/nette/di.git", - "reference": "4aff517a1c6bb5c36fa09733d4cea089f529de6d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/di/zipball/4aff517a1c6bb5c36fa09733d4cea089f529de6d", - "reference": "4aff517a1c6bb5c36fa09733d4cea089f529de6d", - "shasum": "" - }, - "require": { - "ext-tokenizer": "*", - "nette/neon": "^3.0", - "nette/php-generator": "^3.2.2", - "nette/robot-loader": "^3.2", - "nette/schema": "^1.0", - "nette/utils": "^3.0", - "php": ">=7.1" - }, - "conflict": { - "nette/bootstrap": "<3.0" - }, - "require-dev": { - "nette/tester": "^2.2", - "tracy/tracy": "^2.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ], - "files": [ - "src/compatibility.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0", - "GPL-3.0" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "https://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "https://nette.org/contributors" - } - ], - "description": "💎 Nette Dependency Injection Container: Flexible, compiled and full-featured DIC with perfectly usable autowiring and support for all new PHP 7.1 features.", - "homepage": "https://nette.org", - "keywords": [ - "compiled", - "di", - "dic", - "factory", - "ioc", - "nette", - "static" - ], - "time": "2019-08-07T12:11:33+00:00" - }, - { - "name": "nette/finder", - "version": "v2.5.0", - "source": { - "type": "git", - "url": "https://github.com/nette/finder.git", - "reference": "6be1b83ea68ac558aff189d640abe242e0306fe2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/finder/zipball/6be1b83ea68ac558aff189d640abe242e0306fe2", - "reference": "6be1b83ea68ac558aff189d640abe242e0306fe2", - "shasum": "" - }, - "require": { - "nette/utils": "^2.4 || ~3.0.0", - "php": ">=7.1" - }, - "conflict": { - "nette/nette": "<2.2" - }, - "require-dev": { - "nette/tester": "^2.0", - "tracy/tracy": "^2.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.5-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0", - "GPL-3.0" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "https://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "https://nette.org/contributors" - } - ], - "description": "🔍 Nette Finder: find files and directories with an intuitive API.", - "homepage": "https://nette.org", - "keywords": [ - "filesystem", - "glob", - "iterator", - "nette" - ], - "time": "2019-02-28T18:13:25+00:00" - }, - { - "name": "nette/neon", - "version": "v3.0.0", - "source": { - "type": "git", - "url": "https://github.com/nette/neon.git", - "reference": "cbff32059cbdd8720deccf9e9eace6ee516f02eb" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/neon/zipball/cbff32059cbdd8720deccf9e9eace6ee516f02eb", - "reference": "cbff32059cbdd8720deccf9e9eace6ee516f02eb", - "shasum": "" - }, - "require": { - "ext-iconv": "*", - "ext-json": "*", - "php": ">=7.0" - }, - "require-dev": { - "nette/tester": "^2.0", - "tracy/tracy": "^2.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0", - "GPL-3.0" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "https://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "https://nette.org/contributors" - } - ], - "description": "🍸 Nette NEON: encodes and decodes NEON file format.", - "homepage": "http://ne-on.org", - "keywords": [ - "export", - "import", - "neon", - "nette", - "yaml" - ], - "time": "2019-02-05T21:30:40+00:00" - }, - { - "name": "nette/php-generator", - "version": "v3.2.3", - "source": { - "type": "git", - "url": "https://github.com/nette/php-generator.git", - "reference": "aea6e81437bb238e5f0e5b5ce06337433908e63b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/php-generator/zipball/aea6e81437bb238e5f0e5b5ce06337433908e63b", - "reference": "aea6e81437bb238e5f0e5b5ce06337433908e63b", - "shasum": "" - }, - "require": { - "nette/utils": "^2.4.2 || ~3.0.0", - "php": ">=7.1" - }, - "require-dev": { - "nette/tester": "^2.0", - "tracy/tracy": "^2.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.2-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0", - "GPL-3.0" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "https://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "https://nette.org/contributors" - } - ], - "description": "🐘 Nette PHP Generator: generates neat PHP code for you. Supports new PHP 7.3 features.", - "homepage": "https://nette.org", - "keywords": [ - "code", - "nette", - "php", - "scaffolding" - ], - "time": "2019-07-05T13:01:56+00:00" - }, - { - "name": "nette/robot-loader", - "version": "v3.2.0", - "source": { - "type": "git", - "url": "https://github.com/nette/robot-loader.git", - "reference": "0712a0e39ae7956d6a94c0ab6ad41aa842544b5c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/robot-loader/zipball/0712a0e39ae7956d6a94c0ab6ad41aa842544b5c", - "reference": "0712a0e39ae7956d6a94c0ab6ad41aa842544b5c", - "shasum": "" - }, - "require": { - "ext-tokenizer": "*", - "nette/finder": "^2.5", - "nette/utils": "^3.0", - "php": ">=7.1" - }, - "require-dev": { - "nette/tester": "^2.0", - "tracy/tracy": "^2.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.2-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0", - "GPL-3.0" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "https://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "https://nette.org/contributors" - } - ], - "description": "? Nette RobotLoader: high performance and comfortable autoloader that will search and autoload classes within your application.", - "homepage": "https://nette.org", - "keywords": [ - "autoload", - "class", - "interface", - "nette", - "trait" - ], - "time": "2019-03-08T21:57:24+00:00" - }, - { - "name": "nette/schema", - "version": "v1.0.0", - "source": { - "type": "git", - "url": "https://github.com/nette/schema.git", - "reference": "6241d8d4da39e825dd6cb5bfbe4242912f4d7e4d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/schema/zipball/6241d8d4da39e825dd6cb5bfbe4242912f4d7e4d", - "reference": "6241d8d4da39e825dd6cb5bfbe4242912f4d7e4d", - "shasum": "" - }, - "require": { - "nette/utils": "^3.0.1", - "php": ">=7.1" - }, - "require-dev": { - "nette/tester": "^2.2", - "tracy/tracy": "^2.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0", - "GPL-3.0" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "https://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "https://nette.org/contributors" - } - ], - "description": "📐 Nette Schema: validating data structures against a given Schema.", - "homepage": "https://nette.org", - "keywords": [ - "config", - "nette" - ], - "time": "2019-04-03T15:53:25+00:00" - }, - { - "name": "nette/utils", - "version": "v3.0.1", - "source": { - "type": "git", - "url": "https://github.com/nette/utils.git", - "reference": "bd961f49b211997202bda1d0fbc410905be370d4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nette/utils/zipball/bd961f49b211997202bda1d0fbc410905be370d4", - "reference": "bd961f49b211997202bda1d0fbc410905be370d4", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "require-dev": { - "nette/tester": "~2.0", - "tracy/tracy": "^2.3" - }, - "suggest": { - "ext-gd": "to use Image", - "ext-iconv": "to use Strings::webalize() and toAscii()", - "ext-intl": "to use Strings::webalize(), toAscii(), normalize() and compare()", - "ext-json": "to use Nette\\Utils\\Json", - "ext-mbstring": "to use Strings::lower() etc...", - "ext-xml": "to use Strings::length() etc. when mbstring is not available" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause", - "GPL-2.0", - "GPL-3.0" - ], - "authors": [ - { - "name": "David Grudl", - "homepage": "https://davidgrudl.com" - }, - { - "name": "Nette Community", - "homepage": "https://nette.org/contributors" - } + "license": [ + "MIT" ], - "description": "🛠 Nette Utils: lightweight utilities for string & array manipulation, image handling, safe JSON encoding/decoding, validation, slug or strong password generating etc.", - "homepage": "https://nette.org", + "description": "Create deep copies (clones) of your objects", "keywords": [ - "array", - "core", - "datetime", - "images", - "json", - "nette", - "paginator", - "password", - "slugify", - "string", - "unicode", - "utf-8", - "utility", - "validation" - ], - "time": "2019-03-22T01:00:30+00:00" + "clone", + "copy", + "duplicate", + "object", + "object graph" + ], + "time": "2019-08-09T12:45:53+00:00" }, { "name": "nikic/php-parser", - "version": "v4.2.3", + "version": "v4.3.0", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "e612609022e935f3d0337c1295176505b41188c8" + "reference": "9a9981c347c5c49d6dfe5cf826bb882b824080dc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/e612609022e935f3d0337c1295176505b41188c8", - "reference": "e612609022e935f3d0337c1295176505b41188c8", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/9a9981c347c5c49d6dfe5cf826bb882b824080dc", + "reference": "9a9981c347c5c49d6dfe5cf826bb882b824080dc", "shasum": "" }, "require": { @@ -1063,6 +445,7 @@ "php": ">=7.0" }, "require-dev": { + "ircmaxell/php-yacc": "0.0.5", "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0" }, "bin": [ @@ -1071,7 +454,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.2-dev" + "dev-master": "4.3-dev" } }, "autoload": { @@ -1093,57 +476,7 @@ "parser", "php" ], - "time": "2019-08-12T20:17:41+00:00" - }, - { - "name": "ocramius/package-versions", - "version": "1.4.0", - "source": { - "type": "git", - "url": "https://github.com/Ocramius/PackageVersions.git", - "reference": "a4d4b60d0e60da2487bd21a2c6ac089f85570dbb" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Ocramius/PackageVersions/zipball/a4d4b60d0e60da2487bd21a2c6ac089f85570dbb", - "reference": "a4d4b60d0e60da2487bd21a2c6ac089f85570dbb", - "shasum": "" - }, - "require": { - "composer-plugin-api": "^1.0.0", - "php": "^7.1.0" - }, - "require-dev": { - "composer/composer": "^1.6.3", - "doctrine/coding-standard": "^5.0.1", - "ext-zip": "*", - "infection/infection": "^0.7.1", - "phpunit/phpunit": "^7.0.0" - }, - "type": "composer-plugin", - "extra": { - "class": "PackageVersions\\Installer", - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "PackageVersions\\": "src/PackageVersions" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com" - } - ], - "description": "Composer plugin that provides efficient querying for installed package versions (no runtime IO)", - "time": "2019-02-21T12:16:21+00:00" + "time": "2019-11-08T13:50:10+00:00" }, { "name": "phar-io/manifest", @@ -1509,78 +842,56 @@ }, { "name": "phpstan/phpstan", - "version": "0.11.15", + "version": "0.12.18", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "1be5b3a706db16ac472a4c40ec03cf4c810b118d" + "reference": "1ce27fe29c8660a27926127d350d53d80c4d4286" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/1be5b3a706db16ac472a4c40ec03cf4c810b118d", - "reference": "1be5b3a706db16ac472a4c40ec03cf4c810b118d", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/1ce27fe29c8660a27926127d350d53d80c4d4286", + "reference": "1ce27fe29c8660a27926127d350d53d80c4d4286", "shasum": "" }, "require": { - "composer/xdebug-handler": "^1.3.0", - "jean85/pretty-package-versions": "^1.0.3", - "nette/bootstrap": "^2.4 || ^3.0", - "nette/di": "^2.4.7 || ^3.0", - "nette/robot-loader": "^3.0.1", - "nette/schema": "^1.0", - "nette/utils": "^2.4.5 || ^3.0", - "nikic/php-parser": "^4.2.3", - "php": "~7.1", - "phpstan/phpdoc-parser": "^0.3.5", - "symfony/console": "~3.2 || ~4.0", - "symfony/finder": "~3.2 || ~4.0" - }, - "conflict": { - "symfony/console": "3.4.16 || 4.1.5" - }, - "require-dev": { - "brianium/paratest": "^2.0 || ^3.0", - "consistence/coding-standard": "^3.5", - "dealerdirect/phpcodesniffer-composer-installer": "^0.4.4", - "ext-intl": "*", - "ext-mysqli": "*", - "ext-simplexml": "*", - "ext-soap": "*", - "ext-zip": "*", - "jakub-onderka/php-parallel-lint": "^1.0", - "localheinz/composer-normalize": "^1.1.0", - "phing/phing": "^2.16.0", - "phpstan/phpstan-deprecation-rules": "^0.11", - "phpstan/phpstan-php-parser": "^0.11", - "phpstan/phpstan-phpunit": "^0.11", - "phpstan/phpstan-strict-rules": "^0.11", - "phpunit/phpunit": "^7.5.14 || ^8.0", - "slevomat/coding-standard": "^4.7.2", - "squizlabs/php_codesniffer": "^3.3.2" + "php": "^7.1" }, "bin": [ - "bin/phpstan" + "phpstan", + "phpstan.phar" ], "type": "library", "extra": { "branch-alias": { - "dev-master": "0.11-dev" + "dev-master": "0.12-dev" } }, "autoload": { - "psr-4": { - "PHPStan\\": [ - "src/", - "build/PHPStan" - ] - } + "files": [ + "bootstrap.php" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "description": "PHPStan - PHP Static Analysis Tool", - "time": "2019-08-18T20:51:53+00:00" + "funding": [ + { + "url": "https://github.com/ondrejmirtes", + "type": "github" + }, + { + "url": "https://www.patreon.com/phpstan", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpstan/phpstan", + "type": "tidelift" + } + ], + "time": "2020-03-22T16:51:47+00:00" }, { "name": "phpunit/php-code-coverage", @@ -1917,18 +1228,67 @@ ], "time": "2019-10-07T12:57:41+00:00" }, + { + "name": "psr/container", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "time": "2017-02-14T16:28:37+00:00" + }, { "name": "psr/log", - "version": "1.1.0", + "version": "1.1.2", "source": { "type": "git", "url": "https://github.com/php-fig/log.git", - "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd" + "reference": "446d54b4cb6bf489fc9d75f55843658e6f25d801" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", - "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", + "url": "https://api.github.com/repos/php-fig/log/zipball/446d54b4cb6bf489fc9d75f55843658e6f25d801", + "reference": "446d54b4cb6bf489fc9d75f55843658e6f25d801", "shasum": "" }, "require": { @@ -1937,7 +1297,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.1.x-dev" } }, "autoload": { @@ -1962,7 +1322,7 @@ "psr", "psr-3" ], - "time": "2018-11-20T15:27:04+00:00" + "time": "2019-11-01T11:05:21+00:00" }, { "name": "sebastian/code-unit-reverse-lookup", @@ -2528,8 +1888,8 @@ "authors": [ { "name": "Sebastian Bergmann", - "role": "lead", - "email": "sebastian@phpunit.de" + "email": "sebastian@phpunit.de", + "role": "lead" } ], "description": "Collection of value objects that represent the types of the PHP type system", @@ -2672,37 +2032,41 @@ }, { "name": "symfony/console", - "version": "v4.2.4", + "version": "v5.0.2", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "9dc2299a016497f9ee620be94524e6c0af0280a9" + "reference": "fe6e3cd889ca64172d7a742a2eb058541404ef47" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/9dc2299a016497f9ee620be94524e6c0af0280a9", - "reference": "9dc2299a016497f9ee620be94524e6c0af0280a9", + "url": "https://api.github.com/repos/symfony/console/zipball/fe6e3cd889ca64172d7a742a2eb058541404ef47", + "reference": "fe6e3cd889ca64172d7a742a2eb058541404ef47", "shasum": "" }, "require": { - "php": "^7.1.3", - "symfony/contracts": "^1.0", - "symfony/polyfill-mbstring": "~1.0" + "php": "^7.2.5", + "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php73": "^1.8", + "symfony/service-contracts": "^1.1|^2" }, "conflict": { - "symfony/dependency-injection": "<3.4", - "symfony/process": "<3.3" + "symfony/dependency-injection": "<4.4", + "symfony/event-dispatcher": "<4.4", + "symfony/lock": "<4.4", + "symfony/process": "<4.4" }, "provide": { "psr/log-implementation": "1.0" }, "require-dev": { "psr/log": "~1.0", - "symfony/config": "~3.4|~4.0", - "symfony/dependency-injection": "~3.4|~4.0", - "symfony/event-dispatcher": "~3.4|~4.0", - "symfony/lock": "~3.4|~4.0", - "symfony/process": "~3.4|~4.0" + "symfony/config": "^4.4|^5.0", + "symfony/dependency-injection": "^4.4|^5.0", + "symfony/event-dispatcher": "^4.4|^5.0", + "symfony/lock": "^4.4|^5.0", + "symfony/process": "^4.4|^5.0", + "symfony/var-dumper": "^4.4|^5.0" }, "suggest": { "psr/log": "For using the console logger", @@ -2713,7 +2077,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.2-dev" + "dev-master": "5.0-dev" } }, "autoload": { @@ -2740,48 +2104,44 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2019-02-23T15:17:42+00:00" + "time": "2019-12-17T13:20:22+00:00" }, { - "name": "symfony/contracts", - "version": "v1.0.2", + "name": "symfony/debug", + "version": "v4.0.6", "source": { "type": "git", - "url": "https://github.com/symfony/contracts.git", - "reference": "1aa7ab2429c3d594dd70689604b5cf7421254cdf" + "url": "https://github.com/symfony/debug.git", + "reference": "1721e4e7effb23480966690cdcdc7d2a4152d489" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/contracts/zipball/1aa7ab2429c3d594dd70689604b5cf7421254cdf", - "reference": "1aa7ab2429c3d594dd70689604b5cf7421254cdf", + "url": "https://api.github.com/repos/symfony/debug/zipball/1721e4e7effb23480966690cdcdc7d2a4152d489", + "reference": "1721e4e7effb23480966690cdcdc7d2a4152d489", "shasum": "" }, "require": { - "php": "^7.1.3" + "php": "^7.1.3", + "psr/log": "~1.0" }, - "require-dev": { - "psr/cache": "^1.0", - "psr/container": "^1.0" + "conflict": { + "symfony/http-kernel": "<3.4" }, - "suggest": { - "psr/cache": "When using the Cache contracts", - "psr/container": "When using the Service contracts", - "symfony/cache-contracts-implementation": "", - "symfony/service-contracts-implementation": "", - "symfony/translation-contracts-implementation": "" + "require-dev": { + "symfony/http-kernel": "~3.4|~4.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-master": "4.0-dev" } }, "autoload": { "psr-4": { - "Symfony\\Contracts\\": "" + "Symfony\\Component\\Debug\\": "" }, "exclude-from-classmap": [ - "**/Tests/" + "/Tests/" ] }, "notification-url": "https://packagist.org/downloads/", @@ -2790,62 +2150,50 @@ ], "authors": [ { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "A set of abstractions extracted out of the Symfony components", + "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "keywords": [ - "abstractions", - "contracts", - "decoupling", - "interfaces", - "interoperability", - "standards" - ], - "time": "2018-12-05T08:06:11+00:00" + "time": "2018-02-28T21:50:02+00:00" }, { - "name": "symfony/debug", - "version": "v4.0.6", + "name": "symfony/polyfill-ctype", + "version": "v1.12.0", "source": { "type": "git", - "url": "https://github.com/symfony/debug.git", - "reference": "1721e4e7effb23480966690cdcdc7d2a4152d489" + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "550ebaac289296ce228a706d0867afc34687e3f4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/1721e4e7effb23480966690cdcdc7d2a4152d489", - "reference": "1721e4e7effb23480966690cdcdc7d2a4152d489", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/550ebaac289296ce228a706d0867afc34687e3f4", + "reference": "550ebaac289296ce228a706d0867afc34687e3f4", "shasum": "" }, "require": { - "php": "^7.1.3", - "psr/log": "~1.0" - }, - "conflict": { - "symfony/http-kernel": "<3.4" + "php": ">=5.3.3" }, - "require-dev": { - "symfony/http-kernel": "~3.4|~4.0" + "suggest": { + "ext-ctype": "For best performance" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-master": "1.12-dev" } }, "autoload": { "psr-4": { - "Symfony\\Component\\Debug\\": "" + "Symfony\\Polyfill\\Ctype\\": "" }, - "exclude-from-classmap": [ - "/Tests/" + "files": [ + "bootstrap.php" ] }, "notification-url": "https://packagist.org/downloads/", @@ -2854,47 +2202,56 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony Debug Component", + "description": "Symfony polyfill for ctype functions", "homepage": "https://symfony.com", - "time": "2018-02-28T21:50:02+00:00" + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "time": "2019-08-06T08:03:45+00:00" }, { - "name": "symfony/finder", - "version": "v4.3.3", + "name": "symfony/polyfill-mbstring", + "version": "v1.13.1", "source": { "type": "git", - "url": "https://github.com/symfony/finder.git", - "reference": "9638d41e3729459860bb96f6247ccb61faaa45f2" + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "7b4aab9743c30be783b73de055d24a39cf4b954f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/9638d41e3729459860bb96f6247ccb61faaa45f2", - "reference": "9638d41e3729459860bb96f6247ccb61faaa45f2", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/7b4aab9743c30be783b73de055d24a39cf4b954f", + "reference": "7b4aab9743c30be783b73de055d24a39cf4b954f", "shasum": "" }, "require": { - "php": "^7.1.3" + "php": ">=5.3.3" + }, + "suggest": { + "ext-mbstring": "For best performance" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.3-dev" + "dev-master": "1.13-dev" } }, "autoload": { "psr-4": { - "Symfony\\Component\\Finder\\": "" + "Symfony\\Polyfill\\Mbstring\\": "" }, - "exclude-from-classmap": [ - "/Tests/" + "files": [ + "bootstrap.php" ] }, "notification-url": "https://packagist.org/downloads/", @@ -2903,50 +2260,57 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony Finder Component", + "description": "Symfony polyfill for the Mbstring extension", "homepage": "https://symfony.com", - "time": "2019-06-28T13:16:30+00:00" + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "time": "2019-11-27T14:18:11+00:00" }, { - "name": "symfony/polyfill-ctype", - "version": "v1.12.0", + "name": "symfony/polyfill-php73", + "version": "v1.13.1", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "550ebaac289296ce228a706d0867afc34687e3f4" + "url": "https://github.com/symfony/polyfill-php73.git", + "reference": "4b0e2222c55a25b4541305a053013d5647d3a25f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/550ebaac289296ce228a706d0867afc34687e3f4", - "reference": "550ebaac289296ce228a706d0867afc34687e3f4", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/4b0e2222c55a25b4541305a053013d5647d3a25f", + "reference": "4b0e2222c55a25b4541305a053013d5647d3a25f", "shasum": "" }, "require": { "php": ">=5.3.3" }, - "suggest": { - "ext-ctype": "For best performance" - }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.12-dev" + "dev-master": "1.13-dev" } }, "autoload": { "psr-4": { - "Symfony\\Polyfill\\Ctype\\": "" + "Symfony\\Polyfill\\Php73\\": "" }, "files": [ "bootstrap.php" + ], + "classmap": [ + "Resources/stubs" ] }, "notification-url": "https://packagist.org/downloads/", @@ -2955,57 +2319,55 @@ ], "authors": [ { - "name": "Gert de Pagter", - "email": "BackEndTea@gmail.com" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill for ctype functions", + "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", "homepage": "https://symfony.com", "keywords": [ "compatibility", - "ctype", "polyfill", - "portable" + "portable", + "shim" ], - "time": "2019-08-06T08:03:45+00:00" + "time": "2019-11-27T16:25:15+00:00" }, { - "name": "symfony/polyfill-mbstring", - "version": "v1.10.0", + "name": "symfony/service-contracts", + "version": "v2.0.1", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "c79c051f5b3a46be09205c73b80b346e4153e494" + "url": "https://github.com/symfony/service-contracts.git", + "reference": "144c5e51266b281231e947b51223ba14acf1a749" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/c79c051f5b3a46be09205c73b80b346e4153e494", - "reference": "c79c051f5b3a46be09205c73b80b346e4153e494", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/144c5e51266b281231e947b51223ba14acf1a749", + "reference": "144c5e51266b281231e947b51223ba14acf1a749", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": "^7.2.5", + "psr/container": "^1.0" }, "suggest": { - "ext-mbstring": "For best performance" + "symfony/service-implementation": "" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.9-dev" + "dev-master": "2.0-dev" } }, "autoload": { "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" - }, - "files": [ - "bootstrap.php" - ] + "Symfony\\Contracts\\Service\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -3021,16 +2383,17 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill for the Mbstring extension", + "description": "Generic abstractions related to writing services", "homepage": "https://symfony.com", "keywords": [ - "compatibility", - "mbstring", - "polyfill", - "portable", - "shim" + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" ], - "time": "2018-09-21T13:07:52+00:00" + "time": "2019-11-18T17:27:11+00:00" }, { "name": "theseer/tokenizer", @@ -3132,5 +2495,6 @@ "php": "^7.2", "ext-pdo": "*" }, - "platform-dev": [] + "platform-dev": [], + "plugin-api-version": "1.1.0" } From f440d92cecf704e6267a9eb9dd925581a752d91c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lu=C3=ADs=20Cobucci?= Date: Tue, 31 Dec 2019 10:03:06 +0100 Subject: [PATCH 05/16] Respect interface's return type in methods --- lib/Doctrine/DBAL/Cache/ArrayStatement.php | 2 ++ .../DBAL/Driver/IBMDB2/DB2Connection.php | 19 ++++++++++++++++--- .../SQLAnywhere/SQLAnywhereStatement.php | 2 ++ .../DBAL/Driver/SQLSrv/SQLSrvConnection.php | 6 ++++++ .../DBAL/Driver/SQLSrv/SQLSrvStatement.php | 6 ++++++ 5 files changed, 32 insertions(+), 3 deletions(-) diff --git a/lib/Doctrine/DBAL/Cache/ArrayStatement.php b/lib/Doctrine/DBAL/Cache/ArrayStatement.php index 449a220a2af..5b72e599ac3 100644 --- a/lib/Doctrine/DBAL/Cache/ArrayStatement.php +++ b/lib/Doctrine/DBAL/Cache/ArrayStatement.php @@ -46,6 +46,8 @@ public function __construct(array $data) public function closeCursor() { unset($this->data); + + return true; } /** diff --git a/lib/Doctrine/DBAL/Driver/IBMDB2/DB2Connection.php b/lib/Doctrine/DBAL/Driver/IBMDB2/DB2Connection.php index cb1e6018f3e..f03fa6a20c3 100644 --- a/lib/Doctrine/DBAL/Driver/IBMDB2/DB2Connection.php +++ b/lib/Doctrine/DBAL/Driver/IBMDB2/DB2Connection.php @@ -8,6 +8,7 @@ use stdClass; use const DB2_AUTOCOMMIT_OFF; use const DB2_AUTOCOMMIT_ON; +use function assert; use function db2_autocommit; use function db2_commit; use function db2_conn_error; @@ -23,6 +24,7 @@ use function db2_server_info; use function db2_stmt_errormsg; use function func_get_args; +use function is_bool; class DB2Connection implements Connection, ServerInfoAwareConnection { @@ -140,7 +142,10 @@ public function lastInsertId($name = null) */ public function beginTransaction() { - db2_autocommit($this->conn, DB2_AUTOCOMMIT_OFF); + $result = db2_autocommit($this->conn, DB2_AUTOCOMMIT_OFF); + assert(is_bool($result)); + + return $result; } /** @@ -151,7 +156,11 @@ public function commit() if (! db2_commit($this->conn)) { throw new DB2Exception(db2_conn_errormsg($this->conn)); } - db2_autocommit($this->conn, DB2_AUTOCOMMIT_ON); + + $result = db2_autocommit($this->conn, DB2_AUTOCOMMIT_ON); + assert(is_bool($result)); + + return $result; } /** @@ -162,7 +171,11 @@ public function rollBack() if (! db2_rollback($this->conn)) { throw new DB2Exception(db2_conn_errormsg($this->conn)); } - db2_autocommit($this->conn, DB2_AUTOCOMMIT_ON); + + $result = db2_autocommit($this->conn, DB2_AUTOCOMMIT_ON); + assert(is_bool($result)); + + return $result; } /** diff --git a/lib/Doctrine/DBAL/Driver/SQLAnywhere/SQLAnywhereStatement.php b/lib/Doctrine/DBAL/Driver/SQLAnywhere/SQLAnywhereStatement.php index 886bb245873..ff1759aba26 100644 --- a/lib/Doctrine/DBAL/Driver/SQLAnywhere/SQLAnywhereStatement.php +++ b/lib/Doctrine/DBAL/Driver/SQLAnywhere/SQLAnywhereStatement.php @@ -313,6 +313,8 @@ public function setFetchMode($fetchMode, $arg2 = null, $arg3 = null) $this->defaultFetchMode = $fetchMode; $this->defaultFetchClass = $arg2 ?: $this->defaultFetchClass; $this->defaultFetchClassCtorArgs = $arg3 ? (array) $arg3 : $this->defaultFetchClassCtorArgs; + + return true; } /** diff --git a/lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvConnection.php b/lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvConnection.php index 35ad913ff5b..71b450d98e0 100644 --- a/lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvConnection.php +++ b/lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvConnection.php @@ -152,6 +152,8 @@ public function beginTransaction() if (! sqlsrv_begin_transaction($this->conn)) { throw SQLSrvException::fromSqlSrvErrors(); } + + return true; } /** @@ -162,6 +164,8 @@ public function commit() if (! sqlsrv_commit($this->conn)) { throw SQLSrvException::fromSqlSrvErrors(); } + + return true; } /** @@ -172,6 +176,8 @@ public function rollBack() if (! sqlsrv_rollback($this->conn)) { throw SQLSrvException::fromSqlSrvErrors(); } + + return true; } /** diff --git a/lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvStatement.php b/lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvStatement.php index 5e7016c5a74..1e1c0a2a7f2 100644 --- a/lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvStatement.php +++ b/lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvStatement.php @@ -158,6 +158,8 @@ public function bindValue($param, $value, $type = ParameterType::STRING) $this->variables[$param] = $value; $this->types[$param] = $type; + + return true; } /** @@ -174,6 +176,8 @@ public function bindParam($column, &$variable, $type = ParameterType::STRING, $l // unset the statement resource if it exists as the new one will need to be bound to the new variable $this->stmt = null; + + return true; } /** @@ -263,6 +267,8 @@ public function execute($params = null) } $this->result = true; + + return true; } /** From 35beaca3bed81ad4983e58706ae38688de34a853 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lu=C3=ADs=20Cobucci?= Date: Tue, 31 Dec 2019 11:13:34 +0100 Subject: [PATCH 06/16] Declare return types in a BC compatible manner --- lib/Doctrine/DBAL/Configuration.php | 2 ++ lib/Doctrine/DBAL/Connection.php | 10 ++++++++-- lib/Doctrine/DBAL/Driver/Mysqli/MysqliConnection.php | 4 ++-- lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php | 4 ++-- lib/Doctrine/DBAL/Driver/SQLSrv/LastInsertId.php | 2 ++ lib/Doctrine/DBAL/Platforms/AbstractPlatform.php | 6 ++++++ lib/Doctrine/DBAL/Platforms/DB2Platform.php | 2 +- lib/Doctrine/DBAL/Platforms/DrizzlePlatform.php | 3 ++- lib/Doctrine/DBAL/Platforms/OraclePlatform.php | 5 ++++- lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php | 2 ++ lib/Doctrine/DBAL/Platforms/SqlitePlatform.php | 6 ++++-- lib/Doctrine/DBAL/Query/QueryBuilder.php | 2 +- lib/Doctrine/DBAL/Schema/DB2SchemaManager.php | 3 ++- lib/Doctrine/DBAL/Schema/SQLAnywhereSchemaManager.php | 4 ++++ lib/Doctrine/DBAL/Schema/SqliteSchemaManager.php | 4 ++-- .../Synchronizer/AbstractSchemaSynchronizer.php | 4 ++++ lib/Doctrine/DBAL/Schema/Table.php | 2 ++ lib/Doctrine/DBAL/Schema/Visitor/NamespaceVisitor.php | 2 ++ .../DBAL/Schema/Visitor/SchemaDiffVisitor.php | 11 +++++++++++ .../DBAL/Tools/Console/Command/ImportCommand.php | 4 +--- .../Tools/Console/Command/ReservedWordsCommand.php | 4 +--- .../DBAL/Tools/Console/Command/RunSqlCommand.php | 4 +--- lib/Doctrine/DBAL/Tools/Console/ConsoleRunner.php | 2 ++ lib/Doctrine/DBAL/Types/ConversionException.php | 3 +++ 24 files changed, 71 insertions(+), 24 deletions(-) diff --git a/lib/Doctrine/DBAL/Configuration.php b/lib/Doctrine/DBAL/Configuration.php index 2cc0070d0cb..13260cd08bb 100644 --- a/lib/Doctrine/DBAL/Configuration.php +++ b/lib/Doctrine/DBAL/Configuration.php @@ -140,6 +140,8 @@ public function getSchemaAssetsFilter() : ?callable * @see getAutoCommit * * @param bool $autoCommit True to enable auto-commit mode; false to disable it. + * + * @return void */ public function setAutoCommit($autoCommit) { diff --git a/lib/Doctrine/DBAL/Connection.php b/lib/Doctrine/DBAL/Connection.php index ee6c08635ce..e2d78ae1559 100644 --- a/lib/Doctrine/DBAL/Connection.php +++ b/lib/Doctrine/DBAL/Connection.php @@ -383,7 +383,7 @@ public function connect() * * @throws DBALException If an invalid platform was specified for this connection. */ - private function detectDatabasePlatform() + private function detectDatabasePlatform() : void { $version = $this->getDatabasePlatformVersion(); @@ -504,6 +504,8 @@ public function isAutoCommit() * @see isAutoCommit * * @param bool $autoCommit True to enable auto-commit mode; false to disable it. + * + * @return void */ public function setAutoCommit($autoCommit) { @@ -1316,7 +1318,7 @@ public function commit() /** * Commits all current nesting transactions. */ - private function commitAll() + private function commitAll() : void { while ($this->transactionNestingLevel !== 0) { if ($this->autoCommit === false && $this->transactionNestingLevel === 1) { @@ -1334,6 +1336,8 @@ private function commitAll() /** * Cancels any database changes done during the current transaction. * + * @return bool + * * @throws ConnectionException If the rollback operation failed. */ public function rollBack() @@ -1373,6 +1377,8 @@ public function rollBack() $this->isRollbackOnly = true; --$this->transactionNestingLevel; } + + return true; } /** diff --git a/lib/Doctrine/DBAL/Driver/Mysqli/MysqliConnection.php b/lib/Doctrine/DBAL/Driver/Mysqli/MysqliConnection.php index 1f1a1d218c3..68096ba80e0 100644 --- a/lib/Doctrine/DBAL/Driver/Mysqli/MysqliConnection.php +++ b/lib/Doctrine/DBAL/Driver/Mysqli/MysqliConnection.php @@ -222,7 +222,7 @@ public function errorInfo() * @throws MysqliException When one of of the options is not supported. * @throws MysqliException When applying doesn't work - e.g. due to incorrect value. */ - private function setDriverOptions(array $driverOptions = []) + private function setDriverOptions(array $driverOptions = []) : void { $supportedDriverOptions = [ MYSQLI_OPT_CONNECT_TIMEOUT, @@ -281,7 +281,7 @@ public function ping() * * @throws MysqliException */ - private function setSecureConnection(array $params) + private function setSecureConnection(array $params) : void { if (! isset($params['ssl_key']) && ! isset($params['ssl_cert']) && diff --git a/lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php b/lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php index 43d70853ef5..17b7cb28a7c 100644 --- a/lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php +++ b/lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php @@ -207,7 +207,7 @@ public function execute($params = null) /** * Binds parameters with known types previously bound to the statement */ - private function bindTypedParameters() + private function bindTypedParameters() : void { $streams = $values = []; $types = $this->types; @@ -245,7 +245,7 @@ private function bindTypedParameters() * * @throws MysqliException */ - private function sendLongData($streams) + private function sendLongData($streams) : void { foreach ($streams as $paramNr => $stream) { while (! feof($stream)) { diff --git a/lib/Doctrine/DBAL/Driver/SQLSrv/LastInsertId.php b/lib/Doctrine/DBAL/Driver/SQLSrv/LastInsertId.php index 363b260950e..94c19f6effc 100644 --- a/lib/Doctrine/DBAL/Driver/SQLSrv/LastInsertId.php +++ b/lib/Doctrine/DBAL/Driver/SQLSrv/LastInsertId.php @@ -12,6 +12,8 @@ class LastInsertId /** * @param int $id + * + * @return void */ public function setId($id) { diff --git a/lib/Doctrine/DBAL/Platforms/AbstractPlatform.php b/lib/Doctrine/DBAL/Platforms/AbstractPlatform.php index 3d833dfaaeb..f805b3d8c52 100644 --- a/lib/Doctrine/DBAL/Platforms/AbstractPlatform.php +++ b/lib/Doctrine/DBAL/Platforms/AbstractPlatform.php @@ -156,6 +156,8 @@ public function __construct() /** * Sets the EventManager used by the Platform. + * + * @return void */ public function setEventManager(EventManager $eventManager) { @@ -391,6 +393,8 @@ abstract public function getName(); * @param string $dbType * @param string $doctrineType * + * @return void + * * @throws DBALException If the type is not found. */ public function registerDoctrineTypeMapping($dbType, $doctrineType) @@ -3291,6 +3295,8 @@ public function hasNativeJsonType() /** * @deprecated * + * @return string + * * @todo Remove in 3.0 */ public function getIdentityColumnNullInsertSQL() diff --git a/lib/Doctrine/DBAL/Platforms/DB2Platform.php b/lib/Doctrine/DBAL/Platforms/DB2Platform.php index 25d4163b6ec..2dbf7f5df86 100644 --- a/lib/Doctrine/DBAL/Platforms/DB2Platform.php +++ b/lib/Doctrine/DBAL/Platforms/DB2Platform.php @@ -628,7 +628,7 @@ public function getAlterTableSQL(TableDiff $diff) * @param string[] $sql The sequence of table alteration statements to fill. * @param mixed[] $queryParts The sequence of column alteration clauses to fill. */ - private function gatherAlterColumnSQL(Identifier $table, ColumnDiff $columnDiff, array &$sql, array &$queryParts) + private function gatherAlterColumnSQL(Identifier $table, ColumnDiff $columnDiff, array &$sql, array &$queryParts) : void { $alterColumnClauses = $this->getAlterColumnClausesSQL($columnDiff); diff --git a/lib/Doctrine/DBAL/Platforms/DrizzlePlatform.php b/lib/Doctrine/DBAL/Platforms/DrizzlePlatform.php index 8f6f0966323..983046afcd0 100644 --- a/lib/Doctrine/DBAL/Platforms/DrizzlePlatform.php +++ b/lib/Doctrine/DBAL/Platforms/DrizzlePlatform.php @@ -435,7 +435,8 @@ public function getDropIndexSQL($index, $table = null) } /** - * {@inheritDoc} + * + * @return string */ protected function getDropPrimaryKeySQL($table) { diff --git a/lib/Doctrine/DBAL/Platforms/OraclePlatform.php b/lib/Doctrine/DBAL/Platforms/OraclePlatform.php index 21b13a2d691..3fa40870140 100644 --- a/lib/Doctrine/DBAL/Platforms/OraclePlatform.php +++ b/lib/Doctrine/DBAL/Platforms/OraclePlatform.php @@ -37,6 +37,8 @@ class OraclePlatform extends AbstractPlatform * * @param string $identifier * + * @return void + * * @throws DBALException */ public static function assertValidIdentifier($identifier) @@ -59,7 +61,8 @@ public function getSubstringExpression($value, $position, $length = null) } /** - * {@inheritDoc} + * + * @return string */ public function getNowExpression($type = 'timestamp') { diff --git a/lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php b/lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php index dd90f2cb6b3..a2bdf26219a 100644 --- a/lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php +++ b/lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php @@ -69,6 +69,8 @@ class PostgreSqlPlatform extends AbstractPlatform * Enables use of 'true'/'false' or otherwise 1 and 0 instead. * * @param bool $flag + * + * @return void */ public function setUseBooleanTrueFalseStrings($flag) { diff --git a/lib/Doctrine/DBAL/Platforms/SqlitePlatform.php b/lib/Doctrine/DBAL/Platforms/SqlitePlatform.php index 02d2482c86e..d3a7d499faa 100644 --- a/lib/Doctrine/DBAL/Platforms/SqlitePlatform.php +++ b/lib/Doctrine/DBAL/Platforms/SqlitePlatform.php @@ -222,7 +222,8 @@ public function getBigIntTypeDeclarationSQL(array $field) } /** - * {@inheritDoc} + * + * @return string */ public function getTinyIntTypeDeclarationSql(array $field) { @@ -248,7 +249,8 @@ public function getSmallIntTypeDeclarationSQL(array $field) } /** - * {@inheritDoc} + * + * @return string */ public function getMediumIntTypeDeclarationSql(array $field) { diff --git a/lib/Doctrine/DBAL/Query/QueryBuilder.php b/lib/Doctrine/DBAL/Query/QueryBuilder.php index 5148c82ca94..e76ca0e0758 100644 --- a/lib/Doctrine/DBAL/Query/QueryBuilder.php +++ b/lib/Doctrine/DBAL/Query/QueryBuilder.php @@ -1174,7 +1174,7 @@ private function getFromClauses() * * @throws QueryException */ - private function verifyAllAliasesAreKnown(array $knownAliases) + private function verifyAllAliasesAreKnown(array $knownAliases) : void { foreach ($this->sqlParts['join'] as $fromAlias => $joins) { if (! isset($knownAliases[$fromAlias])) { diff --git a/lib/Doctrine/DBAL/Schema/DB2SchemaManager.php b/lib/Doctrine/DBAL/Schema/DB2SchemaManager.php index b1fe64afef4..6b2d63b64bb 100644 --- a/lib/Doctrine/DBAL/Schema/DB2SchemaManager.php +++ b/lib/Doctrine/DBAL/Schema/DB2SchemaManager.php @@ -178,7 +178,8 @@ protected function _getPortableTableForeignKeysList($tableForeignKeys) } /** - * {@inheritdoc} + * + * @return string|null */ protected function _getPortableForeignKeyRuleDef($def) { diff --git a/lib/Doctrine/DBAL/Schema/SQLAnywhereSchemaManager.php b/lib/Doctrine/DBAL/Schema/SQLAnywhereSchemaManager.php index c169a6e0708..13cdcb0952d 100644 --- a/lib/Doctrine/DBAL/Schema/SQLAnywhereSchemaManager.php +++ b/lib/Doctrine/DBAL/Schema/SQLAnywhereSchemaManager.php @@ -47,6 +47,8 @@ public function dropDatabase($database) * Starts a database. * * @param string $database The name of the database to start. + * + * @return void */ public function startDatabase($database) { @@ -58,6 +60,8 @@ public function startDatabase($database) * Stops a database. * * @param string $database The name of the database to stop. + * + * @return void */ public function stopDatabase($database) { diff --git a/lib/Doctrine/DBAL/Schema/SqliteSchemaManager.php b/lib/Doctrine/DBAL/Schema/SqliteSchemaManager.php index ac758015a0f..6af35e9c206 100644 --- a/lib/Doctrine/DBAL/Schema/SqliteSchemaManager.php +++ b/lib/Doctrine/DBAL/Schema/SqliteSchemaManager.php @@ -223,9 +223,9 @@ protected function _getPortableTableIndexesList($tableIndexes, $tableName = null } /** - * {@inheritdoc} - * * @deprecated + * + * @return array */ protected function _getPortableTableIndexDefinition($tableIndex) { diff --git a/lib/Doctrine/DBAL/Schema/Synchronizer/AbstractSchemaSynchronizer.php b/lib/Doctrine/DBAL/Schema/Synchronizer/AbstractSchemaSynchronizer.php index b597b8db9b2..9b1974747e7 100644 --- a/lib/Doctrine/DBAL/Schema/Synchronizer/AbstractSchemaSynchronizer.php +++ b/lib/Doctrine/DBAL/Schema/Synchronizer/AbstractSchemaSynchronizer.php @@ -20,6 +20,8 @@ public function __construct(Connection $conn) /** * @param string[] $sql + * + * @return void */ protected function processSqlSafely(array $sql) { @@ -33,6 +35,8 @@ protected function processSqlSafely(array $sql) /** * @param string[] $sql + * + * @return void */ protected function processSql(array $sql) { diff --git a/lib/Doctrine/DBAL/Schema/Table.php b/lib/Doctrine/DBAL/Schema/Table.php index 8e613320f79..842d1fccf67 100644 --- a/lib/Doctrine/DBAL/Schema/Table.php +++ b/lib/Doctrine/DBAL/Schema/Table.php @@ -300,6 +300,8 @@ public function addColumn($columnName, $typeName, array $options = []) * @param string $oldColumnName * @param string $newColumnName * + * @return void + * * @throws DBALException */ public function renameColumn($oldColumnName, $newColumnName) diff --git a/lib/Doctrine/DBAL/Schema/Visitor/NamespaceVisitor.php b/lib/Doctrine/DBAL/Schema/Visitor/NamespaceVisitor.php index 186fe1b4213..b0548d6064a 100644 --- a/lib/Doctrine/DBAL/Schema/Visitor/NamespaceVisitor.php +++ b/lib/Doctrine/DBAL/Schema/Visitor/NamespaceVisitor.php @@ -11,6 +11,8 @@ interface NamespaceVisitor * Accepts a schema namespace name. * * @param string $namespaceName The schema namespace name to accept. + * + * @return void */ public function acceptNamespace($namespaceName); } diff --git a/lib/Doctrine/DBAL/Schema/Visitor/SchemaDiffVisitor.php b/lib/Doctrine/DBAL/Schema/Visitor/SchemaDiffVisitor.php index 5ec843d9be6..040b59f5549 100644 --- a/lib/Doctrine/DBAL/Schema/Visitor/SchemaDiffVisitor.php +++ b/lib/Doctrine/DBAL/Schema/Visitor/SchemaDiffVisitor.php @@ -14,26 +14,37 @@ interface SchemaDiffVisitor { /** * Visit an orphaned foreign key whose table was deleted. + * + * @return void */ public function visitOrphanedForeignKey(ForeignKeyConstraint $foreignKey); /** * Visit a sequence that has changed. + * + * @return void */ public function visitChangedSequence(Sequence $sequence); /** * Visit a sequence that has been removed. + * + * @return void */ public function visitRemovedSequence(Sequence $sequence); + /** @return void */ public function visitNewSequence(Sequence $sequence); + /** @return void */ public function visitNewTable(Table $table); + /** @return void */ public function visitNewTableForeignKey(Table $table, ForeignKeyConstraint $foreignKey); + /** @return void */ public function visitRemovedTable(Table $table); + /** @return void */ public function visitChangedTable(TableDiff $tableDiff); } diff --git a/lib/Doctrine/DBAL/Tools/Console/Command/ImportCommand.php b/lib/Doctrine/DBAL/Tools/Console/Command/ImportCommand.php index 0cd2999c97a..c142accfd77 100644 --- a/lib/Doctrine/DBAL/Tools/Console/Command/ImportCommand.php +++ b/lib/Doctrine/DBAL/Tools/Console/Command/ImportCommand.php @@ -28,9 +28,7 @@ */ class ImportCommand extends Command { - /** - * {@inheritdoc} - */ + /** @return void */ protected function configure() { $this diff --git a/lib/Doctrine/DBAL/Tools/Console/Command/ReservedWordsCommand.php b/lib/Doctrine/DBAL/Tools/Console/Command/ReservedWordsCommand.php index 2e0c48a815b..6de3345b128 100644 --- a/lib/Doctrine/DBAL/Tools/Console/Command/ReservedWordsCommand.php +++ b/lib/Doctrine/DBAL/Tools/Console/Command/ReservedWordsCommand.php @@ -66,9 +66,7 @@ public function setKeywordListClass($name, $class) $this->keywordListClasses[$name] = $class; } - /** - * {@inheritdoc} - */ + /** @return void */ protected function configure() { $this diff --git a/lib/Doctrine/DBAL/Tools/Console/Command/RunSqlCommand.php b/lib/Doctrine/DBAL/Tools/Console/Command/RunSqlCommand.php index b479baec2ee..5111a6505db 100644 --- a/lib/Doctrine/DBAL/Tools/Console/Command/RunSqlCommand.php +++ b/lib/Doctrine/DBAL/Tools/Console/Command/RunSqlCommand.php @@ -21,9 +21,7 @@ */ class RunSqlCommand extends Command { - /** - * {@inheritdoc} - */ + /** @return void */ protected function configure() { $this diff --git a/lib/Doctrine/DBAL/Tools/Console/ConsoleRunner.php b/lib/Doctrine/DBAL/Tools/Console/ConsoleRunner.php index 520a9af80aa..e028c807c01 100644 --- a/lib/Doctrine/DBAL/Tools/Console/ConsoleRunner.php +++ b/lib/Doctrine/DBAL/Tools/Console/ConsoleRunner.php @@ -63,6 +63,8 @@ public static function addCommands(Application $cli) /** * Prints the instructions to create a configuration file + * + * @return void */ public static function printCliConfigTemplate() { diff --git a/lib/Doctrine/DBAL/Types/ConversionException.php b/lib/Doctrine/DBAL/Types/ConversionException.php index 87f79a91cdc..7ec6e75f52e 100644 --- a/lib/Doctrine/DBAL/Types/ConversionException.php +++ b/lib/Doctrine/DBAL/Types/ConversionException.php @@ -90,6 +90,9 @@ public static function conversionFailedInvalidType( ), 0, $previous); } + /** + * @return ConversionException + */ public static function conversionFailedSerialization($value, $format, $error) { $actualType = is_object($value) ? get_class($value) : gettype($value); From 2649ae6a3cec71dd77fe9f7d92db305cc95dbd81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lu=C3=ADs=20Cobucci?= Date: Tue, 31 Dec 2019 10:38:10 +0100 Subject: [PATCH 07/16] Fix argument type declaration By either defining their types or renaming to match parent class (or interface). --- .../DBAL/Connections/MasterSlaveConnection.php | 4 +++- lib/Doctrine/DBAL/DBALException.php | 2 +- lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php | 6 +++++- lib/Doctrine/DBAL/Driver/PDOConnection.php | 5 ++++- lib/Doctrine/DBAL/Driver/PDOStatement.php | 8 +++++++- lib/Doctrine/DBAL/Platforms/DrizzlePlatform.php | 6 +++++- lib/Doctrine/DBAL/Platforms/MySqlPlatform.php | 5 ++++- lib/Doctrine/DBAL/Platforms/OraclePlatform.php | 1 + lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php | 5 ++++- lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php | 5 ++++- lib/Doctrine/DBAL/Platforms/SqlitePlatform.php | 13 ++++++++++--- lib/Doctrine/DBAL/Schema/DB2SchemaManager.php | 1 + lib/Doctrine/DBAL/Schema/SqliteSchemaManager.php | 2 ++ lib/Doctrine/DBAL/Types/ConversionException.php | 4 ++++ 14 files changed, 55 insertions(+), 12 deletions(-) diff --git a/lib/Doctrine/DBAL/Connections/MasterSlaveConnection.php b/lib/Doctrine/DBAL/Connections/MasterSlaveConnection.php index ff310d9196b..1f8ae27ba51 100644 --- a/lib/Doctrine/DBAL/Connections/MasterSlaveConnection.php +++ b/lib/Doctrine/DBAL/Connections/MasterSlaveConnection.php @@ -120,7 +120,9 @@ public function isConnectedToMaster() } /** - * {@inheritDoc} + * @param string|null $connectionName + * + * @return bool */ public function connect($connectionName = null) { diff --git a/lib/Doctrine/DBAL/DBALException.php b/lib/Doctrine/DBAL/DBALException.php index 4961af2f35f..fe706daffcf 100644 --- a/lib/Doctrine/DBAL/DBALException.php +++ b/lib/Doctrine/DBAL/DBALException.php @@ -157,7 +157,7 @@ public static function driverException(Driver $driver, Throwable $driverEx) /** * @return self */ - private static function wrapException(Driver $driver, Throwable $driverEx, $msg) + private static function wrapException(Driver $driver, Throwable $driverEx, string $msg) { if ($driverEx instanceof DriverException) { return $driverEx; diff --git a/lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php b/lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php index 17b7cb28a7c..b1edcf4eed3 100644 --- a/lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php +++ b/lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php @@ -213,6 +213,8 @@ private function bindTypedParameters() : void $types = $this->types; foreach ($this->_bindedValues as $parameter => $value) { + assert(is_int($parameter)); + if (! isset($types[$parameter - 1])) { $types[$parameter - 1] = static::$_paramTypeMap[ParameterType::STRING]; } @@ -243,9 +245,11 @@ private function bindTypedParameters() : void /** * Handle $this->_longData after regular query parameters have been bound * + * @param array $streams + * * @throws MysqliException */ - private function sendLongData($streams) : void + private function sendLongData(array $streams) : void { foreach ($streams as $paramNr => $stream) { while (! feof($stream)) { diff --git a/lib/Doctrine/DBAL/Driver/PDOConnection.php b/lib/Doctrine/DBAL/Driver/PDOConnection.php index 336542ea50a..ffd80d7423c 100644 --- a/lib/Doctrine/DBAL/Driver/PDOConnection.php +++ b/lib/Doctrine/DBAL/Driver/PDOConnection.php @@ -53,7 +53,10 @@ public function getServerVersion() } /** - * {@inheritdoc} + * @param string $prepareString + * @param array $driverOptions + * + * @return Statement */ public function prepare($prepareString, $driverOptions = []) { diff --git a/lib/Doctrine/DBAL/Driver/PDOStatement.php b/lib/Doctrine/DBAL/Driver/PDOStatement.php index 6e61d22555a..26f0f2e7819 100644 --- a/lib/Doctrine/DBAL/Driver/PDOStatement.php +++ b/lib/Doctrine/DBAL/Driver/PDOStatement.php @@ -85,7 +85,13 @@ public function bindValue($param, $value, $type = ParameterType::STRING) } /** - * {@inheritdoc} + * @param mixed $column + * @param mixed $variable + * @param int $type + * @param int|null $length + * @param mixed $driverOptions + * + * @return bool */ public function bindParam($column, &$variable, $type = ParameterType::STRING, $length = null, $driverOptions = null) { diff --git a/lib/Doctrine/DBAL/Platforms/DrizzlePlatform.php b/lib/Doctrine/DBAL/Platforms/DrizzlePlatform.php index 983046afcd0..60aef82cebe 100644 --- a/lib/Doctrine/DBAL/Platforms/DrizzlePlatform.php +++ b/lib/Doctrine/DBAL/Platforms/DrizzlePlatform.php @@ -335,7 +335,10 @@ public function getListTableColumnsSQL($table, $database = null) } /** - * {@inheritDoc} + * @param string $table + * @param string|null $database + * + * @return string */ public function getListTableForeignKeysSQL($table, $database = null) { @@ -435,6 +438,7 @@ public function getDropIndexSQL($index, $table = null) } /** + * @param string $table * * @return string */ diff --git a/lib/Doctrine/DBAL/Platforms/MySqlPlatform.php b/lib/Doctrine/DBAL/Platforms/MySqlPlatform.php index 57c448ce93e..409f6eef86a 100644 --- a/lib/Doctrine/DBAL/Platforms/MySqlPlatform.php +++ b/lib/Doctrine/DBAL/Platforms/MySqlPlatform.php @@ -175,7 +175,10 @@ public function getListViewsSQL($database) } /** - * {@inheritDoc} + * @param string $table + * @param string|null $database + * + * @return string */ public function getListTableForeignKeysSQL($table, $database = null) { diff --git a/lib/Doctrine/DBAL/Platforms/OraclePlatform.php b/lib/Doctrine/DBAL/Platforms/OraclePlatform.php index 3fa40870140..a4bf28c9670 100644 --- a/lib/Doctrine/DBAL/Platforms/OraclePlatform.php +++ b/lib/Doctrine/DBAL/Platforms/OraclePlatform.php @@ -61,6 +61,7 @@ public function getSubstringExpression($value, $position, $length = null) } /** + * @param string $type * * @return string */ diff --git a/lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php b/lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php index a2bdf26219a..6237898e2e8 100644 --- a/lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php +++ b/lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php @@ -279,7 +279,10 @@ public function getListViewsSQL($database) } /** - * {@inheritDoc} + * @param string $table + * @param string|null $database + * + * @return string */ public function getListTableForeignKeysSQL($table, $database = null) { diff --git a/lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php b/lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php index a37f7c9394a..6a7130bd674 100644 --- a/lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php +++ b/lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php @@ -933,7 +933,10 @@ public function getListTableColumnsSQL($table, $database = null) } /** - * {@inheritDoc} + * @param string $table + * @param string|null $database + * + * @return string */ public function getListTableForeignKeysSQL($table, $database = null) { diff --git a/lib/Doctrine/DBAL/Platforms/SqlitePlatform.php b/lib/Doctrine/DBAL/Platforms/SqlitePlatform.php index d3a7d499faa..57cf47c1d52 100644 --- a/lib/Doctrine/DBAL/Platforms/SqlitePlatform.php +++ b/lib/Doctrine/DBAL/Platforms/SqlitePlatform.php @@ -55,7 +55,9 @@ public function getGuidExpression() } /** - * {@inheritDoc} + * @param string $type + * + * @return string */ public function getNowExpression($type = 'timestamp') { @@ -222,6 +224,7 @@ public function getBigIntTypeDeclarationSQL(array $field) } /** + * @param array $field * * @return string */ @@ -249,6 +252,7 @@ public function getSmallIntTypeDeclarationSQL(array $field) } /** + * @param array $field * * @return string */ @@ -602,7 +606,7 @@ public static function udfLocate($str, $substr, $offset = 0) /** * {@inheritDoc} */ - public function getForUpdateSql() + public function getForUpdateSQL() { return ''; } @@ -812,7 +816,10 @@ public function getCreateTableSQL(Table $table, $createFlags = null) } /** - * {@inheritDoc} + * @param string $table + * @param string|null $database + * + * @return string */ public function getListTableForeignKeysSQL($table, $database = null) { diff --git a/lib/Doctrine/DBAL/Schema/DB2SchemaManager.php b/lib/Doctrine/DBAL/Schema/DB2SchemaManager.php index 6b2d63b64bb..426fa665881 100644 --- a/lib/Doctrine/DBAL/Schema/DB2SchemaManager.php +++ b/lib/Doctrine/DBAL/Schema/DB2SchemaManager.php @@ -178,6 +178,7 @@ protected function _getPortableTableForeignKeysList($tableForeignKeys) } /** + * @param string $def * * @return string|null */ diff --git a/lib/Doctrine/DBAL/Schema/SqliteSchemaManager.php b/lib/Doctrine/DBAL/Schema/SqliteSchemaManager.php index 6af35e9c206..68e1e1f8487 100644 --- a/lib/Doctrine/DBAL/Schema/SqliteSchemaManager.php +++ b/lib/Doctrine/DBAL/Schema/SqliteSchemaManager.php @@ -225,6 +225,8 @@ protected function _getPortableTableIndexesList($tableIndexes, $tableName = null /** * @deprecated * + * @param array $tableIndex + * * @return array */ protected function _getPortableTableIndexDefinition($tableIndex) diff --git a/lib/Doctrine/DBAL/Types/ConversionException.php b/lib/Doctrine/DBAL/Types/ConversionException.php index 7ec6e75f52e..82c6df912b7 100644 --- a/lib/Doctrine/DBAL/Types/ConversionException.php +++ b/lib/Doctrine/DBAL/Types/ConversionException.php @@ -91,6 +91,10 @@ public static function conversionFailedInvalidType( } /** + * @param mixed $value + * @param string $format + * @param string $error + * * @return ConversionException */ public static function conversionFailedSerialization($value, $format, $error) From d267775e918b2edf8aa533b45032ad20d6b5bff2 Mon Sep 17 00:00:00 2001 From: Sergei Morozov Date: Sun, 29 Mar 2020 15:24:50 -0700 Subject: [PATCH 08/16] Do not ignore the result of array_change_key_case() --- lib/Doctrine/DBAL/Event/Listeners/OracleSessionInit.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/Doctrine/DBAL/Event/Listeners/OracleSessionInit.php b/lib/Doctrine/DBAL/Event/Listeners/OracleSessionInit.php index 19f2b3fd335..9e374856078 100644 --- a/lib/Doctrine/DBAL/Event/Listeners/OracleSessionInit.php +++ b/lib/Doctrine/DBAL/Event/Listeners/OracleSessionInit.php @@ -49,9 +49,8 @@ public function postConnect(ConnectionEventArgs $args) return; } - array_change_key_case($this->_defaultSessionVars, CASE_UPPER); $vars = []; - foreach ($this->_defaultSessionVars as $option => $value) { + foreach (array_change_key_case($this->_defaultSessionVars, CASE_UPPER) as $option => $value) { if ($option === 'CURRENT_SCHEMA') { $vars[] = $option . ' = ' . $value; } else { From e6bfcaddf815cf21e00b64270df6c934a3c6e3f3 Mon Sep 17 00:00:00 2001 From: Sergei Morozov Date: Sun, 29 Mar 2020 15:25:59 -0700 Subject: [PATCH 09/16] Assert that the value fetched from the database is always an integer --- lib/Doctrine/DBAL/Id/TableGenerator.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/Doctrine/DBAL/Id/TableGenerator.php b/lib/Doctrine/DBAL/Id/TableGenerator.php index cb34dcd5c4b..62ad0d35c48 100644 --- a/lib/Doctrine/DBAL/Id/TableGenerator.php +++ b/lib/Doctrine/DBAL/Id/TableGenerator.php @@ -10,6 +10,8 @@ use Throwable; use const CASE_LOWER; use function array_change_key_case; +use function assert; +use function is_int; /** * Table ID Generator for those poor languages that are missing sequences. @@ -111,6 +113,8 @@ public function nextValue($sequenceName) $value = $row['sequence_value']; $value++; + assert(is_int($value)); + if ($row['sequence_increment_by'] > 1) { $this->sequences[$sequenceName] = [ 'value' => $value, From e5068b42f12bf07e96f34fc9b8a921cb3db6c210 Mon Sep 17 00:00:00 2001 From: Sergei Morozov Date: Sun, 29 Mar 2020 15:26:21 -0700 Subject: [PATCH 10/16] Removed redundant break statements --- lib/Doctrine/DBAL/Platforms/SQLAnywherePlatform.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/lib/Doctrine/DBAL/Platforms/SQLAnywherePlatform.php b/lib/Doctrine/DBAL/Platforms/SQLAnywherePlatform.php index 6e3b2fcb958..6e99f093294 100644 --- a/lib/Doctrine/DBAL/Platforms/SQLAnywherePlatform.php +++ b/lib/Doctrine/DBAL/Platforms/SQLAnywherePlatform.php @@ -628,15 +628,12 @@ public function getForeignKeyMatchClauseSQL($type) case self::FOREIGN_KEY_MATCH_SIMPLE: return 'SIMPLE'; - break; case self::FOREIGN_KEY_MATCH_FULL: return 'FULL'; - break; case self::FOREIGN_KEY_MATCH_SIMPLE_UNIQUE: return 'UNIQUE SIMPLE'; - break; case self::FOREIGN_KEY_MATCH_FULL_UNIQUE: return 'UNIQUE FULL'; default: From 4650d9c3d4a2ed61ea48f65ae48ded04f23a2503 Mon Sep 17 00:00:00 2001 From: Sergei Morozov Date: Sun, 29 Mar 2020 15:26:52 -0700 Subject: [PATCH 11/16] AbstractPlatform::_getTransactionIsolationLevelSQL() must return a string --- lib/Doctrine/DBAL/Platforms/SQLAnywherePlatform.php | 8 ++++---- lib/Doctrine/DBAL/Platforms/SqlitePlatform.php | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/Doctrine/DBAL/Platforms/SQLAnywherePlatform.php b/lib/Doctrine/DBAL/Platforms/SQLAnywherePlatform.php index 6e99f093294..21850d2ba45 100644 --- a/lib/Doctrine/DBAL/Platforms/SQLAnywherePlatform.php +++ b/lib/Doctrine/DBAL/Platforms/SQLAnywherePlatform.php @@ -1293,13 +1293,13 @@ protected function _getTransactionIsolationLevelSQL($level) { switch ($level) { case TransactionIsolationLevel::READ_UNCOMMITTED: - return 0; + return '0'; case TransactionIsolationLevel::READ_COMMITTED: - return 1; + return '1'; case TransactionIsolationLevel::REPEATABLE_READ: - return 2; + return '2'; case TransactionIsolationLevel::SERIALIZABLE: - return 3; + return '3'; default: throw new InvalidArgumentException('Invalid isolation level:' . $level); } diff --git a/lib/Doctrine/DBAL/Platforms/SqlitePlatform.php b/lib/Doctrine/DBAL/Platforms/SqlitePlatform.php index 57cf47c1d52..b0e3713ab27 100644 --- a/lib/Doctrine/DBAL/Platforms/SqlitePlatform.php +++ b/lib/Doctrine/DBAL/Platforms/SqlitePlatform.php @@ -168,11 +168,11 @@ protected function _getTransactionIsolationLevelSQL($level) { switch ($level) { case TransactionIsolationLevel::READ_UNCOMMITTED: - return 0; + return '0'; case TransactionIsolationLevel::READ_COMMITTED: case TransactionIsolationLevel::REPEATABLE_READ: case TransactionIsolationLevel::SERIALIZABLE: - return 1; + return '1'; default: return parent::_getTransactionIsolationLevelSQL($level); } From c9ec61835188f4f5ba6976548ccb722c3b530b50 Mon Sep 17 00:00:00 2001 From: Sergei Morozov Date: Sun, 29 Mar 2020 15:28:09 -0700 Subject: [PATCH 12/16] Make sure that the options row was fetched successfully --- lib/Doctrine/DBAL/Schema/DB2SchemaManager.php | 5 ++++- lib/Doctrine/DBAL/Schema/OracleSchemaManager.php | 5 ++++- lib/Doctrine/DBAL/Schema/PostgreSqlSchemaManager.php | 4 +++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/lib/Doctrine/DBAL/Schema/DB2SchemaManager.php b/lib/Doctrine/DBAL/Schema/DB2SchemaManager.php index 426fa665881..ae2af864f97 100644 --- a/lib/Doctrine/DBAL/Schema/DB2SchemaManager.php +++ b/lib/Doctrine/DBAL/Schema/DB2SchemaManager.php @@ -222,7 +222,10 @@ public function listTableDetails($tableName) : Table $sql = $platform->getListTableCommentsSQL($tableName); $tableOptions = $this->_conn->fetchAssoc($sql); - $table->addOption('comment', $tableOptions['REMARKS']); + + if ($tableOptions !== false) { + $table->addOption('comment', $tableOptions['REMARKS']); + } return $table; } diff --git a/lib/Doctrine/DBAL/Schema/OracleSchemaManager.php b/lib/Doctrine/DBAL/Schema/OracleSchemaManager.php index afe610ddbc4..9718f932ef5 100644 --- a/lib/Doctrine/DBAL/Schema/OracleSchemaManager.php +++ b/lib/Doctrine/DBAL/Schema/OracleSchemaManager.php @@ -399,7 +399,10 @@ public function listTableDetails($tableName) : Table $sql = $platform->getListTableCommentsSQL($tableName); $tableOptions = $this->_conn->fetchAssoc($sql); - $table->addOption('comment', $tableOptions['COMMENTS']); + + if ($tableOptions !== false) { + $table->addOption('comment', $tableOptions['COMMENTS']); + } return $table; } diff --git a/lib/Doctrine/DBAL/Schema/PostgreSqlSchemaManager.php b/lib/Doctrine/DBAL/Schema/PostgreSqlSchemaManager.php index e9608e7c193..ffc7c87d453 100644 --- a/lib/Doctrine/DBAL/Schema/PostgreSqlSchemaManager.php +++ b/lib/Doctrine/DBAL/Schema/PostgreSqlSchemaManager.php @@ -500,7 +500,9 @@ public function listTableDetails($tableName) : Table $tableOptions = $this->_conn->fetchAssoc($sql); - $table->addOption('comment', $tableOptions['table_comment']); + if ($tableOptions !== false) { + $table->addOption('comment', $tableOptions['table_comment']); + } return $table; } From e247a10388d32df093340d717a0d4920feffb29c Mon Sep 17 00:00:00 2001 From: Sergei Morozov Date: Sun, 29 Mar 2020 15:30:40 -0700 Subject: [PATCH 13/16] ForeignKeyConstraint::onEvent() must return null as an empty action --- lib/Doctrine/DBAL/Schema/ForeignKeyConstraint.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Doctrine/DBAL/Schema/ForeignKeyConstraint.php b/lib/Doctrine/DBAL/Schema/ForeignKeyConstraint.php index 270f3dda312..3611b77dccd 100644 --- a/lib/Doctrine/DBAL/Schema/ForeignKeyConstraint.php +++ b/lib/Doctrine/DBAL/Schema/ForeignKeyConstraint.php @@ -365,7 +365,7 @@ private function onEvent($event) } } - return false; + return null; } /** From a56eeee8a96ed34c1effcbe5f2263aa471a54909 Mon Sep 17 00:00:00 2001 From: Sergei Morozov Date: Sun, 29 Mar 2020 15:32:33 -0700 Subject: [PATCH 14/16] Use strings to work with ini_get() and ini_set() Additionally, set the new value and get the old one in one ini_set() call. --- lib/Doctrine/DBAL/Tools/Dumper.php | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/lib/Doctrine/DBAL/Tools/Dumper.php b/lib/Doctrine/DBAL/Tools/Dumper.php index 3668efbe4d1..8cb8f4b8689 100644 --- a/lib/Doctrine/DBAL/Tools/Dumper.php +++ b/lib/Doctrine/DBAL/Tools/Dumper.php @@ -17,7 +17,6 @@ use function extension_loaded; use function get_class; use function html_entity_decode; -use function ini_get; use function ini_set; use function is_array; use function is_object; @@ -55,14 +54,11 @@ private function __construct() */ public static function dump($var, int $maxDepth = 2) : string { - $html = ini_get('html_errors'); - - if ($html !== true) { - ini_set('html_errors', true); - } + $html = ini_set('html_errors', '1'); + assert(is_string($html)); if (extension_loaded('xdebug')) { - ini_set('xdebug.var_display_max_depth', $maxDepth); + ini_set('xdebug.var_display_max_depth', (string) $maxDepth); } $var = self::export($var, $maxDepth); From 0d36ac828ba156dcb162784d46b1994b04f86e77 Mon Sep 17 00:00:00 2001 From: Sergei Morozov Date: Sun, 29 Mar 2020 11:35:13 -0700 Subject: [PATCH 15/16] Disabled some options and whitelisted false-positives --- phpstan.neon.dist | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/phpstan.neon.dist b/phpstan.neon.dist index f60bf2d4ff5..85bc4ce351c 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -5,6 +5,8 @@ parameters: autoload_files: - %currentWorkingDirectory%/tests/phpstan-polyfill.php reportUnmatchedIgnoredErrors: false + checkMissingIterableValueType: false + checkGenericClassInNonGenericObjectType: false ignoreErrors: # extension not available - '~^(Used )?(Function|Constant) sasql_\S+ not found\.\z~i' @@ -23,7 +25,6 @@ parameters: - '~^Property Doctrine\\DBAL\\Schema\\Schema::\$_schemaConfig \(Doctrine\\DBAL\\Schema\\SchemaConfig\) does not accept default value of type false\.\z~' - '~^Method Doctrine\\DBAL\\Schema\\ForeignKeyConstraint::onEvent\(\) should return string\|null but returns false\.\z~' - '~^Method Doctrine\\DBAL\\Schema\\(Oracle|PostgreSql|SQLServer)SchemaManager::_getPortableTableDefinition\(\) should return array but returns string\.\z~' - - '~^Method Doctrine\\DBAL\\Platforms\\(|SQLAnywhere|Sqlite)Platform::_getTransactionIsolationLevelSQL\(\) should return string but returns int\.\z~' - '~^Method Doctrine\\DBAL\\Driver\\OCI8\\OCI8Connection::lastInsertId\(\) should return string but returns (int|false)\.\z~' - '~^Method Doctrine\\DBAL\\Driver\\SQLSrv\\SQLSrvConnection::errorCode\(\) should return string\|null but returns false\.\z~' @@ -31,11 +32,11 @@ parameters: - '~^Call to an undefined method Doctrine\\DBAL\\Driver\\PDOConnection::sqliteCreateFunction\(\)\.\z~' # https://github.com/phpstan/phpstan/issues/1847 - - '~^Parameter #2 \$registeredAliases of static method Doctrine\\DBAL\\Query\\QueryException::unknownAlias\(\) expects array, array given\.\z~' - - '~^Parameter #2 \$registeredAliases of static method Doctrine\\DBAL\\Query\\QueryException::nonUniqueAlias\(\) expects array, array given\.\z~' + - '~^Parameter #2 \$registeredAliases of static method Doctrine\\DBAL\\Query\\QueryException::unknownAlias\(\) expects array, array given\.\z~' + - '~^Parameter #2 \$registeredAliases of static method Doctrine\\DBAL\\Query\\QueryException::nonUniqueAlias\(\) expects array, array given\.\z~' # PHPStan is too strict about preg_replace(): https://phpstan.org/r/993dc99f-0d43-4b51-868b-d01f982c1463 - - '~^Method Doctrine\\DBAL\\Platforms\\AbstractPlatform::escapeStringForLike\(\) should return string but returns string|null\.\z~' + - '~^Method Doctrine\\DBAL\\Platforms\\AbstractPlatform::escapeStringForLike\(\) should return string but returns string\|null\.\z~' # legacy variadic-like signature - '~^Method Doctrine\\DBAL(\\.*)?Connection::query\(\) invoked with \d+ parameters?, 0 required\.\z~' @@ -55,3 +56,19 @@ parameters: # weird class name, represented in stubs as OCI_(Lob|Collection) - '~unknown class OCI-(Lob|Collection)~' + + # https://github.com/JetBrains/phpstorm-stubs/pull/766 + - '~^Method Doctrine\\DBAL\\Driver\\Mysqli\\MysqliStatement::_fetch\(\) never returns null so it can be removed from the return typehint\.$~' + + # The ReflectionException in the case when the class does not exist is acceptable and does not need to be handled + - '~^Parameter #1 \$argument of class ReflectionClass constructor expects class-string\|T of object, string given\.$~' + + # https://github.com/phpstan/phpstan/issues/3132 + - + message: '~^Call to function in_array\(\) with arguments Doctrine\\DBAL\\Schema\\Column, array and true will always evaluate to false\.$~' + path: %currentWorkingDirectory%/lib/Doctrine/DBAL/Schema/Table.php + + # https://github.com/phpstan/phpstan/issues/3133 + - + message: '~^Cannot cast array\|bool\|string\|null to int\.$~' + path: %currentWorkingDirectory%/lib/Doctrine/DBAL/Tools/Console/Command/RunSqlCommand.php From 32aac3bf86f4e3d36df7b094053e699b37eb122d Mon Sep 17 00:00:00 2001 From: Sergei Morozov Date: Mon, 30 Mar 2020 15:18:48 -0700 Subject: [PATCH 16/16] Added missing parameter types to CompositeExpression::(and|or)() --- .../DBAL/Query/Expression/CompositeExpression.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/Doctrine/DBAL/Query/Expression/CompositeExpression.php b/lib/Doctrine/DBAL/Query/Expression/CompositeExpression.php index 0048d228ced..21e8d6bf2f5 100644 --- a/lib/Doctrine/DBAL/Query/Expression/CompositeExpression.php +++ b/lib/Doctrine/DBAL/Query/Expression/CompositeExpression.php @@ -49,11 +49,19 @@ public function __construct($type, array $parts = []) $this->addMultiple($parts); } + /** + * @param self|string $part + * @param self|string ...$parts + */ public static function and($part, ...$parts) : self { return new self(self::TYPE_AND, array_merge([$part], $parts)); } + /** + * @param self|string $part + * @param self|string ...$parts + */ public static function or($part, ...$parts) : self { return new self(self::TYPE_OR, array_merge([$part], $parts));