From e2ea88378690231266897f76a953498e14e86a6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Paris?= Date: Tue, 17 Apr 2018 23:39:52 +0200 Subject: [PATCH 1/2] Adapt to new signatures This should fix the build with the latest ORM version --- tests/Doctrine/Tests/Mocks/ConnectionMock.php | 7 +++++-- .../Doctrine/Tests/Mocks/DriverConnectionMock.php | 8 +++++--- .../Doctrine/Tests/Mocks/HydratorMockStatement.php | 2 +- tests/Doctrine/Tests/Mocks/StatementArrayMock.php | 2 +- tests/Doctrine/Tests/Mocks/StatementMock.php | 2 +- .../Tests/ORM/Functional/Ticket/DDC3634Test.php | 14 ++++++++------ 6 files changed, 21 insertions(+), 14 deletions(-) diff --git a/tests/Doctrine/Tests/Mocks/ConnectionMock.php b/tests/Doctrine/Tests/Mocks/ConnectionMock.php index 3cb302b6e7d..42111e09911 100644 --- a/tests/Doctrine/Tests/Mocks/ConnectionMock.php +++ b/tests/Doctrine/Tests/Mocks/ConnectionMock.php @@ -8,6 +8,7 @@ use Doctrine\DBAL\Configuration; use Doctrine\DBAL\Connection; use Doctrine\DBAL\Driver; +use Doctrine\DBAL\Driver\ResultStatement; use Doctrine\DBAL\Driver\Statement; use Doctrine\DBAL\Platforms\AbstractPlatform; use function is_string; @@ -73,9 +74,11 @@ public function insert($tableName, array $data, array $types = []) /** * {@inheritdoc} */ - public function executeUpdate($query, array $params = [], array $types = []) + public function executeUpdate(string $query, array $params = [], array $types = []) : int { $this->executeUpdates[] = ['query' => $query, 'params' => $params, 'types' => $types]; + + return 42; } /** @@ -101,7 +104,7 @@ public function fetchColumn($statement, array $params = [], $colnum = 0, array $ /** * {@inheritdoc} */ - public function query() : Statement + public function query(string $sql) : ResultStatement { return $this->queryResult; } diff --git a/tests/Doctrine/Tests/Mocks/DriverConnectionMock.php b/tests/Doctrine/Tests/Mocks/DriverConnectionMock.php index 3c5ecbb4c60..7e94d54b772 100644 --- a/tests/Doctrine/Tests/Mocks/DriverConnectionMock.php +++ b/tests/Doctrine/Tests/Mocks/DriverConnectionMock.php @@ -5,6 +5,8 @@ namespace Doctrine\Tests\Mocks; use Doctrine\DBAL\Driver\Connection; +use Doctrine\DBAL\Driver\ResultStatement; +use Doctrine\DBAL\Driver\Statement; use Doctrine\DBAL\ParameterType; /** @@ -34,7 +36,7 @@ public function setStatementMock($statementMock) /** * {@inheritdoc} */ - public function prepare($prepareString) + public function prepare(string $prepareString) : Statement { return $this->statementMock ?: new StatementMock(); } @@ -42,7 +44,7 @@ public function prepare($prepareString) /** * {@inheritdoc} */ - public function query() + public function query(string $sql) : ResultStatement { return $this->statementMock ?: new StatementMock(); } @@ -57,7 +59,7 @@ public function quote($input, $type = ParameterType::STRING) /** * {@inheritdoc} */ - public function exec($statement) + public function exec(string $statement) : int { } diff --git a/tests/Doctrine/Tests/Mocks/HydratorMockStatement.php b/tests/Doctrine/Tests/Mocks/HydratorMockStatement.php index d474df8f5d6..6b2e25adf9a 100644 --- a/tests/Doctrine/Tests/Mocks/HydratorMockStatement.php +++ b/tests/Doctrine/Tests/Mocks/HydratorMockStatement.php @@ -113,7 +113,7 @@ public function execute($params = null) /** * {@inheritdoc} */ - public function rowCount() + public function rowCount() : int { } diff --git a/tests/Doctrine/Tests/Mocks/StatementArrayMock.php b/tests/Doctrine/Tests/Mocks/StatementArrayMock.php index 519b9b570c3..ea8023762c9 100644 --- a/tests/Doctrine/Tests/Mocks/StatementArrayMock.php +++ b/tests/Doctrine/Tests/Mocks/StatementArrayMock.php @@ -62,7 +62,7 @@ public function fetchColumn($columnIndex = 0) return false; } - public function rowCount() + public function rowCount() : int { return count($this->result); } diff --git a/tests/Doctrine/Tests/Mocks/StatementMock.php b/tests/Doctrine/Tests/Mocks/StatementMock.php index a7c918918d7..13128b16452 100644 --- a/tests/Doctrine/Tests/Mocks/StatementMock.php +++ b/tests/Doctrine/Tests/Mocks/StatementMock.php @@ -49,7 +49,7 @@ public function execute($params = null) /** * {@inheritdoc} */ - public function rowCount() + public function rowCount() : int { } diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3634Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3634Test.php index 4b9b3a32dc6..83bbe0e2403 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3634Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3634Test.php @@ -6,6 +6,8 @@ use Doctrine\DBAL\Cache\QueryCacheProfile; use Doctrine\DBAL\Connection; +use Doctrine\DBAL\Driver\ResultStatement; +use Doctrine\DBAL\Driver\Statement; use Doctrine\ORM\Annotation as ORM; use Doctrine\ORM\EntityManager; use Doctrine\ORM\Tools\ToolsException; @@ -273,17 +275,17 @@ public function fetchAll($sql, array $params = [], $types = []) return $this->forwardCall(); } - public function prepare($statement) + public function prepare(string $statement) : Statement { return $this->forwardCall(); } - public function executeQuery($query, array $params = [], $types = [], ?QueryCacheProfile $qcp = null) + public function executeQuery(string $query, array $params = [], $types = [], ?QueryCacheProfile $qcp = null) : ResultStatement { return $this->forwardCall(); } - public function executeCacheQuery($query, $params, $types, QueryCacheProfile $qcp) + public function executeCacheQuery($query, $params, $types, QueryCacheProfile $qcp) : ResultStatement { return $this->forwardCall(); } @@ -293,17 +295,17 @@ public function project($query, array $params, \Closure $function) return $this->forwardCall(); } - public function query() + public function query(string $sql) : ResultStatement { return $this->forwardCall(); } - public function executeUpdate($query, array $params = [], array $types = []) + public function executeUpdate(string $query, array $params = [], array $types = []) : int { return $this->forwardCall(); } - public function exec($statement) + public function exec(string $statement) : int { return $this->forwardCall(); } From b881f14b4d107a02fc95817157c49e37717125a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Paris?= Date: Tue, 17 Apr 2018 23:40:22 +0200 Subject: [PATCH 2/2] Lock DBAL to a specific branch From now on, a new branch will be created on each BC-break --- composer.json | 2 +- composer.lock | 66 +++++++++++++++++++++++++-------------------------- 2 files changed, 34 insertions(+), 34 deletions(-) diff --git a/composer.json b/composer.json index 3956811e2d1..e201661bea5 100644 --- a/composer.json +++ b/composer.json @@ -21,7 +21,7 @@ "doctrine/cache": "~1.6", "doctrine/collections": "^1.4", "doctrine/common": "^2.7.1", - "doctrine/dbal": "dev-develop as 3.x-dev", + "doctrine/dbal": "dev-snapshot/develop/2018-04-17 as 3.x-dev", "doctrine/instantiator": "~1.1", "ocramius/package-versions": "^1.1.2", "ocramius/proxy-manager": "^2.1.1", diff --git a/composer.lock b/composer.lock index 830970e6d37..7889884044d 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "a0d3dcf76d32cf2eed692a8072ebc8fd", + "content-hash": "d2778a4746370834a28a5bd464fa88e2", "packages": [ { "name": "doctrine/annotations", @@ -290,16 +290,16 @@ }, { "name": "doctrine/dbal", - "version": "dev-develop", + "version": "dev-snapshot/develop/2018-04-17", "source": { "type": "git", "url": "https://github.com/doctrine/dbal.git", - "reference": "3c0bad37f41182de2b49ce5c4f8935ae7d808c81" + "reference": "fe6bd764d80b85c86f2995a259bc35dc53fb557c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/dbal/zipball/3c0bad37f41182de2b49ce5c4f8935ae7d808c81", - "reference": "3c0bad37f41182de2b49ce5c4f8935ae7d808c81", + "url": "https://api.github.com/repos/doctrine/dbal/zipball/fe6bd764d80b85c86f2995a259bc35dc53fb557c", + "reference": "fe6bd764d80b85c86f2995a259bc35dc53fb557c", "shasum": "" }, "require": { @@ -308,7 +308,7 @@ "php": "^7.2" }, "require-dev": { - "doctrine/coding-standard": "^3.0", + "doctrine/coding-standard": "^4.0", "phpunit/phpunit": "^7.0", "phpunit/phpunit-mock-objects": "!=3.2.4,!=3.2.5", "symfony/console": "^2.0.5||^3.0", @@ -361,7 +361,7 @@ "persistence", "queryobject" ], - "time": "2018-03-08T00:07:32+00:00" + "time": "2018-04-13T22:50:06+00:00" }, { "name": "doctrine/inflector", @@ -659,16 +659,16 @@ }, { "name": "symfony/console", - "version": "v4.0.6", + "version": "v4.0.8", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "555c8dbe0ae9e561740451eabdbed2cc554b6a51" + "reference": "aad9a6fe47319f22748fd764f52d3a7ca6fa6b64" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/555c8dbe0ae9e561740451eabdbed2cc554b6a51", - "reference": "555c8dbe0ae9e561740451eabdbed2cc554b6a51", + "url": "https://api.github.com/repos/symfony/console/zipball/aad9a6fe47319f22748fd764f52d3a7ca6fa6b64", + "reference": "aad9a6fe47319f22748fd764f52d3a7ca6fa6b64", "shasum": "" }, "require": { @@ -723,7 +723,7 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2018-02-26T15:55:47+00:00" + "time": "2018-04-03T05:24:00+00:00" }, { "name": "symfony/polyfill-mbstring", @@ -1420,16 +1420,16 @@ }, { "name": "phpunit/php-code-coverage", - "version": "6.0.1", + "version": "6.0.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "f8ca4b604baf23dab89d87773c28cc07405189ba" + "reference": "774a82c0c5da4c1c7701790c262035d235ab7856" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/f8ca4b604baf23dab89d87773c28cc07405189ba", - "reference": "f8ca4b604baf23dab89d87773c28cc07405189ba", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/774a82c0c5da4c1c7701790c262035d235ab7856", + "reference": "774a82c0c5da4c1c7701790c262035d235ab7856", "shasum": "" }, "require": { @@ -1440,7 +1440,7 @@ "phpunit/php-text-template": "^1.2.1", "phpunit/php-token-stream": "^3.0", "sebastian/code-unit-reverse-lookup": "^1.0.1", - "sebastian/environment": "^3.0", + "sebastian/environment": "^3.1", "sebastian/version": "^2.0.1", "theseer/tokenizer": "^1.1" }, @@ -1479,7 +1479,7 @@ "testing", "xunit" ], - "time": "2018-02-02T07:01:41+00:00" + "time": "2018-04-06T15:39:20+00:00" }, { "name": "phpunit/php-file-iterator", @@ -1669,16 +1669,16 @@ }, { "name": "phpunit/phpunit", - "version": "7.0.2", + "version": "7.1.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "e2f8aa21bc54b6ba218bdd4f9e0dac1e9bc3b4e9" + "reference": "a7834993ddbf4b0ed2c3b2dc1f3b1d093ef910a9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/e2f8aa21bc54b6ba218bdd4f9e0dac1e9bc3b4e9", - "reference": "e2f8aa21bc54b6ba218bdd4f9e0dac1e9bc3b4e9", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/a7834993ddbf4b0ed2c3b2dc1f3b1d093ef910a9", + "reference": "a7834993ddbf4b0ed2c3b2dc1f3b1d093ef910a9", "shasum": "" }, "require": { @@ -1692,11 +1692,11 @@ "phar-io/version": "^1.0", "php": "^7.1", "phpspec/prophecy": "^1.7", - "phpunit/php-code-coverage": "^6.0", + "phpunit/php-code-coverage": "^6.0.1", "phpunit/php-file-iterator": "^1.4.3", "phpunit/php-text-template": "^1.2.1", "phpunit/php-timer": "^2.0", - "phpunit/phpunit-mock-objects": "^6.0", + "phpunit/phpunit-mock-objects": "^6.1.1", "sebastian/comparator": "^2.1", "sebastian/diff": "^3.0", "sebastian/environment": "^3.1", @@ -1719,7 +1719,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "7.0-dev" + "dev-master": "7.1-dev" } }, "autoload": { @@ -1745,20 +1745,20 @@ "testing", "xunit" ], - "time": "2018-02-26T07:03:12+00:00" + "time": "2018-04-13T02:28:50+00:00" }, { "name": "phpunit/phpunit-mock-objects", - "version": "6.0.1", + "version": "6.1.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "e3249dedc2d99259ccae6affbc2684eac37c2e53" + "reference": "70c740bde8fd9ea9ea295be1cd875dd7b267e157" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/e3249dedc2d99259ccae6affbc2684eac37c2e53", - "reference": "e3249dedc2d99259ccae6affbc2684eac37c2e53", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/70c740bde8fd9ea9ea295be1cd875dd7b267e157", + "reference": "70c740bde8fd9ea9ea295be1cd875dd7b267e157", "shasum": "" }, "require": { @@ -1776,7 +1776,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "6.0.x-dev" + "dev-master": "6.1-dev" } }, "autoload": { @@ -1801,7 +1801,7 @@ "mock", "xunit" ], - "time": "2018-02-15T05:27:38+00:00" + "time": "2018-04-11T04:50:36+00:00" }, { "name": "sebastian/code-unit-reverse-lookup", @@ -2552,7 +2552,7 @@ { "alias": "3.x-dev", "alias_normalized": "3.9999999.9999999.9999999-dev", - "version": "dev-develop", + "version": "dev-snapshot/develop/2018-04-17", "package": "doctrine/dbal" } ],