From 76f03b5db0973921fef7969ad1a62f3d1321d0dd Mon Sep 17 00:00:00 2001 From: Michael Moravec Date: Sun, 17 Dec 2017 05:48:11 +0100 Subject: [PATCH 001/136] Bump version to 2.7-dev --- composer.json | 2 +- lib/Doctrine/ORM/Version.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index abe42e4dba..1f5548e74a 100644 --- a/composer.json +++ b/composer.json @@ -46,7 +46,7 @@ "bin": ["bin/doctrine"], "extra": { "branch-alias": { - "dev-master": "2.6.x-dev" + "dev-master": "2.7.x-dev" } }, "archive": { diff --git a/lib/Doctrine/ORM/Version.php b/lib/Doctrine/ORM/Version.php index 5329799997..b289a2aa8a 100644 --- a/lib/Doctrine/ORM/Version.php +++ b/lib/Doctrine/ORM/Version.php @@ -35,7 +35,7 @@ class Version /** * Current Doctrine Version */ - const VERSION = '2.6.5-DEV'; + const VERSION = '2.7.0-DEV'; /** * Compares a Doctrine version with the current one. From 2fed8204c1bce5b8365598ddcf7286d2852bc83c Mon Sep 17 00:00:00 2001 From: Claudio Zizza Date: Mon, 30 Oct 2017 21:53:15 +0100 Subject: [PATCH 002/136] Set copy-method as deprecated --- lib/Doctrine/ORM/EntityManager.php | 3 --- lib/Doctrine/ORM/EntityManagerInterface.php | 2 ++ 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/Doctrine/ORM/EntityManager.php b/lib/Doctrine/ORM/EntityManager.php index c353514871..c5204f3fb5 100644 --- a/lib/Doctrine/ORM/EntityManager.php +++ b/lib/Doctrine/ORM/EntityManager.php @@ -684,9 +684,6 @@ public function merge($entity) /** * {@inheritDoc} - * - * @todo Implementation need. This is necessary since $e2 = clone $e1; throws an E_FATAL when access anything on $e: - * Fatal error: Maximum function nesting level of '100' reached, aborting! */ public function copy($entity, $deep = false) { diff --git a/lib/Doctrine/ORM/EntityManagerInterface.php b/lib/Doctrine/ORM/EntityManagerInterface.php index a423432a16..8bbc56798b 100644 --- a/lib/Doctrine/ORM/EntityManagerInterface.php +++ b/lib/Doctrine/ORM/EntityManagerInterface.php @@ -190,6 +190,8 @@ public function close(); /** * Creates a copy of the given entity. Can create a shallow or a deep copy. * + * @deprecated method will be removed in 3.0 + * * @param object $entity The entity to copy. * @param boolean $deep FALSE for a shallow copy, TRUE for a deep copy. * From fdbbf7edd170c9f1608d824f47808d9875be9204 Mon Sep 17 00:00:00 2001 From: Claudio Zizza Date: Thu, 9 Nov 2017 21:37:04 +0100 Subject: [PATCH 003/136] Add deprecation of EntityManagerInterface::copy() to upgrade information --- UPGRADE.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/UPGRADE.md b/UPGRADE.md index 3567b998d4..dda7412833 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -37,6 +37,11 @@ As a consequence, automatic cache setup in Doctrine\ORM\Tools\Setup::create*Conf - Memcached extension (ext-memcached) will be used instead of obsolete Memcache (ext-memcache). - XCache support was dropped as it doesn't work with PHP 7. +## Deprecated: `Doctrine\ORM\EntityManagerInterface#copy()` + +Method `Doctrine\ORM\EntityManagerInterface#copy()` never got its implementation and is deprecated. +It will be removed in 3.0. + # Upgrade to 2.5 ## Minor BC BREAK: removed `Doctrine\ORM\Query\SqlWalker#walkCaseExpression()` From 46c1b5756062d2863e519d72687e812bcdf3ab64 Mon Sep 17 00:00:00 2001 From: Michael Moravec Date: Fri, 31 Aug 2018 23:39:56 +0200 Subject: [PATCH 004/136] Update homepage --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 1f5548e74a..94d64041a4 100644 --- a/composer.json +++ b/composer.json @@ -3,7 +3,7 @@ "type": "library", "description": "Object-Relational-Mapper for PHP", "keywords": ["orm", "database"], - "homepage": "http://www.doctrine-project.org", + "homepage": "https://www.doctrine-project.org/projects/orm.html", "license": "MIT", "authors": [ {"name": "Guilherme Blanco", "email": "guilhermeblanco@gmail.com"}, From 4fb1ebfc1057e1a3d0b86e5738e68aa6ecf9e1c5 Mon Sep 17 00:00:00 2001 From: Claudio Zizza Date: Thu, 4 Jan 2018 21:19:54 +0100 Subject: [PATCH 005/136] Create 2.7 upgrade headline for deprecation changes --- UPGRADE.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/UPGRADE.md b/UPGRADE.md index dda7412833..18b74ce937 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -1,3 +1,10 @@ +# Upgrade to 2.7 + +## Deprecated: `Doctrine\ORM\EntityManagerInterface#copy()` + +Method `Doctrine\ORM\EntityManagerInterface#copy()` never got its implementation and is deprecated. +It will be removed in 3.0. + # Upgrade to 2.6 ## Added `Doctrine\ORM\EntityRepository::count()` method @@ -37,11 +44,6 @@ As a consequence, automatic cache setup in Doctrine\ORM\Tools\Setup::create*Conf - Memcached extension (ext-memcached) will be used instead of obsolete Memcache (ext-memcache). - XCache support was dropped as it doesn't work with PHP 7. -## Deprecated: `Doctrine\ORM\EntityManagerInterface#copy()` - -Method `Doctrine\ORM\EntityManagerInterface#copy()` never got its implementation and is deprecated. -It will be removed in 3.0. - # Upgrade to 2.5 ## Minor BC BREAK: removed `Doctrine\ORM\Query\SqlWalker#walkCaseExpression()` From cdb652ad87a7f2a7b8f447946c90012956935369 Mon Sep 17 00:00:00 2001 From: Michael Moravec Date: Sat, 9 Feb 2019 19:15:11 +0100 Subject: [PATCH 006/136] CI: Test against PHP 7.4snapshot instead of nightly (8.0) --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 1d3d3fde32..bd6037e90c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -55,7 +55,7 @@ jobs: - stage: Test dist: xenial env: DB=mysql MYSQL_VERSION=5.7 - php: nightly + php: 7.4snapshot services: - mysql before_script: @@ -102,7 +102,7 @@ jobs: - stage: Code Quality if: NOT type = pull_request env: DB=none CODING_STANDARDS - php: 7.1 + php: 7.4snapshot install: travis_retry composer install --prefer-dist script: - ./vendor/bin/phpcs From 90c1ee0bd0801bce10b5356555df4a468b90d4b9 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Tue, 28 May 2019 16:44:44 +0200 Subject: [PATCH 007/136] Allow Symfony 5.0 --- composer.json | 4 +- composer.lock | 158 +++++++++++++++++++++++++------------------------- 2 files changed, 80 insertions(+), 82 deletions(-) diff --git a/composer.json b/composer.json index 94d64041a4..ee32d79b2f 100644 --- a/composer.json +++ b/composer.json @@ -24,12 +24,12 @@ "doctrine/common": "^2.7.1", "doctrine/dbal": "^2.6", "doctrine/instantiator": "~1.1", - "symfony/console": "~3.0|~4.0" + "symfony/console": "^3.0|^4.0|^5.0" }, "require-dev": { "doctrine/coding-standard": "^5.0", "phpunit/phpunit": "^7.5", - "symfony/yaml": "~3.4|~4.0" + "symfony/yaml": "^3.4|^4.0|^5.0" }, "suggest": { "symfony/yaml": "If you want to use YAML Metadata Mapping Driver" diff --git a/composer.lock b/composer.lock index 23b60faad5..be48f0e64a 100644 --- a/composer.lock +++ b/composer.lock @@ -4,20 +4,20 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "d5d0e87e612dc300640150a1d8a8a8a7", + "content-hash": "c3d70a08d75cd3995dd4c72864f3c880", "packages": [ { "name": "doctrine/annotations", - "version": "v1.7.0", + "version": "v1.8.0", "source": { "type": "git", "url": "https://github.com/doctrine/annotations.git", - "reference": "fa4c4e861e809d6a1103bd620cce63ed91aedfeb" + "reference": "904dca4eb10715b92569fbcd79e201d5c349b6bc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/annotations/zipball/fa4c4e861e809d6a1103bd620cce63ed91aedfeb", - "reference": "fa4c4e861e809d6a1103bd620cce63ed91aedfeb", + "url": "https://api.github.com/repos/doctrine/annotations/zipball/904dca4eb10715b92569fbcd79e201d5c349b6bc", + "reference": "904dca4eb10715b92569fbcd79e201d5c349b6bc", "shasum": "" }, "require": { @@ -26,7 +26,7 @@ }, "require-dev": { "doctrine/cache": "1.*", - "phpunit/phpunit": "^7.5@dev" + "phpunit/phpunit": "^7.5" }, "type": "library", "extra": { @@ -72,7 +72,7 @@ "docblock", "parser" ], - "time": "2019-08-08T18:11:40+00:00" + "time": "2019-10-01T18:55:10+00:00" }, { "name": "doctrine/cache", @@ -849,16 +849,16 @@ }, { "name": "symfony/console", - "version": "v4.3.4", + "version": "v4.3.5", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "de63799239b3881b8a08f8481b22348f77ed7b36" + "reference": "929ddf360d401b958f611d44e726094ab46a7369" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/de63799239b3881b8a08f8481b22348f77ed7b36", - "reference": "de63799239b3881b8a08f8481b22348f77ed7b36", + "url": "https://api.github.com/repos/symfony/console/zipball/929ddf360d401b958f611d44e726094ab46a7369", + "reference": "929ddf360d401b958f611d44e726094ab46a7369", "shasum": "" }, "require": { @@ -920,7 +920,7 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2019-08-26T08:26:39+00:00" + "time": "2019-10-07T12:36:49+00:00" }, { "name": "symfony/polyfill-mbstring", @@ -1041,16 +1041,16 @@ }, { "name": "symfony/service-contracts", - "version": "v1.1.6", + "version": "v1.1.7", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "ea7263d6b6d5f798b56a45a5b8d686725f2719a3" + "reference": "ffcde9615dc5bb4825b9f6aed07716f1f57faae0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/ea7263d6b6d5f798b56a45a5b8d686725f2719a3", - "reference": "ea7263d6b6d5f798b56a45a5b8d686725f2719a3", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/ffcde9615dc5bb4825b9f6aed07716f1f57faae0", + "reference": "ffcde9615dc5bb4825b9f6aed07716f1f57faae0", "shasum": "" }, "require": { @@ -1095,7 +1095,7 @@ "interoperability", "standards" ], - "time": "2019-08-20T14:44:19+00:00" + "time": "2019-09-17T11:12:18+00:00" } ], "packages-dev": [ @@ -1378,35 +1378,33 @@ }, { "name": "phpdocumentor/reflection-common", - "version": "1.0.1", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionCommon.git", - "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6" + "reference": "63a995caa1ca9e5590304cd845c15ad6d482a62a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", - "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/63a995caa1ca9e5590304cd845c15ad6d482a62a", + "reference": "63a995caa1ca9e5590304cd845c15ad6d482a62a", "shasum": "" }, "require": { - "php": ">=5.5" + "php": ">=7.1" }, "require-dev": { - "phpunit/phpunit": "^4.6" + "phpunit/phpunit": "~6" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "2.x-dev" } }, "autoload": { "psr-4": { - "phpDocumentor\\Reflection\\": [ - "src" - ] + "phpDocumentor\\Reflection\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -1428,30 +1426,30 @@ "reflection", "static analysis" ], - "time": "2017-09-11T18:02:19+00:00" + "time": "2018-08-07T13:53:10+00:00" }, { "name": "phpdocumentor/reflection-docblock", - "version": "4.3.1", + "version": "4.3.2", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "bdd9f737ebc2a01c06ea7ff4308ec6697db9b53c" + "reference": "b83ff7cfcfee7827e1e78b637a5904fe6a96698e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/bdd9f737ebc2a01c06ea7ff4308ec6697db9b53c", - "reference": "bdd9f737ebc2a01c06ea7ff4308ec6697db9b53c", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/b83ff7cfcfee7827e1e78b637a5904fe6a96698e", + "reference": "b83ff7cfcfee7827e1e78b637a5904fe6a96698e", "shasum": "" }, "require": { "php": "^7.0", - "phpdocumentor/reflection-common": "^1.0.0", - "phpdocumentor/type-resolver": "^0.4.0", + "phpdocumentor/reflection-common": "^1.0.0 || ^2.0.0", + "phpdocumentor/type-resolver": "~0.4 || ^1.0.0", "webmozart/assert": "^1.0" }, "require-dev": { - "doctrine/instantiator": "~1.0.5", + "doctrine/instantiator": "^1.0.5", "mockery/mockery": "^1.0", "phpunit/phpunit": "^6.4" }, @@ -1479,41 +1477,40 @@ } ], "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "time": "2019-04-30T17:48:53+00:00" + "time": "2019-09-12T14:27:41+00:00" }, { "name": "phpdocumentor/type-resolver", - "version": "0.4.0", + "version": "1.0.1", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7" + "reference": "2e32a6d48972b2c1976ed5d8967145b6cec4a4a9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/9c977708995954784726e25d0cd1dddf4e65b0f7", - "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/2e32a6d48972b2c1976ed5d8967145b6cec4a4a9", + "reference": "2e32a6d48972b2c1976ed5d8967145b6cec4a4a9", "shasum": "" }, "require": { - "php": "^5.5 || ^7.0", - "phpdocumentor/reflection-common": "^1.0" + "php": "^7.1", + "phpdocumentor/reflection-common": "^2.0" }, "require-dev": { - "mockery/mockery": "^0.9.4", - "phpunit/phpunit": "^5.2||^4.8.24" + "ext-tokenizer": "^7.1", + "mockery/mockery": "~1", + "phpunit/phpunit": "^7.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.x-dev" } }, "autoload": { "psr-4": { - "phpDocumentor\\Reflection\\": [ - "src/" - ] + "phpDocumentor\\Reflection\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -1526,26 +1523,27 @@ "email": "me@mikevanriel.com" } ], - "time": "2017-07-14T14:27:02+00:00" + "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", + "time": "2019-08-22T18:11:29+00:00" }, { "name": "phpspec/prophecy", - "version": "1.8.1", + "version": "1.9.0", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "1927e75f4ed19131ec9bcc3b002e07fb1173ee76" + "reference": "f6811d96d97bdf400077a0cc100ae56aa32b9203" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/1927e75f4ed19131ec9bcc3b002e07fb1173ee76", - "reference": "1927e75f4ed19131ec9bcc3b002e07fb1173ee76", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/f6811d96d97bdf400077a0cc100ae56aa32b9203", + "reference": "f6811d96d97bdf400077a0cc100ae56aa32b9203", "shasum": "" }, "require": { "doctrine/instantiator": "^1.0.2", "php": "^5.3|^7.0", - "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0", + "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0|^5.0", "sebastian/comparator": "^1.1|^2.0|^3.0", "sebastian/recursion-context": "^1.0|^2.0|^3.0" }, @@ -1589,7 +1587,7 @@ "spy", "stub" ], - "time": "2019-06-13T12:50:23+00:00" + "time": "2019-10-03T11:07:50+00:00" }, { "name": "phpunit/php-code-coverage", @@ -1796,16 +1794,16 @@ }, { "name": "phpunit/php-token-stream", - "version": "3.1.0", + "version": "3.1.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "e899757bb3df5ff6e95089132f32cd59aac2220a" + "reference": "995192df77f63a59e47f025390d2d1fdf8f425ff" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/e899757bb3df5ff6e95089132f32cd59aac2220a", - "reference": "e899757bb3df5ff6e95089132f32cd59aac2220a", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/995192df77f63a59e47f025390d2d1fdf8f425ff", + "reference": "995192df77f63a59e47f025390d2d1fdf8f425ff", "shasum": "" }, "require": { @@ -1841,20 +1839,20 @@ "keywords": [ "tokenizer" ], - "time": "2019-07-25T05:29:42+00:00" + "time": "2019-09-17T06:23:10+00:00" }, { "name": "phpunit/phpunit", - "version": "7.5.15", + "version": "7.5.16", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "d79c053d972856b8b941bb233e39dc521a5093f0" + "reference": "316afa6888d2562e04aeb67ea7f2017a0eb41661" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/d79c053d972856b8b941bb233e39dc521a5093f0", - "reference": "d79c053d972856b8b941bb233e39dc521a5093f0", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/316afa6888d2562e04aeb67ea7f2017a0eb41661", + "reference": "316afa6888d2562e04aeb67ea7f2017a0eb41661", "shasum": "" }, "require": { @@ -1925,7 +1923,7 @@ "testing", "xunit" ], - "time": "2019-08-21T07:05:16+00:00" + "time": "2019-09-14T09:08:39+00:00" }, { "name": "sebastian/code-unit-reverse-lookup", @@ -2147,16 +2145,16 @@ }, { "name": "sebastian/exporter", - "version": "3.1.1", + "version": "3.1.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "06a9a5947f47b3029d76118eb5c22802e5869687" + "reference": "68609e1261d215ea5b21b7987539cbfbe156ec3e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/06a9a5947f47b3029d76118eb5c22802e5869687", - "reference": "06a9a5947f47b3029d76118eb5c22802e5869687", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/68609e1261d215ea5b21b7987539cbfbe156ec3e", + "reference": "68609e1261d215ea5b21b7987539cbfbe156ec3e", "shasum": "" }, "require": { @@ -2210,7 +2208,7 @@ "export", "exporter" ], - "time": "2019-08-11T12:43:14+00:00" + "time": "2019-09-14T09:02:43+00:00" }, { "name": "sebastian/global-state", @@ -2534,16 +2532,16 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "3.4.2", + "version": "3.5.1", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "b8a7362af1cc1aadb5bd36c3defc4dda2cf5f0a8" + "reference": "82cd0f854ceca17731d6d019c7098e3755c45060" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/b8a7362af1cc1aadb5bd36c3defc4dda2cf5f0a8", - "reference": "b8a7362af1cc1aadb5bd36c3defc4dda2cf5f0a8", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/82cd0f854ceca17731d6d019c7098e3755c45060", + "reference": "82cd0f854ceca17731d6d019c7098e3755c45060", "shasum": "" }, "require": { @@ -2581,7 +2579,7 @@ "phpcs", "standards" ], - "time": "2019-04-10T23:49:02+00:00" + "time": "2019-10-16T21:14:26+00:00" }, { "name": "symfony/polyfill-ctype", @@ -2643,16 +2641,16 @@ }, { "name": "symfony/yaml", - "version": "v4.3.4", + "version": "v4.3.5", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "5a0b7c32dc3ec56fd4abae8a4a71b0cf05013686" + "reference": "41e16350a2a1c7383c4735aa2f9fce74cf3d1178" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/5a0b7c32dc3ec56fd4abae8a4a71b0cf05013686", - "reference": "5a0b7c32dc3ec56fd4abae8a4a71b0cf05013686", + "url": "https://api.github.com/repos/symfony/yaml/zipball/41e16350a2a1c7383c4735aa2f9fce74cf3d1178", + "reference": "41e16350a2a1c7383c4735aa2f9fce74cf3d1178", "shasum": "" }, "require": { @@ -2698,7 +2696,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2019-08-20T14:27:59+00:00" + "time": "2019-09-11T15:41:19+00:00" }, { "name": "theseer/tokenizer", From 4d6b1f3e637bb0a69552eb1799a4231d52855088 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Wed, 23 Oct 2019 13:37:16 +0200 Subject: [PATCH 008/136] Fix compat of commands with Symfony 5 --- .../Command/ClearCache/CollectionRegionCommand.php | 8 +++++--- .../Console/Command/ClearCache/EntityRegionCommand.php | 8 +++++--- .../Console/Command/ClearCache/QueryRegionCommand.php | 6 ++++-- .../Console/Command/ConvertDoctrine1SchemaCommand.php | 2 ++ .../ORM/Tools/Console/Command/ConvertMappingCommand.php | 2 ++ .../ORM/Tools/Console/Command/GenerateEntitiesCommand.php | 4 +++- .../ORM/Tools/Console/Command/GenerateProxiesCommand.php | 4 +++- .../Tools/Console/Command/GenerateRepositoriesCommand.php | 6 ++++-- lib/Doctrine/ORM/Tools/Console/Command/RunDqlCommand.php | 4 +++- 9 files changed, 31 insertions(+), 13 deletions(-) diff --git a/lib/Doctrine/ORM/Tools/Console/Command/ClearCache/CollectionRegionCommand.php b/lib/Doctrine/ORM/Tools/Console/Command/ClearCache/CollectionRegionCommand.php index 33f003a19a..1c75ccccac 100644 --- a/lib/Doctrine/ORM/Tools/Console/Command/ClearCache/CollectionRegionCommand.php +++ b/lib/Doctrine/ORM/Tools/Console/Command/ClearCache/CollectionRegionCommand.php @@ -116,7 +116,7 @@ protected function execute(InputInterface $input, OutputInterface $output) ) ); - return; + return 0; } if ($input->getOption('all')) { @@ -124,7 +124,7 @@ protected function execute(InputInterface $input, OutputInterface $output) $cache->evictEntityRegions(); - return; + return 0; } if ($ownerId) { @@ -138,10 +138,12 @@ protected function execute(InputInterface $input, OutputInterface $output) ); $cache->evictCollection($ownerClass, $assoc, $ownerId); - return; + return 0; } $ui->comment(sprintf('Clearing second-level cache for collection "%s#%s"', $ownerClass, $assoc)); $cache->evictCollectionRegion($ownerClass, $assoc); + + return 0; } } diff --git a/lib/Doctrine/ORM/Tools/Console/Command/ClearCache/EntityRegionCommand.php b/lib/Doctrine/ORM/Tools/Console/Command/ClearCache/EntityRegionCommand.php index 67a73093fc..c246910c14 100644 --- a/lib/Doctrine/ORM/Tools/Console/Command/ClearCache/EntityRegionCommand.php +++ b/lib/Doctrine/ORM/Tools/Console/Command/ClearCache/EntityRegionCommand.php @@ -108,7 +108,7 @@ protected function execute(InputInterface $input, OutputInterface $output) $ui->comment(sprintf('Flushing cache provider configured for entity named "%s"', $entityClass)); - return; + return 0; } if ($input->getOption('all')) { @@ -116,7 +116,7 @@ protected function execute(InputInterface $input, OutputInterface $output) $cache->evictEntityRegions(); - return; + return 0; } if ($entityId) { @@ -129,10 +129,12 @@ protected function execute(InputInterface $input, OutputInterface $output) ); $cache->evictEntity($entityClass, $entityId); - return; + return 0; } $ui->comment(sprintf('Clearing second-level cache for entity "%s"', $entityClass)); $cache->evictEntityRegion($entityClass); + + return 0; } } diff --git a/lib/Doctrine/ORM/Tools/Console/Command/ClearCache/QueryRegionCommand.php b/lib/Doctrine/ORM/Tools/Console/Command/ClearCache/QueryRegionCommand.php index f1578bc641..36ffa12503 100644 --- a/lib/Doctrine/ORM/Tools/Console/Command/ClearCache/QueryRegionCommand.php +++ b/lib/Doctrine/ORM/Tools/Console/Command/ClearCache/QueryRegionCommand.php @@ -112,7 +112,7 @@ protected function execute(InputInterface $input, OutputInterface $output) ) ); - return; + return 0; } if ($input->getOption('all')) { @@ -120,10 +120,12 @@ protected function execute(InputInterface $input, OutputInterface $output) $cache->evictQueryRegions(); - return; + return 0; } $ui->comment(sprintf('Clearing second-level cache query region named "%s"', $name)); $cache->evictQueryRegion($name); + + return 0; } } diff --git a/lib/Doctrine/ORM/Tools/Console/Command/ConvertDoctrine1SchemaCommand.php b/lib/Doctrine/ORM/Tools/Console/Command/ConvertDoctrine1SchemaCommand.php index b6b43bf8e0..112efb9642 100644 --- a/lib/Doctrine/ORM/Tools/Console/Command/ConvertDoctrine1SchemaCommand.php +++ b/lib/Doctrine/ORM/Tools/Console/Command/ConvertDoctrine1SchemaCommand.php @@ -127,6 +127,8 @@ protected function execute(InputInterface $input, OutputInterface $output) $numSpaces = $input->getOption('num-spaces'); $this->convertDoctrine1Schema($fromPaths, $destPath, $toType, $numSpaces, $extend, $output); + + return 0; } /** diff --git a/lib/Doctrine/ORM/Tools/Console/Command/ConvertMappingCommand.php b/lib/Doctrine/ORM/Tools/Console/Command/ConvertMappingCommand.php index f675664114..8de2b84a9e 100644 --- a/lib/Doctrine/ORM/Tools/Console/Command/ConvertMappingCommand.php +++ b/lib/Doctrine/ORM/Tools/Console/Command/ConvertMappingCommand.php @@ -167,6 +167,8 @@ protected function execute(InputInterface $input, OutputInterface $output) $destPath ) ); + + return 0; } /** diff --git a/lib/Doctrine/ORM/Tools/Console/Command/GenerateEntitiesCommand.php b/lib/Doctrine/ORM/Tools/Console/Command/GenerateEntitiesCommand.php index 063cb244ce..828c1432db 100644 --- a/lib/Doctrine/ORM/Tools/Console/Command/GenerateEntitiesCommand.php +++ b/lib/Doctrine/ORM/Tools/Console/Command/GenerateEntitiesCommand.php @@ -112,7 +112,7 @@ protected function execute(InputInterface $input, OutputInterface $output) if (empty($metadatas)) { $ui->success('No Metadata Classes to process.'); - return; + return 0; } $entityGenerator = new EntityGenerator(); @@ -138,5 +138,7 @@ protected function execute(InputInterface $input, OutputInterface $output) // Outputting information message $ui->newLine(); $ui->success(sprintf('Entity classes generated to "%s"', $destPath)); + + return 0; } } diff --git a/lib/Doctrine/ORM/Tools/Console/Command/GenerateProxiesCommand.php b/lib/Doctrine/ORM/Tools/Console/Command/GenerateProxiesCommand.php index 3755be5805..2cace34345 100644 --- a/lib/Doctrine/ORM/Tools/Console/Command/GenerateProxiesCommand.php +++ b/lib/Doctrine/ORM/Tools/Console/Command/GenerateProxiesCommand.php @@ -91,7 +91,7 @@ protected function execute(InputInterface $input, OutputInterface $output) if (empty($metadatas)) { $ui->success('No Metadata Classes to process.'); - return; + return 0; } foreach ($metadatas as $metadata) { @@ -104,5 +104,7 @@ protected function execute(InputInterface $input, OutputInterface $output) // Outputting information message $ui->newLine(); $ui->text(sprintf('Proxy classes generated to "%s"', $destPath)); + + return 0; } } diff --git a/lib/Doctrine/ORM/Tools/Console/Command/GenerateRepositoriesCommand.php b/lib/Doctrine/ORM/Tools/Console/Command/GenerateRepositoriesCommand.php index 941944ff52..666ae7867b 100644 --- a/lib/Doctrine/ORM/Tools/Console/Command/GenerateRepositoriesCommand.php +++ b/lib/Doctrine/ORM/Tools/Console/Command/GenerateRepositoriesCommand.php @@ -84,7 +84,7 @@ protected function execute(InputInterface $input, OutputInterface $output) if (empty($metadatas)) { $ui->success('No Metadata Classes to process.'); - return; + return 0; } $numRepositories = 0; @@ -104,11 +104,13 @@ protected function execute(InputInterface $input, OutputInterface $output) if ($numRepositories === 0) { $ui->text('No Repository classes were found to be processed.'); - return; + return 0; } // Outputting information message $ui->newLine(); $ui->text(sprintf('Repository classes generated to "%s"', $destPath)); + + return 0; } } diff --git a/lib/Doctrine/ORM/Tools/Console/Command/RunDqlCommand.php b/lib/Doctrine/ORM/Tools/Console/Command/RunDqlCommand.php index 4e6b69bb42..7f4069202b 100644 --- a/lib/Doctrine/ORM/Tools/Console/Command/RunDqlCommand.php +++ b/lib/Doctrine/ORM/Tools/Console/Command/RunDqlCommand.php @@ -104,11 +104,13 @@ protected function execute(InputInterface $input, OutputInterface $output) if ($input->getOption('show-sql')) { $ui->text($query->getSQL()); - return; + return 0; } $resultSet = $query->execute([], constant($hydrationMode)); $ui->text(Debug::dump($resultSet, $input->getOption('depth'), true, false)); + + return 0; } } From 3a32c00dcf558a56b3e210db6cc9e3e2646b3bc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20RAYBAUD-ROIG?= Date: Thu, 6 Dec 2018 14:44:02 +0100 Subject: [PATCH 009/136] Add a failing test for issue #7505 --- .../Hydration/SimpleObjectHydrator.php | 13 ++- .../ORM/Functional/Ticket/GH7505Test.php | 92 +++++++++++++++++++ 2 files changed, 102 insertions(+), 3 deletions(-) create mode 100644 tests/Doctrine/Tests/ORM/Functional/Ticket/GH7505Test.php diff --git a/lib/Doctrine/ORM/Internal/Hydration/SimpleObjectHydrator.php b/lib/Doctrine/ORM/Internal/Hydration/SimpleObjectHydrator.php index bf2beaba34..f70bf9caf8 100644 --- a/lib/Doctrine/ORM/Internal/Hydration/SimpleObjectHydrator.php +++ b/lib/Doctrine/ORM/Internal/Hydration/SimpleObjectHydrator.php @@ -78,8 +78,9 @@ protected function hydrateAllData() */ protected function hydrateRowData(array $sqlResult, array &$result) { - $entityName = $this->class->name; - $data = []; + $entityName = $this->class->name; + $data = []; + $discrColumnValue = null; // We need to find the correct entity class name if we have inheritance in resultset if ($this->class->inheritanceType !== ClassMetadata::INHERITANCE_TYPE_NONE) { @@ -104,7 +105,8 @@ protected function hydrateRowData(array $sqlResult, array &$result) throw HydrationException::invalidDiscriminatorValue($sqlResult[$discrColumnName], array_keys($discrMap)); } - $entityName = $discrMap[$sqlResult[$discrColumnName]]; + $entityName = $discrMap[$sqlResult[$discrColumnName]]; + $discrColumnValue = $sqlResult[$discrColumnName]; unset($sqlResult[$discrColumnName]); } @@ -134,6 +136,11 @@ protected function hydrateRowData(array $sqlResult, array &$result) // Prevent overwrite in case of inherit classes using same property name (See AbstractHydrator) if ( ! isset($data[$fieldName]) || ! $valueIsNull) { + // If we have inheritance in resultset, make sure the field belongs to the correct class + if (isset($cacheKeyInfo['discriminatorValues']) && ! in_array($discrColumnValue, $cacheKeyInfo['discriminatorValues'], true)) { + continue; + } + $data[$fieldName] = $value; } } diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/GH7505Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/GH7505Test.php new file mode 100644 index 0000000000..b7191d1e2b --- /dev/null +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/GH7505Test.php @@ -0,0 +1,92 @@ +setUpEntitySchema([ + GH7505AbstractResponse::class, + GH7505ArrayResponse::class, + GH7505TextResponse::class, + ]); + } + + public function testSimpleArrayTypeHydratedCorrectly() : void + { + $arrayResponse = new GH7505ArrayResponse(); + $this->em->persist($arrayResponse); + + $textResponse = new GH7505TextResponse(); + $this->em->persist($textResponse); + + $this->em->flush(); + $this->em->clear(); + + $repository = $this->em->getRepository(GH7505AbstractResponse::class); + + /** @var GH7505ArrayResponse $arrayResponse */ + $arrayResponse = $repository->find($arrayResponse->id); + self::assertSame([], $arrayResponse->value); + + /** @var GH7505TextResponse $textResponse */ + $textResponse = $repository->find($textResponse->id); + self::assertNull($textResponse->value); + } +} + +/** + * @ORM\Entity() + * @ORM\Table(name="gh7505_responses") + * @ORM\InheritanceType("SINGLE_TABLE") + * @ORM\DiscriminatorColumn(name="discr", type="string") + * @ORM\DiscriminatorMap({ + * "array" = GH7505ArrayResponse::class, + * "text" = GH7505TextResponse::class, + * }) + */ +abstract class GH7505AbstractResponse +{ + /** + * @ORM\Id @ORM\GeneratedValue + * @ORM\Column(type="integer") + */ + public $id; +} + +/** + * @ORM\Entity() + */ +class GH7505ArrayResponse extends GH7505AbstractResponse +{ + /** + * @ORM\Column(name="value_array", type="simple_array") + * + * @var array + */ + public $value = []; +} + +/** + * @ORM\Entity() + */ +class GH7505TextResponse extends GH7505AbstractResponse +{ + /** + * @ORM\Column(name="value_string", type="string") + * + * @var string|null + */ + public $value; +} From 570abb5bad0760ba254965f5799b9ff26fb085e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lu=C3=ADs=20Cobucci?= Date: Fri, 15 Nov 2019 14:37:27 +0100 Subject: [PATCH 010/136] Fix PHP warnings in test suite --- tests/Doctrine/Tests/OrmFunctionalTestCase.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/Doctrine/Tests/OrmFunctionalTestCase.php b/tests/Doctrine/Tests/OrmFunctionalTestCase.php index d45ebac638..93b07447c8 100644 --- a/tests/Doctrine/Tests/OrmFunctionalTestCase.php +++ b/tests/Doctrine/Tests/OrmFunctionalTestCase.php @@ -341,7 +341,9 @@ protected function tearDown() $platform = $conn->getDatabasePlatform(); - $this->_sqlLoggerStack->enabled = false; + if ($this->_sqlLoggerStack instanceof DebugStack) { + $this->_sqlLoggerStack->enabled = false; + } if (isset($this->_usedModelSets['cms'])) { $conn->executeUpdate('DELETE FROM cms_users_groups'); From 2b8cb9de798a2b939d751d288e4335a3f422ff8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lu=C3=ADs=20Cobucci?= Date: Fri, 15 Nov 2019 14:37:40 +0100 Subject: [PATCH 011/136] Add basic tool to verify deprecation messages --- tests/Doctrine/Tests/VerifyDeprecations.php | 69 +++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 tests/Doctrine/Tests/VerifyDeprecations.php diff --git a/tests/Doctrine/Tests/VerifyDeprecations.php b/tests/Doctrine/Tests/VerifyDeprecations.php new file mode 100644 index 0000000000..8ccd9472e6 --- /dev/null +++ b/tests/Doctrine/Tests/VerifyDeprecations.php @@ -0,0 +1,69 @@ +actualDeprecations = []; + $this->expectedDeprecations = []; + + $this->originalHandler = set_error_handler( + function (int $errorNumber, string $errorMessage) : void { + $this->actualDeprecations[] = $errorMessage; + }, + E_USER_DEPRECATED + ); + } + + /** @after */ + public function resetErrorHandler() : void + { + set_error_handler($this->originalHandler, E_USER_DEPRECATED); + $this->originalHandler = null; + } + + /** @after */ + public function validateDeprecationExpectations() : void + { + if ($this->expectedDeprecations === []) { + return; + } + + self::assertSame( + $this->expectedDeprecations, + $this->actualDeprecations, + 'Triggered deprecation messages do not match with expected ones.' + ); + } + + protected function expectDeprecationMessage(string $message) : void + { + $this->expectedDeprecations[] = $message; + } + + protected function assertHasDeprecationMessages() : void + { + self::assertNotSame([], $this->actualDeprecations, 'Failed asserting that test has triggered deprecation messages.'); + } + + protected function assertNotHasDeprecationMessages() : void + { + self::assertSame([], $this->actualDeprecations, 'Failed asserting that test has not triggered deprecation messages.'); + } +} From eb9f11bf968834cd2fd5875daf34cddbf6a62e11 Mon Sep 17 00:00:00 2001 From: Michael Moravec Date: Fri, 8 Dec 2017 21:13:42 +0100 Subject: [PATCH 012/136] Added deprecation warnings for 2.x --- composer.lock | 383 ++++++++---------- lib/Doctrine/ORM/Configuration.php | 9 + lib/Doctrine/ORM/EntityManager.php | 18 + lib/Doctrine/ORM/EntityManagerInterface.php | 2 +- .../ORM/Mapping/Driver/YamlDriver.php | 8 + lib/Doctrine/ORM/Proxy/Proxy.php | 2 + lib/Doctrine/ORM/Proxy/ProxyFactory.php | 2 + .../Command/ConvertDoctrine1SchemaCommand.php | 6 + .../Command/GenerateEntitiesCommand.php | 3 + .../Command/GenerateRepositoriesCommand.php | 3 + lib/Doctrine/ORM/Tools/EntityGenerator.php | 5 + .../ORM/Tools/EntityRepositoryGenerator.php | 8 + .../Tools/Export/ClassMetadataExporter.php | 9 + .../Tools/Export/Driver/AbstractExporter.php | 5 + .../Export/Driver/AnnotationExporter.php | 2 + .../ORM/Tools/Export/Driver/PhpExporter.php | 2 + .../ORM/Tools/Export/Driver/XmlExporter.php | 2 + .../ORM/Tools/Export/Driver/YamlExporter.php | 2 + .../ORM/Tools/Export/ExportException.php | 3 + lib/Doctrine/ORM/UnitOfWork.php | 4 +- lib/Doctrine/ORM/Version.php | 2 + .../Decorator/EntityManagerDecoratorTest.php | 11 + .../Doctrine/Tests/ORM/EntityManagerTest.php | 43 ++ .../ORM/Functional/BasicFunctionalTest.php | 16 +- .../ORM/Functional/DetachedEntityTest.php | 9 + .../ORM/Functional/EntityRepositoryTest.php | 4 + .../Functional/MergeCompositeToOneKeyTest.php | 4 + .../Tests/ORM/Functional/MergeProxiesTest.php | 9 + .../Functional/MergeSharedEntitiesTest.php | 9 + .../MergeVersionedManyToOneTest.php | 4 + .../Functional/ProxiesLikeEntitiesTest.php | 2 +- .../ORM/Functional/Ticket/DDC117Test.php | 6 +- .../ORM/Functional/Ticket/DDC1276Test.php | 4 + .../ORM/Functional/Ticket/DDC1383Test.php | 5 + .../ORM/Functional/Ticket/DDC1392Test.php | 4 + .../ORM/Functional/Ticket/DDC1509Test.php | 4 + .../ORM/Functional/Ticket/DDC1594Test.php | 4 + .../ORM/Functional/Ticket/DDC1734Test.php | 9 + .../ORM/Functional/Ticket/DDC2106Test.php | 2 +- .../ORM/Functional/Ticket/DDC2230Test.php | 5 + .../ORM/Functional/Ticket/DDC2409Test.php | 8 +- .../ORM/Functional/Ticket/DDC2645Test.php | 5 + .../ORM/Functional/Ticket/DDC2790Test.php | 2 +- .../ORM/Functional/Ticket/DDC2984Test.php | 2 +- .../ORM/Functional/Ticket/DDC3699Test.php | 9 + .../ORM/Functional/Ticket/DDC3711Test.php | 4 + .../ORM/Functional/Ticket/DDC501Test.php | 4 + .../ORM/Functional/Ticket/DDC518Test.php | 5 + .../ORM/Functional/Ticket/DDC729Test.php | 9 + .../ORM/Functional/Ticket/DDC758Test.php | 8 + .../Tests/ORM/Functional/ValueObjectsTest.php | 6 +- .../ORM/Mapping/Symfony/YamlDriverTest.php | 4 + .../ORM/Mapping/YamlMappingDriverTest.php | 11 + .../ConvertDoctrine1SchemaCommandTest.php | 9 + .../GenerateRepositoriesCommandTest.php | 5 + .../ORM/Tools/ConvertDoctrine1SchemaTest.php | 4 + .../Tests/ORM/Tools/EntityGeneratorTest.php | 8 + .../Tools/EntityRepositoryGeneratorTest.php | 9 + .../AbstractClassMetadataExporterTest.php | 5 + tests/Doctrine/Tests/ORM/Tools/SetupTest.php | 4 + 60 files changed, 523 insertions(+), 232 deletions(-) diff --git a/composer.lock b/composer.lock index be48f0e64a..1641a17b14 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": "c3d70a08d75cd3995dd4c72864f3c880", + "content-hash": "084cd36de51fd4aa52c912b3e9c7c799", "packages": [ { "name": "doctrine/annotations", @@ -76,16 +76,16 @@ }, { "name": "doctrine/cache", - "version": "v1.8.0", + "version": "1.9.0", "source": { "type": "git", "url": "https://github.com/doctrine/cache.git", - "reference": "d768d58baee9a4862ca783840eca1b9add7a7f57" + "reference": "c15dcd24b756f9e52ea7c3ae8227354f3628f11a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/cache/zipball/d768d58baee9a4862ca783840eca1b9add7a7f57", - "reference": "d768d58baee9a4862ca783840eca1b9add7a7f57", + "url": "https://api.github.com/repos/doctrine/cache/zipball/c15dcd24b756f9e52ea7c3ae8227354f3628f11a", + "reference": "c15dcd24b756f9e52ea7c3ae8227354f3628f11a", "shasum": "" }, "require": { @@ -96,7 +96,7 @@ }, "require-dev": { "alcaeus/mongo-php-adapter": "^1.1", - "doctrine/coding-standard": "^4.0", + "doctrine/coding-standard": "^6.0", "mongodb/mongodb": "^1.1", "phpunit/phpunit": "^7.0", "predis/predis": "~1.0" @@ -107,7 +107,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.8.x-dev" + "dev-master": "1.9.x-dev" } }, "autoload": { @@ -120,6 +120,10 @@ "MIT" ], "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, { "name": "Roman Borschel", "email": "roman@code-factory.org" @@ -128,10 +132,6 @@ "name": "Benjamin Eberlei", "email": "kontakt@beberlei.de" }, - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, { "name": "Jonathan Wage", "email": "jonwage@gmail.com" @@ -141,46 +141,52 @@ "email": "schmittjoh@gmail.com" } ], - "description": "Caching library offering an object-oriented API for many cache backends", - "homepage": "https://www.doctrine-project.org", + "description": "PHP Doctrine Cache library is a popular cache implementation that supports many different drivers such as redis, memcache, apc, mongodb and others.", + "homepage": "https://www.doctrine-project.org/projects/cache.html", "keywords": [ + "abstraction", + "apcu", "cache", - "caching" + "caching", + "couchdb", + "memcached", + "php", + "redis", + "riak", + "xcache" ], - "time": "2018-08-21T18:01:43+00:00" + "time": "2019-11-11T10:31:52+00:00" }, { "name": "doctrine/collections", - "version": "v1.6.2", + "version": "v1.5.0", "source": { "type": "git", "url": "https://github.com/doctrine/collections.git", - "reference": "c5e0bc17b1620e97c968ac409acbff28b8b850be" + "reference": "a01ee38fcd999f34d9bfbcee59dbda5105449cbf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/collections/zipball/c5e0bc17b1620e97c968ac409acbff28b8b850be", - "reference": "c5e0bc17b1620e97c968ac409acbff28b8b850be", + "url": "https://api.github.com/repos/doctrine/collections/zipball/a01ee38fcd999f34d9bfbcee59dbda5105449cbf", + "reference": "a01ee38fcd999f34d9bfbcee59dbda5105449cbf", "shasum": "" }, "require": { - "php": "^7.1.3" + "php": "^7.1" }, "require-dev": { - "doctrine/coding-standard": "^6.0", - "phpstan/phpstan-shim": "^0.9.2", - "phpunit/phpunit": "^7.0", - "vimeo/psalm": "^3.2.2" + "doctrine/coding-standard": "~0.1@dev", + "phpunit/phpunit": "^5.7" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.6.x-dev" + "dev-master": "1.3.x-dev" } }, "autoload": { - "psr-4": { - "Doctrine\\Common\\Collections\\": "lib/Doctrine/Common/Collections" + "psr-0": { + "Doctrine\\Common\\Collections\\": "lib/" } }, "notification-url": "https://packagist.org/downloads/", @@ -209,15 +215,14 @@ "email": "schmittjoh@gmail.com" } ], - "description": "PHP Doctrine Collections library that adds additional functionality on top of PHP arrays.", - "homepage": "https://www.doctrine-project.org/projects/collections.html", + "description": "Collections Abstraction library", + "homepage": "http://www.doctrine-project.org", "keywords": [ "array", "collections", - "iterators", - "php" + "iterator" ], - "time": "2019-06-09T13:48:14+00:00" + "time": "2017-07-22T10:37:32+00:00" }, { "name": "doctrine/common", @@ -304,16 +309,16 @@ }, { "name": "doctrine/dbal", - "version": "v2.9.2", + "version": "v2.9.3", "source": { "type": "git", "url": "https://github.com/doctrine/dbal.git", - "reference": "22800bd651c1d8d2a9719e2a3dc46d5108ebfcc9" + "reference": "7345cd59edfa2036eb0fa4264b77ae2576842035" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/dbal/zipball/22800bd651c1d8d2a9719e2a3dc46d5108ebfcc9", - "reference": "22800bd651c1d8d2a9719e2a3dc46d5108ebfcc9", + "url": "https://api.github.com/repos/doctrine/dbal/zipball/7345cd59edfa2036eb0fa4264b77ae2576842035", + "reference": "7345cd59edfa2036eb0fa4264b77ae2576842035", "shasum": "" }, "require": { @@ -353,6 +358,10 @@ "MIT" ], "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, { "name": "Roman Borschel", "email": "roman@code-factory.org" @@ -361,10 +370,6 @@ "name": "Benjamin Eberlei", "email": "kontakt@beberlei.de" }, - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, { "name": "Jonathan Wage", "email": "jonwage@gmail.com" @@ -382,20 +387,20 @@ "php", "queryobject" ], - "time": "2018-12-31T03:27:51+00:00" + "time": "2019-11-02T22:19:34+00:00" }, { "name": "doctrine/event-manager", - "version": "v1.0.0", + "version": "1.1.0", "source": { "type": "git", "url": "https://github.com/doctrine/event-manager.git", - "reference": "a520bc093a0170feeb6b14e9d83f3a14452e64b3" + "reference": "629572819973f13486371cb611386eb17851e85c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/event-manager/zipball/a520bc093a0170feeb6b14e9d83f3a14452e64b3", - "reference": "a520bc093a0170feeb6b14e9d83f3a14452e64b3", + "url": "https://api.github.com/repos/doctrine/event-manager/zipball/629572819973f13486371cb611386eb17851e85c", + "reference": "629572819973f13486371cb611386eb17851e85c", "shasum": "" }, "require": { @@ -405,7 +410,7 @@ "doctrine/common": "<2.9@dev" }, "require-dev": { - "doctrine/coding-standard": "^4.0", + "doctrine/coding-standard": "^6.0", "phpunit/phpunit": "^7.0" }, "type": "library", @@ -424,6 +429,10 @@ "MIT" ], "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, { "name": "Roman Borschel", "email": "roman@code-factory.org" @@ -432,10 +441,6 @@ "name": "Benjamin Eberlei", "email": "kontakt@beberlei.de" }, - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, { "name": "Jonathan Wage", "email": "jonwage@gmail.com" @@ -449,27 +454,29 @@ "email": "ocramius@gmail.com" } ], - "description": "Doctrine Event Manager component", + "description": "The Doctrine Event Manager is a simple PHP event system that was built to be used with the various Doctrine projects.", "homepage": "https://www.doctrine-project.org/projects/event-manager.html", "keywords": [ "event", - "eventdispatcher", - "eventmanager" + "event dispatcher", + "event manager", + "event system", + "events" ], - "time": "2018-06-11T11:59:03+00:00" + "time": "2019-11-10T09:48:07+00:00" }, { "name": "doctrine/inflector", - "version": "v1.3.0", + "version": "1.3.1", "source": { "type": "git", "url": "https://github.com/doctrine/inflector.git", - "reference": "5527a48b7313d15261292c149e55e26eae771b0a" + "reference": "ec3a55242203ffa6a4b27c58176da97ff0a7aec1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/inflector/zipball/5527a48b7313d15261292c149e55e26eae771b0a", - "reference": "5527a48b7313d15261292c149e55e26eae771b0a", + "url": "https://api.github.com/repos/doctrine/inflector/zipball/ec3a55242203ffa6a4b27c58176da97ff0a7aec1", + "reference": "ec3a55242203ffa6a4b27c58176da97ff0a7aec1", "shasum": "" }, "require": { @@ -494,6 +501,10 @@ "MIT" ], "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, { "name": "Roman Borschel", "email": "roman@code-factory.org" @@ -502,10 +513,6 @@ "name": "Benjamin Eberlei", "email": "kontakt@beberlei.de" }, - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, { "name": "Jonathan Wage", "email": "jonwage@gmail.com" @@ -523,20 +530,20 @@ "singularize", "string" ], - "time": "2018-01-09T20:05:19+00:00" + "time": "2019-10-30T19:59:35+00:00" }, { "name": "doctrine/instantiator", - "version": "1.2.0", + "version": "1.3.0", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", - "reference": "a2c590166b2133a4633738648b6b064edae0814a" + "reference": "ae466f726242e637cebdd526a7d991b9433bacf1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/a2c590166b2133a4633738648b6b064edae0814a", - "reference": "a2c590166b2133a4633738648b6b064edae0814a", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/ae466f726242e637cebdd526a7d991b9433bacf1", + "reference": "ae466f726242e637cebdd526a7d991b9433bacf1", "shasum": "" }, "require": { @@ -579,7 +586,7 @@ "constructor", "instantiate" ], - "time": "2019-03-17T17:37:11+00:00" + "time": "2019-10-21T16:45:58+00:00" }, { "name": "doctrine/lexer", @@ -643,16 +650,16 @@ }, { "name": "doctrine/persistence", - "version": "1.1.1", + "version": "1.2.0", "source": { "type": "git", "url": "https://github.com/doctrine/persistence.git", - "reference": "3da7c9d125591ca83944f477e65ed3d7b4617c48" + "reference": "43526ae63312942e5316100bb3ed589ba1aba491" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/persistence/zipball/3da7c9d125591ca83944f477e65ed3d7b4617c48", - "reference": "3da7c9d125591ca83944f477e65ed3d7b4617c48", + "url": "https://api.github.com/repos/doctrine/persistence/zipball/43526ae63312942e5316100bb3ed589ba1aba491", + "reference": "43526ae63312942e5316100bb3ed589ba1aba491", "shasum": "" }, "require": { @@ -674,7 +681,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1.x-dev" + "dev-master": "1.2.x-dev" } }, "autoload": { @@ -687,6 +694,10 @@ "MIT" ], "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, { "name": "Roman Borschel", "email": "roman@code-factory.org" @@ -695,10 +706,6 @@ "name": "Benjamin Eberlei", "email": "kontakt@beberlei.de" }, - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, { "name": "Jonathan Wage", "email": "jonwage@gmail.com" @@ -721,7 +728,7 @@ "orm", "persistence" ], - "time": "2019-04-23T08:28:24+00:00" + "time": "2019-04-23T12:39:21+00:00" }, { "name": "doctrine/reflection", @@ -799,17 +806,17 @@ "time": "2018-06-14T14:45:07+00:00" }, { - "name": "psr/container", - "version": "1.0.0", + "name": "psr/log", + "version": "1.1.2", "source": { "type": "git", - "url": "https://github.com/php-fig/container.git", - "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f" + "url": "https://github.com/php-fig/log.git", + "reference": "446d54b4cb6bf489fc9d75f55843658e6f25d801" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f", - "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "url": "https://api.github.com/repos/php-fig/log/zipball/446d54b4cb6bf489fc9d75f55843658e6f25d801", + "reference": "446d54b4cb6bf489fc9d75f55843658e6f25d801", "shasum": "" }, "require": { @@ -818,12 +825,12 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.1.x-dev" } }, "autoload": { "psr-4": { - "Psr\\Container\\": "src/" + "Psr\\Log\\": "Psr/Log/" } }, "notification-url": "https://packagist.org/downloads/", @@ -836,40 +843,36 @@ "homepage": "http://www.php-fig.org/" } ], - "description": "Common Container Interface (PHP FIG PSR-11)", - "homepage": "https://github.com/php-fig/container", + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", "keywords": [ - "PSR-11", - "container", - "container-interface", - "container-interop", - "psr" + "log", + "psr", + "psr-3" ], - "time": "2017-02-14T16:28:37+00:00" + "time": "2019-11-01T11:05:21+00:00" }, { "name": "symfony/console", - "version": "v4.3.5", + "version": "v3.4.35", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "929ddf360d401b958f611d44e726094ab46a7369" + "reference": "17b154f932c5874cdbda6d05796b6490eec9f9f7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/929ddf360d401b958f611d44e726094ab46a7369", - "reference": "929ddf360d401b958f611d44e726094ab46a7369", + "url": "https://api.github.com/repos/symfony/console/zipball/17b154f932c5874cdbda6d05796b6490eec9f9f7", + "reference": "17b154f932c5874cdbda6d05796b6490eec9f9f7", "shasum": "" }, "require": { - "php": "^7.1.3", - "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php73": "^1.8", - "symfony/service-contracts": "^1.1" + "php": "^5.5.9|>=7.0.8", + "symfony/debug": "~2.8|~3.0|~4.0", + "symfony/polyfill-mbstring": "~1.0" }, "conflict": { "symfony/dependency-injection": "<3.4", - "symfony/event-dispatcher": "<4.3", "symfony/process": "<3.3" }, "provide": { @@ -877,12 +880,11 @@ }, "require-dev": { "psr/log": "~1.0", - "symfony/config": "~3.4|~4.0", + "symfony/config": "~3.3|~4.0", "symfony/dependency-injection": "~3.4|~4.0", - "symfony/event-dispatcher": "^4.3", + "symfony/event-dispatcher": "~2.8|~3.0|~4.0", "symfony/lock": "~3.4|~4.0", - "symfony/process": "~3.4|~4.0", - "symfony/var-dumper": "^4.3" + "symfony/process": "~3.3|~4.0" }, "suggest": { "psr/log": "For using the console logger", @@ -893,7 +895,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.3-dev" + "dev-master": "3.4-dev" } }, "autoload": { @@ -920,40 +922,44 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2019-10-07T12:36:49+00:00" + "time": "2019-11-13T07:12:39+00:00" }, { - "name": "symfony/polyfill-mbstring", - "version": "v1.12.0", + "name": "symfony/debug", + "version": "v3.4.35", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "b42a2f66e8f1b15ccf25652c3424265923eb4f17" + "url": "https://github.com/symfony/debug.git", + "reference": "f72e33fdb1170b326e72c3157f0cd456351dd086" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/b42a2f66e8f1b15ccf25652c3424265923eb4f17", - "reference": "b42a2f66e8f1b15ccf25652c3424265923eb4f17", + "url": "https://api.github.com/repos/symfony/debug/zipball/f72e33fdb1170b326e72c3157f0cd456351dd086", + "reference": "f72e33fdb1170b326e72c3157f0cd456351dd086", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": "^5.5.9|>=7.0.8", + "psr/log": "~1.0" }, - "suggest": { - "ext-mbstring": "For best performance" + "conflict": { + "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2" + }, + "require-dev": { + "symfony/http-kernel": "~2.8|~3.0|~4.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.12-dev" + "dev-master": "3.4-dev" } }, "autoload": { "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" + "Symfony\\Component\\Debug\\": "" }, - "files": [ - "bootstrap.php" + "exclude-from-classmap": [ + "/Tests/" ] }, "notification-url": "https://packagist.org/downloads/", @@ -962,42 +968,38 @@ ], "authors": [ { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill for the Mbstring extension", + "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "mbstring", - "polyfill", - "portable", - "shim" - ], - "time": "2019-08-06T08:03:45+00:00" + "time": "2019-10-24T15:33:53+00:00" }, { - "name": "symfony/polyfill-php73", + "name": "symfony/polyfill-mbstring", "version": "v1.12.0", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "2ceb49eaccb9352bff54d22570276bb75ba4a188" + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "b42a2f66e8f1b15ccf25652c3424265923eb4f17" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/2ceb49eaccb9352bff54d22570276bb75ba4a188", - "reference": "2ceb49eaccb9352bff54d22570276bb75ba4a188", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/b42a2f66e8f1b15ccf25652c3424265923eb4f17", + "reference": "b42a2f66e8f1b15ccf25652c3424265923eb4f17", "shasum": "" }, "require": { "php": ">=5.3.3" }, + "suggest": { + "ext-mbstring": "For best performance" + }, "type": "library", "extra": { "branch-alias": { @@ -1006,13 +1008,10 @@ }, "autoload": { "psr-4": { - "Symfony\\Polyfill\\Php73\\": "" + "Symfony\\Polyfill\\Mbstring\\": "" }, "files": [ "bootstrap.php" - ], - "classmap": [ - "Resources/stubs" ] }, "notification-url": "https://packagist.org/downloads/", @@ -1029,73 +1028,16 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", + "description": "Symfony polyfill for the Mbstring extension", "homepage": "https://symfony.com", "keywords": [ "compatibility", + "mbstring", "polyfill", "portable", "shim" ], "time": "2019-08-06T08:03:45+00:00" - }, - { - "name": "symfony/service-contracts", - "version": "v1.1.7", - "source": { - "type": "git", - "url": "https://github.com/symfony/service-contracts.git", - "reference": "ffcde9615dc5bb4825b9f6aed07716f1f57faae0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/ffcde9615dc5bb4825b9f6aed07716f1f57faae0", - "reference": "ffcde9615dc5bb4825b9f6aed07716f1f57faae0", - "shasum": "" - }, - "require": { - "php": "^7.1.3", - "psr/container": "^1.0" - }, - "suggest": { - "symfony/service-implementation": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Contracts\\Service\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Generic abstractions related to writing services", - "homepage": "https://symfony.com", - "keywords": [ - "abstractions", - "contracts", - "decoupling", - "interfaces", - "interoperability", - "standards" - ], - "time": "2019-09-17T11:12:18+00:00" } ], "packages-dev": [ @@ -1843,16 +1785,16 @@ }, { "name": "phpunit/phpunit", - "version": "7.5.16", + "version": "7.5.17", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "316afa6888d2562e04aeb67ea7f2017a0eb41661" + "reference": "4c92a15296e58191a4cd74cff3b34fc8e374174a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/316afa6888d2562e04aeb67ea7f2017a0eb41661", - "reference": "316afa6888d2562e04aeb67ea7f2017a0eb41661", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/4c92a15296e58191a4cd74cff3b34fc8e374174a", + "reference": "4c92a15296e58191a4cd74cff3b34fc8e374174a", "shasum": "" }, "require": { @@ -1923,7 +1865,7 @@ "testing", "xunit" ], - "time": "2019-09-14T09:08:39+00:00" + "time": "2019-10-28T10:37:36+00:00" }, { "name": "sebastian/code-unit-reverse-lookup", @@ -2532,16 +2474,16 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "3.5.1", + "version": "3.5.2", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "82cd0f854ceca17731d6d019c7098e3755c45060" + "reference": "65b12cdeaaa6cd276d4c3033a95b9b88b12701e7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/82cd0f854ceca17731d6d019c7098e3755c45060", - "reference": "82cd0f854ceca17731d6d019c7098e3755c45060", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/65b12cdeaaa6cd276d4c3033a95b9b88b12701e7", + "reference": "65b12cdeaaa6cd276d4c3033a95b9b88b12701e7", "shasum": "" }, "require": { @@ -2579,7 +2521,7 @@ "phpcs", "standards" ], - "time": "2019-10-16T21:14:26+00:00" + "time": "2019-10-28T04:36:32+00:00" }, { "name": "symfony/polyfill-ctype", @@ -2641,20 +2583,20 @@ }, { "name": "symfony/yaml", - "version": "v4.3.5", + "version": "v3.4.35", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "41e16350a2a1c7383c4735aa2f9fce74cf3d1178" + "reference": "dab657db15207879217fc81df4f875947bf68804" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/41e16350a2a1c7383c4735aa2f9fce74cf3d1178", - "reference": "41e16350a2a1c7383c4735aa2f9fce74cf3d1178", + "url": "https://api.github.com/repos/symfony/yaml/zipball/dab657db15207879217fc81df4f875947bf68804", + "reference": "dab657db15207879217fc81df4f875947bf68804", "shasum": "" }, "require": { - "php": "^7.1.3", + "php": "^5.5.9|>=7.0.8", "symfony/polyfill-ctype": "~1.8" }, "conflict": { @@ -2669,7 +2611,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.3-dev" + "dev-master": "3.4-dev" } }, "autoload": { @@ -2696,7 +2638,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2019-09-11T15:41:19+00:00" + "time": "2019-10-24T15:33:53+00:00" }, { "name": "theseer/tokenizer", @@ -2798,5 +2740,8 @@ "php": "^7.1", "ext-pdo": "*" }, - "platform-dev": [] + "platform-dev": [], + "platform-overrides": { + "php": "7.1" + } } diff --git a/lib/Doctrine/ORM/Configuration.php b/lib/Doctrine/ORM/Configuration.php index 6073fbe008..f4ba5df066 100644 --- a/lib/Doctrine/ORM/Configuration.php +++ b/lib/Doctrine/ORM/Configuration.php @@ -70,6 +70,9 @@ public function setProxyDir($dir) * Gets the directory where Doctrine generates any necessary proxy class files. * * @return string|null + * + * @deprecated 3.0 We're switch to `ocramius/proxy-manager` and this method isn't applicable any longer + * @see https://github.com/Ocramius/ProxyManager */ public function getProxyDir() { @@ -82,6 +85,9 @@ public function getProxyDir() * Gets the strategy for automatically generating proxy classes. * * @return int Possible values are constants of Doctrine\Common\Proxy\AbstractProxyFactory. + * + * @deprecated 3.0 We're switch to `ocramius/proxy-manager` and this method isn't applicable any longer + * @see https://github.com/Ocramius/ProxyManager */ public function getAutoGenerateProxyClasses() { @@ -107,6 +113,9 @@ public function setAutoGenerateProxyClasses($autoGenerate) * Gets the namespace where proxy classes reside. * * @return string|null + * + * @deprecated 3.0 We're switch to `ocramius/proxy-manager` and this method isn't applicable any longer + * @see https://github.com/Ocramius/ProxyManager */ public function getProxyNamespace() { diff --git a/lib/Doctrine/ORM/EntityManager.php b/lib/Doctrine/ORM/EntityManager.php index c5204f3fb5..f003c08981 100644 --- a/lib/Doctrine/ORM/EntityManager.php +++ b/lib/Doctrine/ORM/EntityManager.php @@ -29,6 +29,7 @@ use Doctrine\ORM\Query\FilterCollection; use Doctrine\Common\Util\ClassUtils; use Throwable; +use function trigger_error; /** * The EntityManager is the central access point to ORM functionality. @@ -354,6 +355,13 @@ public function createQueryBuilder() */ public function flush($entity = null) { + if ($entity !== null) { + @trigger_error( + 'Calling ' . __METHOD__ . '() with any arguments to flush specific entities is deprecated and will not be supported in Doctrine 3.0.', + E_USER_DEPRECATED + ); + } + $this->errorIfClosed(); $this->unitOfWork->commit($entity); @@ -649,9 +657,13 @@ public function refresh($entity) * @return void * * @throws ORMInvalidArgumentException + * + * @deprecated 3.0 This method is being removed from the ORM and won't have any replacement */ public function detach($entity) { + @trigger_error('Method ' . __METHOD__ . '() is deprecated and will be removed in Doctrine 3.0.', E_USER_DEPRECATED); + if ( ! is_object($entity)) { throw ORMInvalidArgumentException::invalidObject('EntityManager#detach()', $entity); } @@ -670,9 +682,13 @@ public function detach($entity) * * @throws ORMInvalidArgumentException * @throws ORMException + * + * @deprecated 3.0 This method is being removed from the ORM and won't have any replacement */ public function merge($entity) { + @trigger_error('Method ' . __METHOD__ . '() is deprecated and will be removed in Doctrine 3.0.', E_USER_DEPRECATED); + if ( ! is_object($entity)) { throw ORMInvalidArgumentException::invalidObject('EntityManager#merge()', $entity); } @@ -687,6 +703,8 @@ public function merge($entity) */ public function copy($entity, $deep = false) { + @trigger_error('Method ' . __METHOD__ . '() is deprecated and will be removed in Doctrine 3.0.', E_USER_DEPRECATED); + throw new \BadMethodCallException("Not implemented."); } diff --git a/lib/Doctrine/ORM/EntityManagerInterface.php b/lib/Doctrine/ORM/EntityManagerInterface.php index 8bbc56798b..16b7068b93 100644 --- a/lib/Doctrine/ORM/EntityManagerInterface.php +++ b/lib/Doctrine/ORM/EntityManagerInterface.php @@ -190,7 +190,7 @@ public function close(); /** * Creates a copy of the given entity. Can create a shallow or a deep copy. * - * @deprecated method will be removed in 3.0 + * @deprecated 3.0 This method is being removed from the ORM and won't have any replacement * * @param object $entity The entity to copy. * @param boolean $deep FALSE for a shallow copy, TRUE for a deep copy. diff --git a/lib/Doctrine/ORM/Mapping/Driver/YamlDriver.php b/lib/Doctrine/ORM/Mapping/Driver/YamlDriver.php index efd5accbc7..aa99f4bfee 100644 --- a/lib/Doctrine/ORM/Mapping/Driver/YamlDriver.php +++ b/lib/Doctrine/ORM/Mapping/Driver/YamlDriver.php @@ -25,6 +25,7 @@ use Doctrine\ORM\Mapping\ClassMetadata as Metadata; use Doctrine\ORM\Mapping\MappingException; use Symfony\Component\Yaml\Yaml; +use function trigger_error; /** * The YamlDriver reads the mapping metadata from yaml schema files. @@ -34,6 +35,8 @@ * @author Guilherme Blanco * @author Jonathan H. Wage * @author Roman Borschel + * + * @deprecated 3.0 This class is being removed from the ORM and won't have any replacement */ class YamlDriver extends FileDriver { @@ -44,6 +47,11 @@ class YamlDriver extends FileDriver */ public function __construct($locator, $fileExtension = self::DEFAULT_FILE_EXTENSION) { + @trigger_error( + 'YAML mapping driver is deprecated and will be removed in Doctrine 3.0, please migrate to annotation or XML driver.', + E_USER_DEPRECATED + ); + parent::__construct($locator, $fileExtension); } diff --git a/lib/Doctrine/ORM/Proxy/Proxy.php b/lib/Doctrine/ORM/Proxy/Proxy.php index f478d4905c..72463d121e 100644 --- a/lib/Doctrine/ORM/Proxy/Proxy.php +++ b/lib/Doctrine/ORM/Proxy/Proxy.php @@ -26,6 +26,8 @@ * * @author Roman Borschel * @since 2.0 + * + * @deprecated 3.0 This interface is being removed from the ORM and won't have any replacement, proxies will no longer implement it. */ interface Proxy extends BaseProxy { diff --git a/lib/Doctrine/ORM/Proxy/ProxyFactory.php b/lib/Doctrine/ORM/Proxy/ProxyFactory.php index 16cfde9317..7648a14a5f 100644 --- a/lib/Doctrine/ORM/Proxy/ProxyFactory.php +++ b/lib/Doctrine/ORM/Proxy/ProxyFactory.php @@ -37,6 +37,8 @@ * @author Giorgio Sironi * @author Marco Pivetta * @since 2.0 + * + * @deprecated 3.0 This class is being removed from the ORM and won't have any replacement */ class ProxyFactory extends AbstractProxyFactory { diff --git a/lib/Doctrine/ORM/Tools/Console/Command/ConvertDoctrine1SchemaCommand.php b/lib/Doctrine/ORM/Tools/Console/Command/ConvertDoctrine1SchemaCommand.php index 112efb9642..1fac2497be 100644 --- a/lib/Doctrine/ORM/Tools/Console/Command/ConvertDoctrine1SchemaCommand.php +++ b/lib/Doctrine/ORM/Tools/Console/Command/ConvertDoctrine1SchemaCommand.php @@ -27,6 +27,7 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Style\SymfonyStyle; /** * Command to convert a Doctrine 1 schema to a Doctrine 2 mapping file. @@ -37,6 +38,8 @@ * @author Guilherme Blanco * @author Jonathan Wage * @author Roman Borschel + * + * @deprecated 3.0 This class is being removed from the ORM and won't have any replacement */ class ConvertDoctrine1SchemaCommand extends Command { @@ -116,6 +119,9 @@ protected function configure() */ protected function execute(InputInterface $input, OutputInterface $output) { + $ui = new SymfonyStyle($input, $output); + $ui->warning('Command ' . $this->getName() . ' is deprecated and will be removed in Doctrine 3.0.'); + // Process source directories $fromPaths = array_merge([$input->getArgument('from-path')], $input->getOption('from')); diff --git a/lib/Doctrine/ORM/Tools/Console/Command/GenerateEntitiesCommand.php b/lib/Doctrine/ORM/Tools/Console/Command/GenerateEntitiesCommand.php index 828c1432db..3aff45b7c7 100644 --- a/lib/Doctrine/ORM/Tools/Console/Command/GenerateEntitiesCommand.php +++ b/lib/Doctrine/ORM/Tools/Console/Command/GenerateEntitiesCommand.php @@ -38,6 +38,8 @@ * @author Guilherme Blanco * @author Jonathan Wage * @author Roman Borschel + * + * @deprecated 3.0 This class is being removed from the ORM and won't have any replacement */ class GenerateEntitiesCommand extends Command { @@ -87,6 +89,7 @@ class is supposed to extend which. You have to adjust the entity protected function execute(InputInterface $input, OutputInterface $output) { $ui = new SymfonyStyle($input, $output); + $ui->warning('Command ' . $this->getName() . ' is deprecated and will be removed in Doctrine 3.0.'); $em = $this->getHelper('em')->getEntityManager(); diff --git a/lib/Doctrine/ORM/Tools/Console/Command/GenerateRepositoriesCommand.php b/lib/Doctrine/ORM/Tools/Console/Command/GenerateRepositoriesCommand.php index 666ae7867b..c09f10fdf2 100644 --- a/lib/Doctrine/ORM/Tools/Console/Command/GenerateRepositoriesCommand.php +++ b/lib/Doctrine/ORM/Tools/Console/Command/GenerateRepositoriesCommand.php @@ -37,6 +37,8 @@ * @author Guilherme Blanco * @author Jonathan Wage * @author Roman Borschel + * + * @deprecated 3.0 This class is being removed from the ORM and won't have any replacement */ class GenerateRepositoriesCommand extends Command { @@ -59,6 +61,7 @@ protected function configure() protected function execute(InputInterface $input, OutputInterface $output) { $ui = new SymfonyStyle($input, $output); + $ui->warning('Command ' . $this->getName() . ' is deprecated and will be removed in Doctrine 3.0.'); $em = $this->getHelper('em')->getEntityManager(); diff --git a/lib/Doctrine/ORM/Tools/EntityGenerator.php b/lib/Doctrine/ORM/Tools/EntityGenerator.php index 89761838c8..5143f637a8 100644 --- a/lib/Doctrine/ORM/Tools/EntityGenerator.php +++ b/lib/Doctrine/ORM/Tools/EntityGenerator.php @@ -24,6 +24,7 @@ use Doctrine\DBAL\Types\Type; use Doctrine\ORM\Mapping\ClassMetadataInfo; use function str_replace; +use function trigger_error; /** * Generic class used to generate PHP5 entity classes from ClassMetadataInfo instances. @@ -45,6 +46,8 @@ * @author Guilherme Blanco * @author Jonathan Wage * @author Roman Borschel + * + * @deprecated 3.0 This class is being removed from the ORM and won't have any replacement */ class EntityGenerator { @@ -335,6 +338,8 @@ public function __construct() */ public function __construct() { + @trigger_error(self::class . ' is deprecated and will be removed in Doctrine 3.0', E_USER_DEPRECATED); + if (version_compare(\Doctrine\Common\Version::VERSION, '2.2.0-DEV', '>=')) { $this->annotationsPrefix = 'ORM\\'; } diff --git a/lib/Doctrine/ORM/Tools/EntityRepositoryGenerator.php b/lib/Doctrine/ORM/Tools/EntityRepositoryGenerator.php index dbfcbc6d49..7dffe97eaa 100644 --- a/lib/Doctrine/ORM/Tools/EntityRepositoryGenerator.php +++ b/lib/Doctrine/ORM/Tools/EntityRepositoryGenerator.php @@ -20,6 +20,7 @@ namespace Doctrine\ORM\Tools; use Doctrine\ORM\EntityRepository; +use function trigger_error; /** * Class to generate entity repository classes @@ -31,6 +32,8 @@ * @author Guilherme Blanco * @author Jonathan Wage * @author Roman Borschel + * + * @deprecated 3.0 This class is being removed from the ORM and won't have any replacement */ class EntityRepositoryGenerator { @@ -52,6 +55,11 @@ class extends } '; + public function __construct() + { + @trigger_error(self::class . ' is deprecated and will be removed in Doctrine 3.0', E_USER_DEPRECATED); + } + /** * @param string $fullClassName * diff --git a/lib/Doctrine/ORM/Tools/Export/ClassMetadataExporter.php b/lib/Doctrine/ORM/Tools/Export/ClassMetadataExporter.php index ab44263cdf..fcb11cc2d9 100644 --- a/lib/Doctrine/ORM/Tools/Export/ClassMetadataExporter.php +++ b/lib/Doctrine/ORM/Tools/Export/ClassMetadataExporter.php @@ -19,6 +19,8 @@ namespace Doctrine\ORM\Tools\Export; +use function trigger_error; + /** * Class used for converting your mapping information between the * supported formats: yaml, xml, and php/annotation. @@ -26,6 +28,8 @@ * @link www.doctrine-project.org * @since 2.0 * @author Jonathan Wage + * + * @deprecated 3.0 This class is being removed from the ORM and won't have any replacement */ class ClassMetadataExporter { @@ -40,6 +44,11 @@ class ClassMetadataExporter 'annotation' => Driver\AnnotationExporter::class ]; + public function __construct() + { + @trigger_error(self::class . ' is deprecated and will be removed in Doctrine 3.0', E_USER_DEPRECATED); + } + /** * Registers a new exporter driver class under a specified name. * diff --git a/lib/Doctrine/ORM/Tools/Export/Driver/AbstractExporter.php b/lib/Doctrine/ORM/Tools/Export/Driver/AbstractExporter.php index 100e16fd00..96cb88b36c 100644 --- a/lib/Doctrine/ORM/Tools/Export/Driver/AbstractExporter.php +++ b/lib/Doctrine/ORM/Tools/Export/Driver/AbstractExporter.php @@ -21,6 +21,7 @@ use Doctrine\ORM\Mapping\ClassMetadataInfo; use Doctrine\ORM\Tools\Export\ExportException; +use function trigger_error; /** * Abstract base class which is to be used for the Exporter drivers @@ -29,6 +30,8 @@ * @link www.doctrine-project.org * @since 2.0 * @author Jonathan Wage + * + * @deprecated 3.0 This class is being removed from the ORM and won't have any replacement */ abstract class AbstractExporter { @@ -57,6 +60,8 @@ abstract class AbstractExporter */ public function __construct($dir = null) { + @trigger_error(static::class . ' is deprecated and will be removed in Doctrine 3.0', E_USER_DEPRECATED); + $this->_outputDir = $dir; } diff --git a/lib/Doctrine/ORM/Tools/Export/Driver/AnnotationExporter.php b/lib/Doctrine/ORM/Tools/Export/Driver/AnnotationExporter.php index 171ac87284..2e7e4cbfd1 100644 --- a/lib/Doctrine/ORM/Tools/Export/Driver/AnnotationExporter.php +++ b/lib/Doctrine/ORM/Tools/Export/Driver/AnnotationExporter.php @@ -28,6 +28,8 @@ * @link www.doctrine-project.org * @since 2.0 * @author Jonathan Wage + * + * @deprecated 3.0 This class is being removed from the ORM and won't have any replacement */ class AnnotationExporter extends AbstractExporter { diff --git a/lib/Doctrine/ORM/Tools/Export/Driver/PhpExporter.php b/lib/Doctrine/ORM/Tools/Export/Driver/PhpExporter.php index c918c71dd5..3e92dfe577 100644 --- a/lib/Doctrine/ORM/Tools/Export/Driver/PhpExporter.php +++ b/lib/Doctrine/ORM/Tools/Export/Driver/PhpExporter.php @@ -27,6 +27,8 @@ * @link www.doctrine-project.org * @since 2.0 * @author Jonathan Wage + * + * @deprecated 3.0 This class is being removed from the ORM and won't have any replacement */ class PhpExporter extends AbstractExporter { diff --git a/lib/Doctrine/ORM/Tools/Export/Driver/XmlExporter.php b/lib/Doctrine/ORM/Tools/Export/Driver/XmlExporter.php index 60dabe9733..7ea41f0da4 100644 --- a/lib/Doctrine/ORM/Tools/Export/Driver/XmlExporter.php +++ b/lib/Doctrine/ORM/Tools/Export/Driver/XmlExporter.php @@ -28,6 +28,8 @@ * @link www.doctrine-project.org * @since 2.0 * @author Jonathan Wage + * + * @deprecated 3.0 This class is being removed from the ORM and won't have any replacement */ class XmlExporter extends AbstractExporter { diff --git a/lib/Doctrine/ORM/Tools/Export/Driver/YamlExporter.php b/lib/Doctrine/ORM/Tools/Export/Driver/YamlExporter.php index c20c3a4fe6..7043e0a371 100644 --- a/lib/Doctrine/ORM/Tools/Export/Driver/YamlExporter.php +++ b/lib/Doctrine/ORM/Tools/Export/Driver/YamlExporter.php @@ -28,6 +28,8 @@ * @link www.doctrine-project.org * @since 2.0 * @author Jonathan Wage + * + * @deprecated 3.0 This class is being removed from the ORM and won't have any replacement */ class YamlExporter extends AbstractExporter { diff --git a/lib/Doctrine/ORM/Tools/Export/ExportException.php b/lib/Doctrine/ORM/Tools/Export/ExportException.php index 853159f17d..c9689d0a51 100644 --- a/lib/Doctrine/ORM/Tools/Export/ExportException.php +++ b/lib/Doctrine/ORM/Tools/Export/ExportException.php @@ -21,6 +21,9 @@ use Doctrine\ORM\ORMException; +/** + * @deprecated 3.0 This class is being removed from the ORM and won't have any replacement + */ class ExportException extends ORMException { /** diff --git a/lib/Doctrine/ORM/UnitOfWork.php b/lib/Doctrine/ORM/UnitOfWork.php index 82695984b6..98ccd81bdc 100644 --- a/lib/Doctrine/ORM/UnitOfWork.php +++ b/lib/Doctrine/ORM/UnitOfWork.php @@ -1866,7 +1866,7 @@ private function doRemove($entity, array &$visited) * @throws OptimisticLockException If the entity uses optimistic locking through a version * attribute and the version check against the managed copy fails. * - * @todo Require active transaction!? OptimisticLockException may result in undefined state!? + * @deprecated 3.0 This method is being removed from the ORM and won't have any replacement */ public function merge($entity) { @@ -2056,6 +2056,8 @@ private function updateAssociationWithMergedEntity($entity, array $association, * @param object $entity The entity to detach. * * @return void + * + * @deprecated 3.0 This method is being removed from the ORM and won't have any replacement */ public function detach($entity) { diff --git a/lib/Doctrine/ORM/Version.php b/lib/Doctrine/ORM/Version.php index b289a2aa8a..b0f070a4e2 100644 --- a/lib/Doctrine/ORM/Version.php +++ b/lib/Doctrine/ORM/Version.php @@ -29,6 +29,8 @@ * @author Guilherme Blanco * @author Jonathan Wage * @author Roman Borschel + * + * @deprecated 3.0 This class is being removed from the ORM and won't have any replacement */ class Version { diff --git a/tests/Doctrine/Tests/ORM/Decorator/EntityManagerDecoratorTest.php b/tests/Doctrine/Tests/ORM/Decorator/EntityManagerDecoratorTest.php index b8688d871d..14b06893b8 100644 --- a/tests/Doctrine/Tests/ORM/Decorator/EntityManagerDecoratorTest.php +++ b/tests/Doctrine/Tests/ORM/Decorator/EntityManagerDecoratorTest.php @@ -5,10 +5,14 @@ use Doctrine\ORM\Decorator\EntityManagerDecorator; use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\Query\ResultSetMapping; +use Doctrine\Tests\VerifyDeprecations; use PHPUnit\Framework\TestCase; +use function in_array; class EntityManagerDecoratorTest extends TestCase { + use VerifyDeprecations; + const VOID_METHODS = [ 'persist', 'remove', @@ -83,5 +87,12 @@ public function testAllMethodCallsAreDelegatedToTheWrappedInstance($method, arra }; $this->assertSame($return, $decorator->$method(...$parameters)); + + if (in_array($method, ['copy', 'merge', 'detach', 'getHydrator'], true)) { + $this->assertHasDeprecationMessages(); + return; + } + + $this->assertNotHasDeprecationMessages(); } } diff --git a/tests/Doctrine/Tests/ORM/EntityManagerTest.php b/tests/Doctrine/Tests/ORM/EntityManagerTest.php index a05e861098..e2774cf2dd 100644 --- a/tests/Doctrine/Tests/ORM/EntityManagerTest.php +++ b/tests/Doctrine/Tests/ORM/EntityManagerTest.php @@ -20,9 +20,12 @@ use Doctrine\Tests\Models\CMS\CmsUser; use Doctrine\Tests\Models\GeoNames\Country; use Doctrine\Tests\OrmTestCase; +use Doctrine\Tests\VerifyDeprecations; class EntityManagerTest extends OrmTestCase { + use VerifyDeprecations; + /** * @var EntityManager */ @@ -305,4 +308,44 @@ public function testClearManagerWithNullValue() $this->assertFalse($this->_em->contains($entity)); } + + public function testDeprecatedFlushWithArguments() : void + { + $entity = new Country(456, 'United Kingdom'); + $this->_em->persist($entity); + + $this->expectDeprecationMessage('Calling Doctrine\ORM\EntityManager::flush() with any arguments to flush specific entities is deprecated and will not be supported in Doctrine 3.0.'); + $this->_em->flush($entity); + } + + public function testDeprecatedMerge() : void + { + $entity = new Country(456, 'United Kingdom'); + $this->_em->persist($entity); + + $this->expectDeprecationMessage('Method Doctrine\ORM\EntityManager::merge() is deprecated and will be removed in Doctrine 3.0.'); + $this->_em->merge($entity); + } + + public function testDeprecatedDetach() : void + { + $entity = new Country(456, 'United Kingdom'); + $this->_em->persist($entity); + + $this->expectDeprecationMessage('Method Doctrine\ORM\EntityManager::detach() is deprecated and will be removed in Doctrine 3.0.'); + $this->_em->detach($entity); + } + + public function testDeprecatedCopy() : void + { + $entity = new Country(456, 'United Kingdom'); + $this->_em->persist($entity); + + try { + $this->expectDeprecationMessage('Method Doctrine\ORM\EntityManager::copy() is deprecated and will be removed in Doctrine 3.0.'); + $this->_em->copy($entity); + } catch (\BadMethodCallException $e) { + // do nothing + } + } } diff --git a/tests/Doctrine/Tests/ORM/Functional/BasicFunctionalTest.php b/tests/Doctrine/Tests/ORM/Functional/BasicFunctionalTest.php index 7bdb846535..7f19fa8301 100644 --- a/tests/Doctrine/Tests/ORM/Functional/BasicFunctionalTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/BasicFunctionalTest.php @@ -16,9 +16,12 @@ use Doctrine\Tests\Models\CMS\CmsPhonenumber; use Doctrine\Tests\Models\CMS\CmsUser; use Doctrine\Tests\OrmFunctionalTestCase; +use Doctrine\Tests\VerifyDeprecations; class BasicFunctionalTest extends OrmFunctionalTestCase { + use VerifyDeprecations; + protected function setUp() { $this->useModelSet('cms'); @@ -499,7 +502,7 @@ public function testSetSetAssociationWithGetReference() $this->_em->persist($address); $this->_em->flush(); - $this->_em->detach($address); + $this->_em->clear(CmsAddress::class); $this->assertFalse($this->_em->contains($address)); $this->assertTrue($this->_em->contains($user)); @@ -894,6 +897,7 @@ public function testMergePersistsNewEntities() $user2 = $this->_em->find(get_class($managedUser), $userId); $this->assertInstanceOf(CmsUser::class, $user2); + $this->assertHasDeprecationMessages(); } public function testMergeNonPersistedProperties() @@ -921,6 +925,7 @@ public function testMergeNonPersistedProperties() $this->assertNull($user2->nonPersistedProperty); $this->assertNull($user2->nonPersistedPropertyObject); $this->assertEquals('active', $user2->status); + $this->assertHasDeprecationMessages(); } public function testMergeThrowsExceptionIfEntityWithGeneratedIdentifierDoesNotExist() @@ -933,6 +938,7 @@ public function testMergeThrowsExceptionIfEntityWithGeneratedIdentifierDoesNotEx $this->expectException(EntityNotFoundException::class); $this->_em->merge($user); + $this->assertHasDeprecationMessages(); } /** @@ -962,6 +968,7 @@ public function testOneToOneMergeSetNull() $this->_em->clear(); $this->assertNull($this->_em->find(get_class($ph), $ph->phonenumber)->getUser()); + $this->assertHasDeprecationMessages(); } /** @@ -1073,6 +1080,7 @@ public function testFlushManyExplicitEntities() $this->assertTrue($userB->id > 0, 'user b has an id'); $this->assertTrue($userC->id > 0, 'user c has an id'); $this->assertEquals('UserC', $userC->name, 'name has not changed because we did not flush it'); + $this->assertHasDeprecationMessages(); } /** @@ -1094,6 +1102,7 @@ public function testFlushSingleManagedEntity() $user = $this->_em->find(get_class($user), $user->id); $this->assertEquals('administrator', $user->status); + $this->assertHasDeprecationMessages(); } /** @@ -1137,6 +1146,7 @@ public function testFlushSingleAndNewEntity() $this->assertTrue($this->_em->contains($otherUser), "Other user is contained in EntityManager"); $this->assertTrue($otherUser->id > 0, "other user has an id"); + $this->assertHasDeprecationMessages(); } /** @@ -1164,6 +1174,7 @@ public function testFlushAndCascadePersist() $this->assertTrue($this->_em->contains($address), "Other user is contained in EntityManager"); $this->assertTrue($address->id > 0, "other user has an id"); + $this->assertHasDeprecationMessages(); } /** @@ -1213,6 +1224,7 @@ public function testFlushSingleNewEntityThenRemove() $this->_em->clear(); $this->assertNull($this->_em->find(get_class($user), $userId)); + $this->assertHasDeprecationMessages(); } /** @@ -1241,6 +1253,7 @@ public function testProxyIsIgnored() $this->assertTrue($this->_em->contains($otherUser), "Other user is contained in EntityManager"); $this->assertTrue($otherUser->id > 0, "other user has an id"); + $this->assertHasDeprecationMessages(); } /** @@ -1270,6 +1283,7 @@ public function testFlushSingleSaveOnlySingle() $user2 = $this->_em->find(get_class($user2), $user2->id); $this->assertEquals('developer', $user2->status); + $this->assertHasDeprecationMessages(); } /** diff --git a/tests/Doctrine/Tests/ORM/Functional/DetachedEntityTest.php b/tests/Doctrine/Tests/ORM/Functional/DetachedEntityTest.php index 523c98c094..b1a9853071 100644 --- a/tests/Doctrine/Tests/ORM/Functional/DetachedEntityTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/DetachedEntityTest.php @@ -10,6 +10,7 @@ use Doctrine\Tests\Models\CMS\CmsAddress; use Doctrine\Tests\Models\CMS\CmsArticle; use Doctrine\Tests\OrmFunctionalTestCase; +use Doctrine\Tests\VerifyDeprecations; /** * Description of DetachedEntityTest @@ -18,6 +19,8 @@ */ class DetachedEntityTest extends OrmFunctionalTestCase { + use VerifyDeprecations; + protected function setUp() { $this->useModelSet('cms'); @@ -44,6 +47,7 @@ public function testSimpleDetachMerge() $this->assertFalse($user === $user2); $this->assertTrue($this->_em->contains($user2)); $this->assertEquals('Roman B.', $user2->name); + $this->assertHasDeprecationMessages(); } public function testSerializeUnserializeModifyMerge() @@ -105,6 +109,7 @@ public function testSerializeUnserializeModifyMerge() $this->assertInstanceOf(CmsPhonenumber::class, $phonenumbers[0]); $this->assertTrue($this->_em->getUnitOfWork()->isInIdentityMap($phonenumbers[0])); $this->assertTrue($this->_em->contains($phonenumbers[0]), "Failed to assert that first phonenumber in collection is contained inside EntityManager persistence context."); + $this->assertHasDeprecationMessages(); } /** @@ -156,6 +161,7 @@ public function testUninitializedLazyAssociationsAreIgnoredOnMerge() $this->assertInstanceOf(Proxy::class, $managedAddress2->user); $this->assertFalse($managedAddress2->user === $detachedAddress2->user); $this->assertFalse($managedAddress2->user->__isInitialized__); + $this->assertHasDeprecationMessages(); } /** @@ -181,6 +187,7 @@ public function testUseDetachedEntityAsQueryParameter() $this->assertInstanceOf(CmsUser::class, $newUser); $this->assertEquals('gblanco', $newUser->username); + $this->assertHasDeprecationMessages(); } /** @@ -200,6 +207,7 @@ public function testDetachManagedUnpersistedEntity() $this->assertFalse($this->_em->contains($user)); $this->assertFalse($this->_em->getUnitOfWork()->isInIdentityMap($user)); + $this->assertHasDeprecationMessages(); } /** @@ -223,6 +231,7 @@ public function testMergeArticleWrongVersion() $this->expectExceptionMessage('The optimistic lock failed, version 1 was expected, but is actually 2'); $this->_em->merge($article); + $this->assertHasDeprecationMessages(); } } diff --git a/tests/Doctrine/Tests/ORM/Functional/EntityRepositoryTest.php b/tests/Doctrine/Tests/ORM/Functional/EntityRepositoryTest.php index ebc7acee97..b8158c17a0 100644 --- a/tests/Doctrine/Tests/ORM/Functional/EntityRepositoryTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/EntityRepositoryTest.php @@ -20,12 +20,15 @@ use Doctrine\Tests\Models\DDC753\DDC753EntityWithDefaultCustomRepository; use Doctrine\Tests\Models\DDC753\DDC753InvalidRepository; use Doctrine\Tests\OrmFunctionalTestCase; +use Doctrine\Tests\VerifyDeprecations; /** * @author robo */ class EntityRepositoryTest extends OrmFunctionalTestCase { + use VerifyDeprecations; + protected function setUp() { $this->useModelSet('cms'); @@ -969,6 +972,7 @@ public function testMatchingCriteriaNullAssocComparison() $this->assertNull($usersIsNull[0]->getEmail()); $this->assertNull($usersEqNull[0]->getEmail()); + $this->assertHasDeprecationMessages(); } /** diff --git a/tests/Doctrine/Tests/ORM/Functional/MergeCompositeToOneKeyTest.php b/tests/Doctrine/Tests/ORM/Functional/MergeCompositeToOneKeyTest.php index fab94a9066..54a9bc833d 100644 --- a/tests/Doctrine/Tests/ORM/Functional/MergeCompositeToOneKeyTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/MergeCompositeToOneKeyTest.php @@ -5,9 +5,12 @@ use Doctrine\Tests\Models\MixedToOneIdentity\CompositeToOneKeyState; use Doctrine\Tests\Models\MixedToOneIdentity\Country; use Doctrine\Tests\OrmFunctionalTestCase; +use Doctrine\Tests\VerifyDeprecations; class MergeCompositeToOneKeyTest extends OrmFunctionalTestCase { + use VerifyDeprecations; + /** * {@inheritDoc} */ @@ -43,5 +46,6 @@ public function testMergingOfEntityWithCompositeIdentifierContainingToOneAssocia $this->assertNotSame($state, $merged); $this->assertInstanceOf(Country::class, $merged->country); $this->assertNotSame($country, $merged->country); + $this->assertHasDeprecationMessages(); } } diff --git a/tests/Doctrine/Tests/ORM/Functional/MergeProxiesTest.php b/tests/Doctrine/Tests/ORM/Functional/MergeProxiesTest.php index 3d0acd1f89..e323a19071 100644 --- a/tests/Doctrine/Tests/ORM/Functional/MergeProxiesTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/MergeProxiesTest.php @@ -11,9 +11,12 @@ use Doctrine\ORM\Tools\SchemaTool; use Doctrine\Tests\Models\Generic\DateTimeModel; use Doctrine\Tests\OrmFunctionalTestCase; +use Doctrine\Tests\VerifyDeprecations; class MergeProxiesTest extends OrmFunctionalTestCase { + use VerifyDeprecations; + /** * {@inheritDoc} */ @@ -24,6 +27,12 @@ protected function setUp() parent::setUp(); } + /** @after */ + public function ensureTestGeneratedDeprecationMessages() : void + { + $this->assertHasDeprecationMessages(); + } + /** * @group DDC-1392 * @group DDC-1734 diff --git a/tests/Doctrine/Tests/ORM/Functional/MergeSharedEntitiesTest.php b/tests/Doctrine/Tests/ORM/Functional/MergeSharedEntitiesTest.php index b549a42010..3e2937eda9 100644 --- a/tests/Doctrine/Tests/ORM/Functional/MergeSharedEntitiesTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/MergeSharedEntitiesTest.php @@ -4,9 +4,12 @@ use Doctrine\ORM\Tools\ToolsException; use Doctrine\Tests\OrmFunctionalTestCase; +use Doctrine\Tests\VerifyDeprecations; class MergeSharedEntitiesTest extends OrmFunctionalTestCase { + use VerifyDeprecations; + /** * {@inheritDoc} */ @@ -25,6 +28,12 @@ protected function setUp() } } + /** @after */ + public function ensureTestGeneratedDeprecationMessages() : void + { + $this->assertHasDeprecationMessages(); + } + public function testMergeSharedNewEntities() { $file = new MSEFile; diff --git a/tests/Doctrine/Tests/ORM/Functional/MergeVersionedManyToOneTest.php b/tests/Doctrine/Tests/ORM/Functional/MergeVersionedManyToOneTest.php index 43af6720c8..18e061a45e 100644 --- a/tests/Doctrine/Tests/ORM/Functional/MergeVersionedManyToOneTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/MergeVersionedManyToOneTest.php @@ -5,12 +5,15 @@ use Doctrine\Tests\Models\VersionedManyToOne\Article; use Doctrine\Tests\Models\VersionedManyToOne\Category; use Doctrine\Tests\OrmFunctionalTestCase; +use Doctrine\Tests\VerifyDeprecations; /** * @group MergeVersionedOneToMany */ class MergeVersionedManyToOneTest extends OrmFunctionalTestCase { + use VerifyDeprecations; + protected function setUp() { $this->useModelSet('versioned_many_to_one'); @@ -40,5 +43,6 @@ public function testSetVersionOnCreate() $this->_em->flush(); $this->assertEquals(2, $articleMerged->version); + $this->assertHasDeprecationMessages(); } } diff --git a/tests/Doctrine/Tests/ORM/Functional/ProxiesLikeEntitiesTest.php b/tests/Doctrine/Tests/ORM/Functional/ProxiesLikeEntitiesTest.php index c88eff4ab7..e88733d7db 100644 --- a/tests/Doctrine/Tests/ORM/Functional/ProxiesLikeEntitiesTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/ProxiesLikeEntitiesTest.php @@ -83,7 +83,7 @@ public function testEntityWithIdentifier() $this->assertInstanceOf(CmsUserProxy::class, $uninitializedProxy); $this->_em->persist($uninitializedProxy); - $this->_em->flush($uninitializedProxy); + $this->_em->flush(); $this->assertFalse($uninitializedProxy->__isInitialized(), 'Proxy didn\'t get initialized during flush operations'); $this->assertEquals($userId, $uninitializedProxy->getId()); $this->_em->remove($uninitializedProxy); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC117Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC117Test.php index 8478a5f66d..f1685d6094 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC117Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC117Test.php @@ -9,12 +9,15 @@ use Doctrine\Tests\Models\DDC117\DDC117ApproveChanges; use Doctrine\Tests\Models\DDC117\DDC117Editor; use Doctrine\Tests\Models\DDC117\DDC117Link; +use Doctrine\Tests\VerifyDeprecations; /** * @group DDC-117 */ class DDC117Test extends \Doctrine\Tests\OrmFunctionalTestCase { + use VerifyDeprecations; + private $article1; private $article2; private $reference; @@ -435,11 +438,12 @@ public function testMergeForeignKeyIdentifierEntity() $refRep = $this->_em->find(DDC117Reference::class, $idCriteria); - $this->_em->detach($refRep); + $this->_em->clear(DDC117Reference::class); $refRep = $this->_em->merge($refRep); $this->assertEquals($this->article1->id(), $refRep->source()->id()); $this->assertEquals($this->article2->id(), $refRep->target()->id()); + $this->assertHasDeprecationMessages(); } /** diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1276Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1276Test.php index eeaa870ae4..d340746863 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1276Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1276Test.php @@ -4,12 +4,15 @@ use Doctrine\Tests\Models\CMS\CmsGroup; use Doctrine\Tests\Models\CMS\CmsUser; +use Doctrine\Tests\VerifyDeprecations; /** * @group DDC-1276 */ class DDC1276Test extends \Doctrine\Tests\OrmFunctionalTestCase { + use VerifyDeprecations; + public function setUp() { $this->useModelSet('cms'); @@ -43,5 +46,6 @@ public function testIssue() $this->assertEquals(2, count($user->groups)); $this->_em->flush(); + $this->assertHasDeprecationMessages(); } } diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1383Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1383Test.php index 7a13d7ac9b..ca75f90550 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1383Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1383Test.php @@ -2,11 +2,15 @@ namespace Doctrine\Tests\ORM\Functional\Ticket; +use Doctrine\Tests\VerifyDeprecations; + /** * @group DDC-1383 */ class DDC1383Test extends \Doctrine\Tests\OrmFunctionalTestCase { + use VerifyDeprecations; + protected function setUp() { parent::setUp(); @@ -47,6 +51,7 @@ public function testFailingCase() // Parent is NOT instance of entity self::assertTrue($parent instanceof DDC1383Entity, "Entity class is " . get_class($parent) . ', "DDC1383Entity" was expected'); + $this->assertHasDeprecationMessages(); } } diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1392Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1392Test.php index 806e61de4d..b872e413b5 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1392Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1392Test.php @@ -3,12 +3,15 @@ namespace Doctrine\Tests\ORM\Functional\Ticket; use Doctrine\ORM\UnitOfWork; +use Doctrine\Tests\VerifyDeprecations; /** * @group DDC-1392 */ class DDC1392Test extends \Doctrine\Tests\OrmFunctionalTestCase { + use VerifyDeprecations; + protected function setUp() { parent::setUp(); @@ -61,6 +64,7 @@ public function testFailingCase() $result = $q->getSingleScalarResult(); self::assertEquals(1, $result); + $this->assertHasDeprecationMessages(); } } diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1509Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1509Test.php index 17cfdf78dc..a2f9c1904a 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1509Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1509Test.php @@ -2,11 +2,14 @@ namespace Doctrine\Tests\ORM\Functional\Ticket; +use Doctrine\Tests\VerifyDeprecations; + /** * @group DDC-1509 */ class DDC1509Test extends \Doctrine\Tests\OrmFunctionalTestCase { + use VerifyDeprecations; protected function setUp() { @@ -48,6 +51,7 @@ public function testFailingCase() $this->assertNotNull($pic->getThumbnail()); $this->assertNotNull($pic->getFile()); + $this->assertHasDeprecationMessages(); } } diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1594Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1594Test.php index 0c94f73d54..00cd70a3c0 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1594Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1594Test.php @@ -3,12 +3,15 @@ namespace Doctrine\Tests\ORM\Functional\Ticket; use Doctrine\Tests\Models\CMS\CmsUser; +use Doctrine\Tests\VerifyDeprecations; /** * @group DDC-1594 */ class DDC1594Test extends \Doctrine\Tests\OrmFunctionalTestCase { + use VerifyDeprecations; + public function setUp() { $this->useModelSet('cms'); @@ -37,5 +40,6 @@ public function testIssue() $this->assertNotSame($mergedUser, $detachedUser); $this->assertEquals('bar', $detachedUser->getName()); $this->assertEquals('bar', $mergedUser->getName()); + $this->assertHasDeprecationMessages(); } } diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1734Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1734Test.php index cfca544ae8..64199eb07c 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1734Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1734Test.php @@ -4,9 +4,12 @@ use Doctrine\ORM\Proxy\Proxy; use Doctrine\Tests\Models\CMS\CmsGroup; +use Doctrine\Tests\VerifyDeprecations; class DDC1734Test extends \Doctrine\Tests\OrmFunctionalTestCase { + use VerifyDeprecations; + /** * {@inheritDoc} */ @@ -16,6 +19,12 @@ protected function setUp() parent::setUp(); } + /** @after */ + public function ensureTestGeneratedDeprecationMessages() : void + { + $this->assertHasDeprecationMessages(); + } + /** * This test is DDC-1734 minus the serialization, i.e. it works * diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2106Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2106Test.php index 4856852eca..99b2ade0f0 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2106Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2106Test.php @@ -26,7 +26,7 @@ public function testDetachedEntityAsId() $entity = new DDC2106Entity(); $this->_em->persist($entity); $this->_em->flush(); - $this->_em->detach($entity); + $this->_em->clear(DDC2106Entity::class); $entity = $this->_em->getRepository(DDC2106Entity::class)->findOneBy([]); // ... and a managed entity without id diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2230Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2230Test.php index 4ced4df4dc..d68fd8a52e 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2230Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2230Test.php @@ -7,12 +7,15 @@ use Doctrine\Common\Proxy\Proxy; use Doctrine\ORM\Tools\ToolsException; use Doctrine\Tests\OrmFunctionalTestCase; +use Doctrine\Tests\VerifyDeprecations; /** * @group DDC-2230 */ class DDC2230Test extends OrmFunctionalTestCase { + use VerifyDeprecations; + protected function setUp() { parent::setUp(); @@ -48,6 +51,7 @@ public function testNotifyTrackingNotCalledOnUninitializedProxies() $this->assertInstanceOf(Proxy::class, $address); $this->assertFalse($address->__isInitialized()); + $this->assertHasDeprecationMessages(); } public function testNotifyTrackingCalledOnProxyInitialization() @@ -67,6 +71,7 @@ public function testNotifyTrackingCalledOnProxyInitialization() $addressProxy->__load(); $this->assertSame($this->_em->getUnitOfWork(), $addressProxy->listener); + $this->assertNotHasDeprecationMessages(); } } diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2409Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2409Test.php index 94d39b9944..aa44bbaee6 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2409Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2409Test.php @@ -5,12 +5,15 @@ use Doctrine\ORM\UnitOfWork; use Doctrine\Tests\Models\CMS\CmsUser; use Doctrine\Tests\Models\CMS\CmsArticle; +use Doctrine\Tests\VerifyDeprecations; /** * @group DDC-2409 */ class DDC2409Test extends \Doctrine\Tests\OrmFunctionalTestCase { + use VerifyDeprecations; + public function setUp() { $this->useModelSet('cms'); @@ -53,8 +56,8 @@ public function testIssue() $this->assertEquals(UnitOfWork::STATE_MANAGED, $uow->getEntityState($article)); $this->assertEquals(UnitOfWork::STATE_NEW, $uow->getEntityState($user)); - $em->detach($user); - $em->detach($article); + $em->clear(CmsUser::class); + $em->clear(CmsArticle::class); $userMerged = $em->merge($user); $articleMerged = $em->merge($article); @@ -68,5 +71,6 @@ public function testIssue() $this->assertNotSame($article, $articleMerged); $this->assertNotSame($userMerged, $articleMerged->user); $this->assertSame($user, $articleMerged->user); + $this->assertHasDeprecationMessages(); } } diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2645Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2645Test.php index d6a77f7db3..e71de5b3f0 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2645Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2645Test.php @@ -2,11 +2,15 @@ namespace Doctrine\Tests\ORM\Functional\Ticket; +use Doctrine\Tests\VerifyDeprecations; + /** * @group DDC-2645 */ class DDC2645Test extends \Doctrine\Tests\OrmFunctionalTestCase { + use VerifyDeprecations; + public function testIssue() { $bar = new DDC2645Bar; @@ -22,6 +26,7 @@ public function testIssue() $this->assertSame($foo, $foo3); $this->assertEquals('Bar', $foo->name); + $this->assertHasDeprecationMessages(); } } diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2790Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2790Test.php index ee2668931c..0f3efab262 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2790Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2790Test.php @@ -45,7 +45,7 @@ public function testIssue() // (and consequently also triggers preUpdate/postUpdate for the entity in question) $entity->name = 'Robin'; - $this->_em->flush($entity); + $this->_em->flush(); $qb = $this->_em->createQueryBuilder(); $qb->from(get_class($entity), 'c'); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2984Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2984Test.php index 69f4d01c0c..e21ac82dc8 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2984Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2984Test.php @@ -40,7 +40,7 @@ public function testIssue() $user->applyName('Alex'); $this->_em->persist($user); - $this->_em->flush($user); + $this->_em->flush(); $repository = $this->_em->getRepository(__NAMESPACE__ . "\DDC2984User"); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3699Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3699Test.php index fd284e5b11..8d3607112e 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3699Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3699Test.php @@ -3,12 +3,15 @@ use Doctrine\Tests\Models\DDC3699\DDC3699RelationOne; use Doctrine\Tests\Models\DDC3699\DDC3699RelationMany; use Doctrine\Tests\Models\DDC3699\DDC3699Child; +use Doctrine\Tests\VerifyDeprecations; /** * @group DDC-3699 */ class DDC3597Test extends \Doctrine\Tests\OrmFunctionalTestCase { + use VerifyDeprecations; + protected function setUp() { $this->useModelSet('ddc3699'); @@ -16,6 +19,12 @@ protected function setUp() parent::setUp(); } + /** @after */ + public function ensureTestGeneratedDeprecationMessages() : void + { + $this->assertHasDeprecationMessages(); + } + /** * @group DDC-3699 */ diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3711Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3711Test.php index bd2b1ba9bc..dc633c7aa8 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3711Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3711Test.php @@ -6,12 +6,15 @@ use Doctrine\ORM\Mapping\ClassMetadata; use Doctrine\Tests\Models\DDC3711\DDC3711EntityA; use Doctrine\Tests\ORM\Mapping\YamlMappingDriverTest; +use Doctrine\Tests\VerifyDeprecations; /** * @author Marc Pantel */ class DDC3711Test extends YamlMappingDriverTest { + use VerifyDeprecations; + public function testCompositeKeyForJoinTableInManyToManyCreation() { $yamlDriver = $this->_loadDriver(); @@ -26,5 +29,6 @@ public function testCompositeKeyForJoinTableInManyToManyCreation() $this->assertEquals(['link_a_id1' => "id1", 'link_a_id2' => "id2"], $entityA->associationMappings['entityB']['relationToSourceKeyColumns']); $this->assertEquals(['link_b_id1' => "id1", 'link_b_id2' => "id2"], $entityA->associationMappings['entityB']['relationToTargetKeyColumns']); + $this->assertHasDeprecationMessages(); } } diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC501Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC501Test.php index 5b2996aab2..14c8be412c 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC501Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC501Test.php @@ -5,6 +5,7 @@ use Doctrine\Tests\Models\CMS\CmsUser; use Doctrine\Tests\Models\CMS\CmsGroup; use Doctrine\Tests\Models\CMS\CmsPhonenumber; +use Doctrine\Tests\VerifyDeprecations; /** * ----------------- !! NOTE !! -------------------- @@ -19,6 +20,8 @@ */ class DDC501Test extends OrmFunctionalTestCase { + use VerifyDeprecations; + protected function setUp() { $this->useModelSet('cms'); @@ -80,6 +83,7 @@ public function testMergeUnitializedManyToManyAndOneToManyCollections() // This works fine as long as cmUser::groups doesn't cascade "merge" // Otherwise group memberships are physically deleted now! $this->assertEquals(2, count($userClone->getGroups())); + $this->assertHasDeprecationMessages(); } protected function createAndPersistUser() diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC518Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC518Test.php index 073bb33518..64749876b8 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC518Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC518Test.php @@ -2,8 +2,12 @@ namespace Doctrine\Tests\ORM\Functional\Ticket; +use Doctrine\Tests\VerifyDeprecations; + class DDC518Test extends \Doctrine\Tests\OrmFunctionalTestCase { + use VerifyDeprecations; + public function setUp() { $this->useModelSet('cms'); @@ -31,5 +35,6 @@ public function testMergeWithRelatedNew() $managedArticle = $this->_em->merge($article); $this->assertSame($article->user, $managedArticle->user); + $this->assertHasDeprecationMessages(); } } diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC729Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC729Test.php index af4c9634c1..8cc9642100 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC729Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC729Test.php @@ -4,9 +4,12 @@ use Doctrine\Common\Collections\ArrayCollection; use Doctrine\ORM\PersistentCollection; +use Doctrine\Tests\VerifyDeprecations; class DDC729Test extends \Doctrine\Tests\OrmFunctionalTestCase { + use VerifyDeprecations; + public function setUp() { parent::setUp(); @@ -24,6 +27,12 @@ public function setUp() } } + /** @after */ + public function ensureTestGeneratedDeprecationMessages() : void + { + $this->assertHasDeprecationMessages(); + } + public function testMergeManyToMany() { $a = new DDC729A(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC758Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC758Test.php index a5707f233e..e7a36310ed 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC758Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC758Test.php @@ -5,9 +5,11 @@ use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Tests\Models\CMS\CmsUser; use Doctrine\Tests\Models\CMS\CmsGroup; +use Doctrine\Tests\VerifyDeprecations; class DDC758Test extends \Doctrine\Tests\OrmFunctionalTestCase { + use VerifyDeprecations; public function setUp() { @@ -17,6 +19,12 @@ public function setUp() parent::setUp(); } + /** @after */ + public function ensureTestGeneratedDeprecationMessages() : void + { + $this->assertHasDeprecationMessages(); + } + /** * Helper method to set cascade to merge only */ diff --git a/tests/Doctrine/Tests/ORM/Functional/ValueObjectsTest.php b/tests/Doctrine/Tests/ORM/Functional/ValueObjectsTest.php index ff5de971ac..7a483ebc78 100644 --- a/tests/Doctrine/Tests/ORM/Functional/ValueObjectsTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/ValueObjectsTest.php @@ -141,7 +141,7 @@ public function testDqlOnEmbeddedObjectsField() $person = new DDC93Person('Johannes', new DDC93Address('Moo', '12345', 'Karlsruhe', new DDC93Country('Germany'))); $this->_em->persist($person); - $this->_em->flush($person); + $this->_em->flush(); // SELECT $selectDql = "SELECT p FROM " . __NAMESPACE__ ."\\DDC93Person p WHERE p.address.city = :city AND p.address.country.name = :country"; @@ -184,7 +184,7 @@ public function testPartialDqlOnEmbeddedObjectsField() { $person = new DDC93Person('Karl', new DDC93Address('Foo', '12345', 'Gosport', new DDC93Country('England'))); $this->_em->persist($person); - $this->_em->flush($person); + $this->_em->flush(); $this->_em->clear(); // Prove that the entity was persisted correctly. @@ -254,7 +254,7 @@ public function testEmbeddableWithInheritance() { $car = new DDC93Car(new DDC93Address('Foo', '12345', 'Asdf')); $this->_em->persist($car); - $this->_em->flush($car); + $this->_em->flush(); $reloadedCar = $this->_em->find(DDC93Car::class, $car->id); $this->assertEquals($car, $reloadedCar); diff --git a/tests/Doctrine/Tests/ORM/Mapping/Symfony/YamlDriverTest.php b/tests/Doctrine/Tests/ORM/Mapping/Symfony/YamlDriverTest.php index f9c8a839b0..d74677fc7d 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/Symfony/YamlDriverTest.php +++ b/tests/Doctrine/Tests/ORM/Mapping/Symfony/YamlDriverTest.php @@ -3,12 +3,15 @@ namespace Doctrine\Tests\ORM\Mapping\Symfony; use \Doctrine\ORM\Mapping\Driver\SimplifiedYamlDriver; +use Doctrine\Tests\VerifyDeprecations; /** * @group DDC-1418 */ class YamlDriverTest extends AbstractDriverTest { + use VerifyDeprecations; + protected function getFileExtension() { return '.orm.yml'; @@ -17,6 +20,7 @@ protected function getFileExtension() protected function getDriver(array $paths = []) { $driver = new SimplifiedYamlDriver(array_flip($paths)); + $this->expectDeprecationMessage('YAML mapping driver is deprecated and will be removed in Doctrine 3.0, please migrate to annotation or XML driver.'); return $driver; } diff --git a/tests/Doctrine/Tests/ORM/Mapping/YamlMappingDriverTest.php b/tests/Doctrine/Tests/ORM/Mapping/YamlMappingDriverTest.php index b6feb40529..d34460d268 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/YamlMappingDriverTest.php +++ b/tests/Doctrine/Tests/ORM/Mapping/YamlMappingDriverTest.php @@ -8,10 +8,13 @@ use Doctrine\Tests\Models\DirectoryTree\Directory; use Doctrine\Tests\Models\DirectoryTree\File; use Doctrine\Tests\Models\Generic\SerializationModel; +use Doctrine\Tests\VerifyDeprecations; use Symfony\Component\Yaml\Yaml; class YamlMappingDriverTest extends AbstractMappingDriverTest { + use VerifyDeprecations; + protected function _loadDriver() { if (!class_exists(Yaml::class, true)) { @@ -43,6 +46,7 @@ public function testJoinTablesWithMappedSuperclassForYamlDriver() $classDirectory = new ClassMetadata(Directory::class); $classDirectory = $factory->getMetadataFor(Directory::class); $this->assertEquals(Directory::class, $classDirectory->associationMappings['parentDirectory']['sourceEntity']); + $this->assertHasDeprecationMessages(); } /** @@ -76,6 +80,13 @@ public function testSpacesShouldBeIgnoredWhenUseExplode() $this->assertEquals(255, $nameField['length']); $this->assertEquals(255, $valueField['length']); + $this->assertHasDeprecationMessages(); + } + + public function testDeprecation() : void + { + $this->createClassMetadata(DDC2069Entity::class); + $this->expectDeprecationMessage('YAML mapping driver is deprecated and will be removed in Doctrine 3.0, please migrate to annotation or XML driver.'); } } diff --git a/tests/Doctrine/Tests/ORM/Tools/Console/Command/ConvertDoctrine1SchemaCommandTest.php b/tests/Doctrine/Tests/ORM/Tools/Console/Command/ConvertDoctrine1SchemaCommandTest.php index 3e6a0e9048..f21a9a64d3 100644 --- a/tests/Doctrine/Tests/ORM/Tools/Console/Command/ConvertDoctrine1SchemaCommandTest.php +++ b/tests/Doctrine/Tests/ORM/Tools/Console/Command/ConvertDoctrine1SchemaCommandTest.php @@ -5,10 +5,19 @@ use Doctrine\ORM\Tools\Console\Command\ConvertDoctrine1SchemaCommand; use Doctrine\ORM\Tools\EntityGenerator; use Doctrine\Tests\OrmTestCase; +use Doctrine\Tests\VerifyDeprecations; use Symfony\Component\Console\Output\OutputInterface; class ConvertDoctrine1SchemaCommandTest extends OrmTestCase { + use VerifyDeprecations; + + /** @after */ + public function ensureTestGeneratedDeprecationMessages() : void + { + $this->assertHasDeprecationMessages(); + } + public function testExecution() { $entityGenerator = $this->createMock(EntityGenerator::class); diff --git a/tests/Doctrine/Tests/ORM/Tools/Console/Command/GenerateRepositoriesCommandTest.php b/tests/Doctrine/Tests/ORM/Tools/Console/Command/GenerateRepositoriesCommandTest.php index 74fbc38b22..cd05da25ec 100644 --- a/tests/Doctrine/Tests/ORM/Tools/Console/Command/GenerateRepositoriesCommandTest.php +++ b/tests/Doctrine/Tests/ORM/Tools/Console/Command/GenerateRepositoriesCommandTest.php @@ -10,12 +10,14 @@ use Doctrine\ORM\Tools\Console\Helper\EntityManagerHelper; use Doctrine\Tests\Models\DDC3231\DDC3231EntityRepository; use Doctrine\Tests\OrmFunctionalTestCase; +use Doctrine\Tests\VerifyDeprecations; use Symfony\Component\Console\Application; use Symfony\Component\Console\Helper\HelperSet; use Symfony\Component\Console\Tester\CommandTester; class GenerateRepositoriesCommandTest extends OrmFunctionalTestCase { + use VerifyDeprecations; /** * @var \Symfony\Component\Console\Application */ @@ -89,6 +91,7 @@ public function testGenerateRepositories() self::assertSame(EntityRepository::class, $repo1->getParentClass()->getName()); self::assertSame(EntityRepository::class, $repo2->getParentClass()->getName()); + $this->assertHasDeprecationMessages(); } public function testGenerateRepositoriesCustomDefaultRepository() @@ -112,6 +115,7 @@ public function testGenerateRepositoriesCustomDefaultRepository() self::assertSame(DDC3231EntityRepository::class, $repo1->getParentClass()->getName()); self::assertSame(DDC3231EntityRepository::class, $repo2->getParentClass()->getName()); + $this->assertHasDeprecationMessages(); } /** @@ -168,6 +172,7 @@ public function testNoMetadataClassesToProcess() : void ] ); + self::assertContains('Command orm:generate-repositories is deprecated and will be removed in Doctrine 3.0.', $tester->getDisplay()); self::assertContains('[OK] No Metadata Classes to process.', $tester->getDisplay()); } } diff --git a/tests/Doctrine/Tests/ORM/Tools/ConvertDoctrine1SchemaTest.php b/tests/Doctrine/Tests/ORM/Tools/ConvertDoctrine1SchemaTest.php index ca6192faa2..291228687f 100644 --- a/tests/Doctrine/Tests/ORM/Tools/ConvertDoctrine1SchemaTest.php +++ b/tests/Doctrine/Tests/ORM/Tools/ConvertDoctrine1SchemaTest.php @@ -13,6 +13,7 @@ use Doctrine\Common\EventManager; use Doctrine\ORM\Tools\DisconnectedClassMetadataFactory; use Doctrine\Tests\OrmTestCase; +use Doctrine\Tests\VerifyDeprecations; /** * Test case for converting a Doctrine 1 style schema to Doctrine 2 mapping files @@ -26,6 +27,8 @@ */ class ConvertDoctrine1SchemaTest extends OrmTestCase { + use VerifyDeprecations; + protected function _createEntityManager($metadataDriver) { $driverMock = new DriverMock(); @@ -77,6 +80,7 @@ public function testTest() $this->assertEquals('User', $profileClass->associationMappings['User']['targetEntity']); $this->assertEquals('username', $userClass->table['uniqueConstraints']['username']['columns'][0]); + $this->assertHasDeprecationMessages(); } public function tearDown() diff --git a/tests/Doctrine/Tests/ORM/Tools/EntityGeneratorTest.php b/tests/Doctrine/Tests/ORM/Tools/EntityGeneratorTest.php index 42d62513b7..2551869153 100644 --- a/tests/Doctrine/Tests/ORM/Tools/EntityGeneratorTest.php +++ b/tests/Doctrine/Tests/ORM/Tools/EntityGeneratorTest.php @@ -12,9 +12,11 @@ use Doctrine\Tests\Models\DDC2372\DDC2372Admin; use Doctrine\Tests\Models\DDC2372\DDC2372User; use Doctrine\Tests\OrmTestCase; +use Doctrine\Tests\VerifyDeprecations; class EntityGeneratorTest extends OrmTestCase { + use VerifyDeprecations; /** * @var EntityGenerator @@ -49,6 +51,12 @@ public function tearDown() rmdir($this->_tmpDir . '/' . $this->_namespace); } + /** @after */ + public function ensureTestGeneratedDeprecationMessages() : void + { + $this->assertHasDeprecationMessages(); + } + /** * @param ClassMetadataInfo[] $embeddedClasses * diff --git a/tests/Doctrine/Tests/ORM/Tools/EntityRepositoryGeneratorTest.php b/tests/Doctrine/Tests/ORM/Tools/EntityRepositoryGeneratorTest.php index feff13dc06..d020cc6e07 100644 --- a/tests/Doctrine/Tests/ORM/Tools/EntityRepositoryGeneratorTest.php +++ b/tests/Doctrine/Tests/ORM/Tools/EntityRepositoryGeneratorTest.php @@ -10,9 +10,12 @@ use Doctrine\Tests\Models\DDC3231\DDC3231User1; use Doctrine\Tests\Models\DDC3231\DDC3231User2; use Doctrine\Tests\OrmTestCase; +use Doctrine\Tests\VerifyDeprecations; class EntityRepositoryGeneratorTest extends OrmTestCase { + use VerifyDeprecations; + /** * @var EntityGenerator */ @@ -70,6 +73,12 @@ public function tearDown() } } + /** @after */ + public function ensureTestGeneratedDeprecationMessages() : void + { + $this->assertHasDeprecationMessages(); + } + /** * @group DDC-3231 */ diff --git a/tests/Doctrine/Tests/ORM/Tools/Export/AbstractClassMetadataExporterTest.php b/tests/Doctrine/Tests/ORM/Tools/Export/AbstractClassMetadataExporterTest.php index a74af72a17..84ddd011f6 100644 --- a/tests/Doctrine/Tests/ORM/Tools/Export/AbstractClassMetadataExporterTest.php +++ b/tests/Doctrine/Tests/ORM/Tools/Export/AbstractClassMetadataExporterTest.php @@ -19,6 +19,7 @@ use Doctrine\Tests\Mocks\DriverMock; use Doctrine\Tests\Mocks\EntityManagerMock; use Doctrine\Tests\OrmTestCase; +use Doctrine\Tests\VerifyDeprecations; use Symfony\Component\Yaml\Parser; /** @@ -33,6 +34,8 @@ */ abstract class AbstractClassMetadataExporterTest extends OrmTestCase { + use VerifyDeprecations; + protected $_extension; abstract protected function _getType(); @@ -115,6 +118,8 @@ public function testExportDirectoryAndFilesAreCreated() } else { $this->assertTrue(file_exists(__DIR__ . '/export/' . $type . '/Doctrine.Tests.ORM.Tools.Export.ExportedUser'.$this->_extension)); } + + $this->assertHasDeprecationMessages(); } /** diff --git a/tests/Doctrine/Tests/ORM/Tools/SetupTest.php b/tests/Doctrine/Tests/ORM/Tools/SetupTest.php index c7ec7c6d19..3678a4cf4c 100644 --- a/tests/Doctrine/Tests/ORM/Tools/SetupTest.php +++ b/tests/Doctrine/Tests/ORM/Tools/SetupTest.php @@ -11,9 +11,12 @@ use Doctrine\ORM\Tools\Setup; use Doctrine\ORM\Version; use Doctrine\Tests\OrmTestCase; +use Doctrine\Tests\VerifyDeprecations; class SetupTest extends OrmTestCase { + use VerifyDeprecations; + private $originalAutoloaderCount; private $originalIncludePath; @@ -74,6 +77,7 @@ public function testYAMLConfiguration() $this->assertInstanceOf(Configuration::class, $config); $this->assertInstanceOf(YamlDriver::class, $config->getMetadataDriverImpl()); + $this->assertHasDeprecationMessages(); } /** From f9a4258dedd6b4e9885e096dc6f5af73866a693a Mon Sep 17 00:00:00 2001 From: Michael Moravec Date: Sun, 17 Dec 2017 05:02:07 +0100 Subject: [PATCH 013/136] Upgrading notes for 2.7 --- UPGRADE.md | 98 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) diff --git a/UPGRADE.md b/UPGRADE.md index 18b74ce937..9a54315bba 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -1,5 +1,103 @@ # Upgrade to 2.7 +## Deprecated code generators and related console commands + +These console commands have been deprecated: + + * `orm:convert-mapping` + * `orm:generate:entities` + * `orm:generate-repositories` + +These classes have been deprecated: + + * `Doctrine\ORM\Tools\EntityGenerator` + * `Doctrine\ORM\Tools\EntityRepositoryGenerator` + +Whole Doctrine\ORM\Tools\Export namespace with all its members have been deprecated as well. + +## Deprecated `Doctrine\ORM\Proxy\Proxy` marker interface + +Proxy objects in Doctrine 3.0 will no longer implement `Doctrine\ORM\Proxy\Proxy` nor +`Doctrine\Common\Persistence\Proxy`: instead, they implement +`ProxyManager\Proxy\GhostObjectInterface`. + +These related classes have been deprecated: + + * `Doctrine\ORM\Proxy\ProxyFactory` + * `Doctrine\ORM\Proxy\Autoloader` - we suggest using the composer autoloader instead + +These methods have been deprecated: + + * `Doctrine\ORM\Configuration#getAutoGenerateProxyClasses()` + * `Doctrine\ORM\Configuration#getProxyDir()` + * `Doctrine\ORM\Configuration#getProxyNamespace()` + +## Deprecated `Doctrine\ORM\Version` + +The `Doctrine\ORM\Version` class is now deprecated and will be removed in Doctrine 3.0: +please refrain from checking the ORM version at runtime or use +[Ocramius/PackageVersions](https://github.com/Ocramius/PackageVersions/). + +## Deprecated `EntityManager#merge()` and `EntityManager#detach()` methods + +Merge and detach semantics were a poor fit for the PHP "share-nothing" architecture. +In addition to that, merging/detaching caused multiple issues with data integrity +in the managed entity graph, which was constantly spawning more edge-case bugs/scenarios. + +The following API methods were therefore deprecated: + +* `EntityManager#merge()` +* `EntityManager#detach()` +* `UnitOfWork#merge()` +* `UnitOfWork#detach()` + +Users are encouraged to migrate `EntityManager#detach()` calls to `EntityManager#clear()`. + +In order to maintain performance on batch processing jobs, it is endorsed to enable +the second level cache (http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/second-level-cache.html) +on entities that are frequently reused across multiple `EntityManager#clear()` calls. + +An alternative to `EntityManager#merge()` will not be provided by ORM 3.0, since the merging +semantics should be part of the business domain rather than the persistence domain of an +application. If your application relies heavily on CRUD-alike interactions and/or `PATCH` +restful operations, you should look at alternatives such as [JMSSerializer](https://github.com/schmittjoh/serializer). + +## Extending `EntityManager` is deprecated + +Final keyword will be added to the `EntityManager::class` in Doctrine 3.0 in order to ensure that EntityManager + is not used as valid extension point. Valid extension point should be EntityManagerInterface. + +## Deprecated `EntityManager#flush($entity)` and `EntityManager#flush($entities)` + +If your code relies on single entity flushing optimisations via +`EntityManager#flush($entity)`, the signature has been changed to +`EntityManager#flush()`. + +Said API was affected by multiple data integrity bugs due to the fact +that change tracking was being restricted upon a subset of the managed +entities. The ORM cannot support committing subsets of the managed +entities while also guaranteeing data integrity, therefore this +utility was removed. + +The `flush()` semantics will remain the same, but the change tracking will be performed +on all entities managed by the unit of work, and not just on the provided +`$entity` or `$entities`, as the parameter is now completely ignored. + +The same applies to `UnitOfWork#commit($entity)`, which will simply be +`UnitOfWork#commit()`. + +If you would still like to perform batching operations over small `UnitOfWork` +instances, it is suggested to follow these paths instead: + + * eagerly use `EntityManager#clear()` in conjunction with a specific second level + cache configuration (see http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/second-level-cache.html) + * use an explicit change tracking policy (see http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/change-tracking-policies.html) + +## Deprecated `YAML` mapping drivers. + +If your code relies on `YamlDriver` or `SimpleYamlDriver`, you **MUST** change to +annotation or XML drivers instead. + ## Deprecated: `Doctrine\ORM\EntityManagerInterface#copy()` Method `Doctrine\ORM\EntityManagerInterface#copy()` never got its implementation and is deprecated. From 26806d08eb181d5254c8cd9b8ba0e82bcbc9c284 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lu=C3=ADs=20Cobucci?= Date: Fri, 15 Nov 2019 23:42:20 +0100 Subject: [PATCH 014/136] Require more updated doctrine packages --- composer.json | 14 ++++++++------ composer.lock | 16 ++++++++-------- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/composer.json b/composer.json index ee32d79b2f..c74e9cff64 100644 --- a/composer.json +++ b/composer.json @@ -18,12 +18,14 @@ "require": { "php": "^7.1", "ext-pdo": "*", - "doctrine/annotations": "~1.5", - "doctrine/cache": "~1.6", - "doctrine/collections": "^1.4", - "doctrine/common": "^2.7.1", - "doctrine/dbal": "^2.6", - "doctrine/instantiator": "~1.1", + "doctrine/annotations": "^1.8", + "doctrine/cache": "^1.9.1", + "doctrine/collections": "^1.5", + "doctrine/common": "^2.11", + "doctrine/dbal": "^2.9.3", + "doctrine/event-manager": "^1.1", + "doctrine/instantiator": "^1.3", + "doctrine/persistence": "^1.2", "symfony/console": "^3.0|^4.0|^5.0" }, "require-dev": { diff --git a/composer.lock b/composer.lock index 1641a17b14..cb5af059e5 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": "084cd36de51fd4aa52c912b3e9c7c799", + "content-hash": "6ee82c5580988d68204af241576da60f", "packages": [ { "name": "doctrine/annotations", @@ -76,16 +76,16 @@ }, { "name": "doctrine/cache", - "version": "1.9.0", + "version": "1.9.1", "source": { "type": "git", "url": "https://github.com/doctrine/cache.git", - "reference": "c15dcd24b756f9e52ea7c3ae8227354f3628f11a" + "reference": "89a5c76c39c292f7798f964ab3c836c3f8192a55" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/cache/zipball/c15dcd24b756f9e52ea7c3ae8227354f3628f11a", - "reference": "c15dcd24b756f9e52ea7c3ae8227354f3628f11a", + "url": "https://api.github.com/repos/doctrine/cache/zipball/89a5c76c39c292f7798f964ab3c836c3f8192a55", + "reference": "89a5c76c39c292f7798f964ab3c836c3f8192a55", "shasum": "" }, "require": { @@ -155,7 +155,7 @@ "riak", "xcache" ], - "time": "2019-11-11T10:31:52+00:00" + "time": "2019-11-15T14:31:57+00:00" }, { "name": "doctrine/collections", @@ -2673,8 +2673,8 @@ "authors": [ { "name": "Arne Blankerts", - "role": "Developer", - "email": "arne@blankerts.de" + "email": "arne@blankerts.de", + "role": "Developer" } ], "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", From 634719088638902adf0710faf46ce3c33cf020b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20ALFAIATE?= Date: Thu, 10 Oct 2019 17:45:26 +0700 Subject: [PATCH 015/136] Skip limit subquery if not required --- .../ORM/Tools/Pagination/Paginator.php | 2 +- .../ORM/Functional/Ticket/DDC1685Test.php | 1 + .../ORM/Functional/Ticket/GH7829Test.php | 63 +++++++++++++++++++ .../ORM/Tools/Pagination/PaginatorTest.php | 2 + 4 files changed, 67 insertions(+), 1 deletion(-) create mode 100644 tests/Doctrine/Tests/ORM/Functional/Ticket/GH7829Test.php diff --git a/lib/Doctrine/ORM/Tools/Pagination/Paginator.php b/lib/Doctrine/ORM/Tools/Pagination/Paginator.php index 08c924bc59..64cd9e243f 100644 --- a/lib/Doctrine/ORM/Tools/Pagination/Paginator.php +++ b/lib/Doctrine/ORM/Tools/Pagination/Paginator.php @@ -139,7 +139,7 @@ public function getIterator() $offset = $this->query->getFirstResult(); $length = $this->query->getMaxResults(); - if ($this->fetchJoinCollection) { + if ($this->fetchJoinCollection && $length !== null) { $subQuery = $this->cloneQuery($this->query); if ($this->useOutputWalker($subQuery)) { diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1685Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1685Test.php index 576b4e2862..b2cbf513ab 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1685Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1685Test.php @@ -29,6 +29,7 @@ protected function setUp() $dql = "SELECT ad FROM Doctrine\Tests\Models\DDC117\DDC117ArticleDetails ad"; $query = $this->_em->createQuery($dql); + $query->setMaxResults(1); $this->paginator = new Paginator($query); } diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/GH7829Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/GH7829Test.php new file mode 100644 index 0000000000..08f91d2a8e --- /dev/null +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/GH7829Test.php @@ -0,0 +1,63 @@ +useModelSet('cms'); + parent::setUp(); + + $article = new CmsArticle(); + + $article->topic = 'Skip Limit Subquery'; + $article->text = 'Skip Limit Subquery if not required.'; + + $this->_em->persist($article); + $this->_em->flush(); + $this->_em->clear(); + + $this->_em->getConnection()->getConfiguration()->setSQLLogger($this->logger = new DebugStack()); + } + + public function testPaginatorWithLimitSubquery() : void + { + $query = $this->_em->createQuery('SELECT a FROM Doctrine\Tests\Models\CMS\CmsArticle a'); + $query->setMaxResults(1); + + $paginator = new Paginator($query, true); + $paginator->setUseOutputWalkers(false); + + $paginator->count(); + $paginator->getIterator(); + + $this->assertCount(3, $this->logger->queries); + } + + public function testPaginatorWithLimitSubquerySkipped() : void + { + $query = $this->_em->createQuery('SELECT a FROM Doctrine\Tests\Models\CMS\CmsArticle a'); + + $paginator = new Paginator($query, true); + $paginator->setUseOutputWalkers(false); + + $paginator->count(); + $paginator->getIterator(); + + $this->assertCount(2, $this->logger->queries); + } +} diff --git a/tests/Doctrine/Tests/ORM/Tools/Pagination/PaginatorTest.php b/tests/Doctrine/Tests/ORM/Tools/Pagination/PaginatorTest.php index 4b4fc5202b..20b2abdda1 100644 --- a/tests/Doctrine/Tests/ORM/Tools/Pagination/PaginatorTest.php +++ b/tests/Doctrine/Tests/ORM/Tools/Pagination/PaginatorTest.php @@ -61,6 +61,7 @@ public function testExtraParametersAreStrippedWhenWalkerRemovingOriginalSelectEl WHERE u.id = :paramInWhere' ); $query->setParameters(['paramInWhere' => $paramInWhere, 'paramInSubSelect' => $paramInSubSelect]); + $query->setMaxResults(1); $paginator = (new Paginator($query, true))->setUseOutputWalkers(false); $this->connection->expects($this->exactly(3))->method('executeQuery'); @@ -113,6 +114,7 @@ private function createPaginatorWithExtraParametersWithoutOutputWalkers(array $w $query = new Query($this->em); $query->setDQL('SELECT u FROM Doctrine\\Tests\\Models\\CMS\\CmsUser u'); $query->setParameters(['paramInWhere' => 1]); + $query->setMaxResults(1); return (new Paginator($query, true))->setUseOutputWalkers(false); } From 797bfc53c4a364c45402844713a0122f3c2db417 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lu=C3=ADs=20Cobucci?= Date: Sat, 16 Nov 2019 01:32:15 +0100 Subject: [PATCH 016/136] Fix deprecation messages version --- UPGRADE.md | 2 +- lib/Doctrine/ORM/Configuration.php | 6 +++--- lib/Doctrine/ORM/EntityManager.php | 4 ++-- lib/Doctrine/ORM/EntityManagerInterface.php | 2 +- lib/Doctrine/ORM/Mapping/Driver/YamlDriver.php | 2 +- lib/Doctrine/ORM/Proxy/Proxy.php | 2 +- lib/Doctrine/ORM/Proxy/ProxyFactory.php | 2 +- .../Tools/Console/Command/ConvertDoctrine1SchemaCommand.php | 2 +- .../ORM/Tools/Console/Command/GenerateEntitiesCommand.php | 2 +- .../Tools/Console/Command/GenerateRepositoriesCommand.php | 2 +- lib/Doctrine/ORM/Tools/EntityGenerator.php | 2 +- lib/Doctrine/ORM/Tools/EntityRepositoryGenerator.php | 2 +- lib/Doctrine/ORM/Tools/Export/ClassMetadataExporter.php | 2 +- lib/Doctrine/ORM/Tools/Export/Driver/AbstractExporter.php | 2 +- lib/Doctrine/ORM/Tools/Export/Driver/AnnotationExporter.php | 2 +- lib/Doctrine/ORM/Tools/Export/Driver/PhpExporter.php | 2 +- lib/Doctrine/ORM/Tools/Export/Driver/XmlExporter.php | 2 +- lib/Doctrine/ORM/Tools/Export/Driver/YamlExporter.php | 2 +- lib/Doctrine/ORM/Tools/Export/ExportException.php | 2 +- lib/Doctrine/ORM/UnitOfWork.php | 4 ++-- lib/Doctrine/ORM/Version.php | 2 +- 21 files changed, 25 insertions(+), 25 deletions(-) diff --git a/UPGRADE.md b/UPGRADE.md index 9a54315bba..eb068cd39e 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -36,7 +36,7 @@ These methods have been deprecated: The `Doctrine\ORM\Version` class is now deprecated and will be removed in Doctrine 3.0: please refrain from checking the ORM version at runtime or use -[Ocramius/PackageVersions](https://github.com/Ocramius/PackageVersions/). +[ocramius/package-versions](https://github.com/Ocramius/PackageVersions/). ## Deprecated `EntityManager#merge()` and `EntityManager#detach()` methods diff --git a/lib/Doctrine/ORM/Configuration.php b/lib/Doctrine/ORM/Configuration.php index f4ba5df066..c036d67fa5 100644 --- a/lib/Doctrine/ORM/Configuration.php +++ b/lib/Doctrine/ORM/Configuration.php @@ -71,7 +71,7 @@ public function setProxyDir($dir) * * @return string|null * - * @deprecated 3.0 We're switch to `ocramius/proxy-manager` and this method isn't applicable any longer + * @deprecated 2.7 We're switch to `ocramius/proxy-manager` and this method isn't applicable any longer * @see https://github.com/Ocramius/ProxyManager */ public function getProxyDir() @@ -86,7 +86,7 @@ public function getProxyDir() * * @return int Possible values are constants of Doctrine\Common\Proxy\AbstractProxyFactory. * - * @deprecated 3.0 We're switch to `ocramius/proxy-manager` and this method isn't applicable any longer + * @deprecated 2.7 We're switch to `ocramius/proxy-manager` and this method isn't applicable any longer * @see https://github.com/Ocramius/ProxyManager */ public function getAutoGenerateProxyClasses() @@ -114,7 +114,7 @@ public function setAutoGenerateProxyClasses($autoGenerate) * * @return string|null * - * @deprecated 3.0 We're switch to `ocramius/proxy-manager` and this method isn't applicable any longer + * @deprecated 2.7 We're switch to `ocramius/proxy-manager` and this method isn't applicable any longer * @see https://github.com/Ocramius/ProxyManager */ public function getProxyNamespace() diff --git a/lib/Doctrine/ORM/EntityManager.php b/lib/Doctrine/ORM/EntityManager.php index f003c08981..a90dd9e6a9 100644 --- a/lib/Doctrine/ORM/EntityManager.php +++ b/lib/Doctrine/ORM/EntityManager.php @@ -658,7 +658,7 @@ public function refresh($entity) * * @throws ORMInvalidArgumentException * - * @deprecated 3.0 This method is being removed from the ORM and won't have any replacement + * @deprecated 2.7 This method is being removed from the ORM and won't have any replacement */ public function detach($entity) { @@ -683,7 +683,7 @@ public function detach($entity) * @throws ORMInvalidArgumentException * @throws ORMException * - * @deprecated 3.0 This method is being removed from the ORM and won't have any replacement + * @deprecated 2.7 This method is being removed from the ORM and won't have any replacement */ public function merge($entity) { diff --git a/lib/Doctrine/ORM/EntityManagerInterface.php b/lib/Doctrine/ORM/EntityManagerInterface.php index 16b7068b93..c96aa6720f 100644 --- a/lib/Doctrine/ORM/EntityManagerInterface.php +++ b/lib/Doctrine/ORM/EntityManagerInterface.php @@ -190,7 +190,7 @@ public function close(); /** * Creates a copy of the given entity. Can create a shallow or a deep copy. * - * @deprecated 3.0 This method is being removed from the ORM and won't have any replacement + * @deprecated 2.7 This method is being removed from the ORM and won't have any replacement * * @param object $entity The entity to copy. * @param boolean $deep FALSE for a shallow copy, TRUE for a deep copy. diff --git a/lib/Doctrine/ORM/Mapping/Driver/YamlDriver.php b/lib/Doctrine/ORM/Mapping/Driver/YamlDriver.php index aa99f4bfee..723c7b15c1 100644 --- a/lib/Doctrine/ORM/Mapping/Driver/YamlDriver.php +++ b/lib/Doctrine/ORM/Mapping/Driver/YamlDriver.php @@ -36,7 +36,7 @@ * @author Jonathan H. Wage * @author Roman Borschel * - * @deprecated 3.0 This class is being removed from the ORM and won't have any replacement + * @deprecated 2.7 This class is being removed from the ORM and won't have any replacement */ class YamlDriver extends FileDriver { diff --git a/lib/Doctrine/ORM/Proxy/Proxy.php b/lib/Doctrine/ORM/Proxy/Proxy.php index 72463d121e..75a61a7560 100644 --- a/lib/Doctrine/ORM/Proxy/Proxy.php +++ b/lib/Doctrine/ORM/Proxy/Proxy.php @@ -27,7 +27,7 @@ * @author Roman Borschel * @since 2.0 * - * @deprecated 3.0 This interface is being removed from the ORM and won't have any replacement, proxies will no longer implement it. + * @deprecated 2.7 This interface is being removed from the ORM and won't have any replacement, proxies will no longer implement it. */ interface Proxy extends BaseProxy { diff --git a/lib/Doctrine/ORM/Proxy/ProxyFactory.php b/lib/Doctrine/ORM/Proxy/ProxyFactory.php index 7648a14a5f..31fac18a20 100644 --- a/lib/Doctrine/ORM/Proxy/ProxyFactory.php +++ b/lib/Doctrine/ORM/Proxy/ProxyFactory.php @@ -38,7 +38,7 @@ * @author Marco Pivetta * @since 2.0 * - * @deprecated 3.0 This class is being removed from the ORM and won't have any replacement + * @deprecated 2.7 This class is being removed from the ORM and won't have any replacement */ class ProxyFactory extends AbstractProxyFactory { diff --git a/lib/Doctrine/ORM/Tools/Console/Command/ConvertDoctrine1SchemaCommand.php b/lib/Doctrine/ORM/Tools/Console/Command/ConvertDoctrine1SchemaCommand.php index 1fac2497be..4f316aca43 100644 --- a/lib/Doctrine/ORM/Tools/Console/Command/ConvertDoctrine1SchemaCommand.php +++ b/lib/Doctrine/ORM/Tools/Console/Command/ConvertDoctrine1SchemaCommand.php @@ -39,7 +39,7 @@ * @author Jonathan Wage * @author Roman Borschel * - * @deprecated 3.0 This class is being removed from the ORM and won't have any replacement + * @deprecated 2.7 This class is being removed from the ORM and won't have any replacement */ class ConvertDoctrine1SchemaCommand extends Command { diff --git a/lib/Doctrine/ORM/Tools/Console/Command/GenerateEntitiesCommand.php b/lib/Doctrine/ORM/Tools/Console/Command/GenerateEntitiesCommand.php index 3aff45b7c7..0d3a8daadc 100644 --- a/lib/Doctrine/ORM/Tools/Console/Command/GenerateEntitiesCommand.php +++ b/lib/Doctrine/ORM/Tools/Console/Command/GenerateEntitiesCommand.php @@ -39,7 +39,7 @@ * @author Jonathan Wage * @author Roman Borschel * - * @deprecated 3.0 This class is being removed from the ORM and won't have any replacement + * @deprecated 2.7 This class is being removed from the ORM and won't have any replacement */ class GenerateEntitiesCommand extends Command { diff --git a/lib/Doctrine/ORM/Tools/Console/Command/GenerateRepositoriesCommand.php b/lib/Doctrine/ORM/Tools/Console/Command/GenerateRepositoriesCommand.php index c09f10fdf2..82b7da6b46 100644 --- a/lib/Doctrine/ORM/Tools/Console/Command/GenerateRepositoriesCommand.php +++ b/lib/Doctrine/ORM/Tools/Console/Command/GenerateRepositoriesCommand.php @@ -38,7 +38,7 @@ * @author Jonathan Wage * @author Roman Borschel * - * @deprecated 3.0 This class is being removed from the ORM and won't have any replacement + * @deprecated 2.7 This class is being removed from the ORM and won't have any replacement */ class GenerateRepositoriesCommand extends Command { diff --git a/lib/Doctrine/ORM/Tools/EntityGenerator.php b/lib/Doctrine/ORM/Tools/EntityGenerator.php index 5143f637a8..0accfaeaec 100644 --- a/lib/Doctrine/ORM/Tools/EntityGenerator.php +++ b/lib/Doctrine/ORM/Tools/EntityGenerator.php @@ -47,7 +47,7 @@ * @author Jonathan Wage * @author Roman Borschel * - * @deprecated 3.0 This class is being removed from the ORM and won't have any replacement + * @deprecated 2.7 This class is being removed from the ORM and won't have any replacement */ class EntityGenerator { diff --git a/lib/Doctrine/ORM/Tools/EntityRepositoryGenerator.php b/lib/Doctrine/ORM/Tools/EntityRepositoryGenerator.php index 7dffe97eaa..07c7aaca0c 100644 --- a/lib/Doctrine/ORM/Tools/EntityRepositoryGenerator.php +++ b/lib/Doctrine/ORM/Tools/EntityRepositoryGenerator.php @@ -33,7 +33,7 @@ * @author Jonathan Wage * @author Roman Borschel * - * @deprecated 3.0 This class is being removed from the ORM and won't have any replacement + * @deprecated 2.7 This class is being removed from the ORM and won't have any replacement */ class EntityRepositoryGenerator { diff --git a/lib/Doctrine/ORM/Tools/Export/ClassMetadataExporter.php b/lib/Doctrine/ORM/Tools/Export/ClassMetadataExporter.php index fcb11cc2d9..bf0bbada76 100644 --- a/lib/Doctrine/ORM/Tools/Export/ClassMetadataExporter.php +++ b/lib/Doctrine/ORM/Tools/Export/ClassMetadataExporter.php @@ -29,7 +29,7 @@ * @since 2.0 * @author Jonathan Wage * - * @deprecated 3.0 This class is being removed from the ORM and won't have any replacement + * @deprecated 2.7 This class is being removed from the ORM and won't have any replacement */ class ClassMetadataExporter { diff --git a/lib/Doctrine/ORM/Tools/Export/Driver/AbstractExporter.php b/lib/Doctrine/ORM/Tools/Export/Driver/AbstractExporter.php index 96cb88b36c..02cef5238b 100644 --- a/lib/Doctrine/ORM/Tools/Export/Driver/AbstractExporter.php +++ b/lib/Doctrine/ORM/Tools/Export/Driver/AbstractExporter.php @@ -31,7 +31,7 @@ * @since 2.0 * @author Jonathan Wage * - * @deprecated 3.0 This class is being removed from the ORM and won't have any replacement + * @deprecated 2.7 This class is being removed from the ORM and won't have any replacement */ abstract class AbstractExporter { diff --git a/lib/Doctrine/ORM/Tools/Export/Driver/AnnotationExporter.php b/lib/Doctrine/ORM/Tools/Export/Driver/AnnotationExporter.php index 2e7e4cbfd1..29cb8df363 100644 --- a/lib/Doctrine/ORM/Tools/Export/Driver/AnnotationExporter.php +++ b/lib/Doctrine/ORM/Tools/Export/Driver/AnnotationExporter.php @@ -29,7 +29,7 @@ * @since 2.0 * @author Jonathan Wage * - * @deprecated 3.0 This class is being removed from the ORM and won't have any replacement + * @deprecated 2.7 This class is being removed from the ORM and won't have any replacement */ class AnnotationExporter extends AbstractExporter { diff --git a/lib/Doctrine/ORM/Tools/Export/Driver/PhpExporter.php b/lib/Doctrine/ORM/Tools/Export/Driver/PhpExporter.php index 3e92dfe577..c0cd1767bc 100644 --- a/lib/Doctrine/ORM/Tools/Export/Driver/PhpExporter.php +++ b/lib/Doctrine/ORM/Tools/Export/Driver/PhpExporter.php @@ -28,7 +28,7 @@ * @since 2.0 * @author Jonathan Wage * - * @deprecated 3.0 This class is being removed from the ORM and won't have any replacement + * @deprecated 2.7 This class is being removed from the ORM and won't have any replacement */ class PhpExporter extends AbstractExporter { diff --git a/lib/Doctrine/ORM/Tools/Export/Driver/XmlExporter.php b/lib/Doctrine/ORM/Tools/Export/Driver/XmlExporter.php index 7ea41f0da4..6503649379 100644 --- a/lib/Doctrine/ORM/Tools/Export/Driver/XmlExporter.php +++ b/lib/Doctrine/ORM/Tools/Export/Driver/XmlExporter.php @@ -29,7 +29,7 @@ * @since 2.0 * @author Jonathan Wage * - * @deprecated 3.0 This class is being removed from the ORM and won't have any replacement + * @deprecated 2.7 This class is being removed from the ORM and won't have any replacement */ class XmlExporter extends AbstractExporter { diff --git a/lib/Doctrine/ORM/Tools/Export/Driver/YamlExporter.php b/lib/Doctrine/ORM/Tools/Export/Driver/YamlExporter.php index 7043e0a371..1fb960b333 100644 --- a/lib/Doctrine/ORM/Tools/Export/Driver/YamlExporter.php +++ b/lib/Doctrine/ORM/Tools/Export/Driver/YamlExporter.php @@ -29,7 +29,7 @@ * @since 2.0 * @author Jonathan Wage * - * @deprecated 3.0 This class is being removed from the ORM and won't have any replacement + * @deprecated 2.7 This class is being removed from the ORM and won't have any replacement */ class YamlExporter extends AbstractExporter { diff --git a/lib/Doctrine/ORM/Tools/Export/ExportException.php b/lib/Doctrine/ORM/Tools/Export/ExportException.php index c9689d0a51..725ea2137c 100644 --- a/lib/Doctrine/ORM/Tools/Export/ExportException.php +++ b/lib/Doctrine/ORM/Tools/Export/ExportException.php @@ -22,7 +22,7 @@ use Doctrine\ORM\ORMException; /** - * @deprecated 3.0 This class is being removed from the ORM and won't have any replacement + * @deprecated 2.7 This class is being removed from the ORM and won't have any replacement */ class ExportException extends ORMException { diff --git a/lib/Doctrine/ORM/UnitOfWork.php b/lib/Doctrine/ORM/UnitOfWork.php index 7660dc1144..f7b32b3809 100644 --- a/lib/Doctrine/ORM/UnitOfWork.php +++ b/lib/Doctrine/ORM/UnitOfWork.php @@ -1878,7 +1878,7 @@ private function doRemove($entity, array &$visited) * @throws OptimisticLockException If the entity uses optimistic locking through a version * attribute and the version check against the managed copy fails. * - * @deprecated 3.0 This method is being removed from the ORM and won't have any replacement + * @deprecated 2.7 This method is being removed from the ORM and won't have any replacement */ public function merge($entity) { @@ -2069,7 +2069,7 @@ private function updateAssociationWithMergedEntity($entity, array $association, * * @return void * - * @deprecated 3.0 This method is being removed from the ORM and won't have any replacement + * @deprecated 2.7 This method is being removed from the ORM and won't have any replacement */ public function detach($entity) { diff --git a/lib/Doctrine/ORM/Version.php b/lib/Doctrine/ORM/Version.php index b0f070a4e2..9a91b42ac2 100644 --- a/lib/Doctrine/ORM/Version.php +++ b/lib/Doctrine/ORM/Version.php @@ -30,7 +30,7 @@ * @author Jonathan Wage * @author Roman Borschel * - * @deprecated 3.0 This class is being removed from the ORM and won't have any replacement + * @deprecated 2.7 This class is being removed from the ORM and won't have any replacement */ class Version { From 57496e32fdea4b8ca7ac951839a6cb0d7dcdb8ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lu=C3=ADs=20Cobucci?= Date: Sat, 16 Nov 2019 01:48:37 +0100 Subject: [PATCH 017/136] Add minor BC-break notes on output walkers in paginator As explained in https://github.com/doctrine/orm/pull/7863#issuecomment-554578313. --- UPGRADE.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/UPGRADE.md b/UPGRADE.md index eb068cd39e..85f55d2250 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -1,5 +1,10 @@ # Upgrade to 2.7 +## Minor BC BREAK: paginator output walkers aren't be called anymore on sub-queries for queries without max results + +To optimize DB interaction, `Doctrine\ORM\Tools\Pagination\Paginator` no longer fetches identifiers to be able to +perform the pagination with join collections when max results isn't set in the query. + ## Deprecated code generators and related console commands These console commands have been deprecated: From 7bcbad076dafd127cd4eb535234add0318c593f6 Mon Sep 17 00:00:00 2001 From: Illia Somov Date: Mon, 7 May 2018 01:12:24 +0300 Subject: [PATCH 018/136] Split and deprecate AbstractQuery#useResultCache() --- UPGRADE.md | 10 +++ lib/Doctrine/ORM/AbstractQuery.php | 42 +++++++-- .../Tests/ORM/Functional/ResultCacheTest.php | 85 +++++++++++++++++-- tests/Doctrine/Tests/ORM/Query/QueryTest.php | 10 +-- 4 files changed, 128 insertions(+), 19 deletions(-) diff --git a/UPGRADE.md b/UPGRADE.md index 85f55d2250..d6970a42af 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -1,10 +1,20 @@ # Upgrade to 2.7 +## Added `Doctrine\ORM\AbstractQuery#enableResultCache()` and `Doctrine\ORM\AbstractQuery#disableResultCache()` methods + +Method `Doctrine\ORM\AbstractQuery#useResultCache()` which could be used for both enabling and disabling the cache +(depending on passed flag) was split into two. + ## Minor BC BREAK: paginator output walkers aren't be called anymore on sub-queries for queries without max results To optimize DB interaction, `Doctrine\ORM\Tools\Pagination\Paginator` no longer fetches identifiers to be able to perform the pagination with join collections when max results isn't set in the query. +## Deprecated: `Doctrine\ORM\AbstractQuery#useResultCache()` + +Method `Doctrine\ORM\AbstractQuery#useResultCache()` is deprecated because it is split into `enableResultCache()` +and `disableResultCache()`. It will be removed in 3.0. + ## Deprecated code generators and related console commands These console commands have been deprecated: diff --git a/lib/Doctrine/ORM/AbstractQuery.php b/lib/Doctrine/ORM/AbstractQuery.php index 3ba49b0886..2240366867 100644 --- a/lib/Doctrine/ORM/AbstractQuery.php +++ b/lib/Doctrine/ORM/AbstractQuery.php @@ -583,21 +583,45 @@ public function getResultCacheDriver() * Set whether or not to cache the results of this query and if so, for * how long and which ID to use for the cache entry. * - * @param boolean $bool - * @param integer $lifetime - * @param string $resultCacheId + * @deprecated 2.7 Use {@see enableResultCache} and {@see disableResultCache} instead. + * + * @param bool $useCache + * @param int $lifetime + * @param string $resultCacheId * * @return static This query instance. */ - public function useResultCache($bool, $lifetime = null, $resultCacheId = null) + public function useResultCache($useCache, $lifetime = null, $resultCacheId = null) { - if ($bool) { - $this->setResultCacheLifetime($lifetime); - $this->setResultCacheId($resultCacheId); + return $useCache + ? $this->enableResultCache($lifetime, $resultCacheId) + : $this->disableResultCache(); + } - return $this; - } + /** + * Enables caching of the results of this query, for given or default amount of seconds + * and optionally specifies which ID to use for the cache entry. + * + * @param int|null $lifetime How long the cache entry is valid, in seconds. + * @param string|null $resultCacheId ID to use for the cache entry. + * + * @return static This query instance. + */ + public function enableResultCache(?int $lifetime = null, ?string $resultCacheId = null) : self + { + $this->setResultCacheLifetime($lifetime); + $this->setResultCacheId($resultCacheId); + return $this; + } + + /** + * Disables caching of the results of this query. + * + * @return static This query instance. + */ + public function disableResultCache() : self + { $this->_queryCacheProfile = null; return $this; diff --git a/tests/Doctrine/Tests/ORM/Functional/ResultCacheTest.php b/tests/Doctrine/Tests/ORM/Functional/ResultCacheTest.php index bfadf2c254..05c89b6025 100644 --- a/tests/Doctrine/Tests/ORM/Functional/ResultCacheTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/ResultCacheTest.php @@ -89,7 +89,7 @@ public function testSetResultCacheId() $this->assertTrue($cache->contains('testing_result_cache_id')); } - public function testUseResultCache() + public function testUseResultCacheTrue() { $cache = new ArrayCache(); $query = $this->_em->createQuery('select ux from Doctrine\Tests\Models\CMS\CmsUser ux'); @@ -104,6 +104,22 @@ public function testUseResultCache() $this->_em->getConfiguration()->setResultCacheImpl(new ArrayCache()); } + public function testUseResultCacheFalse() + { + $cache = new ArrayCache(); + $query = $this->_em->createQuery('select ux from Doctrine\Tests\Models\CMS\CmsUser ux'); + + $query->setResultCacheDriver($cache); + $query->setResultCacheId('testing_result_cache_id'); + $query->useResultCache(false); + $users = $query->getResult(); + + $this->assertFalse($cache->contains('testing_result_cache_id')); + + $this->_em->getConfiguration()->setResultCacheImpl(new ArrayCache()); + } + + /** * @group DDC-1026 */ @@ -133,6 +149,65 @@ public function testUseResultCacheParams() $this->assertEquals($sqlCount + 2, count($this->_sqlLoggerStack->queries), "The next two sql should have been cached, but were not."); } + public function testEnableResultCache() + { + $cache = new ArrayCache(); + $query = $this->_em->createQuery('select ux from Doctrine\Tests\Models\CMS\CmsUser ux'); + + $query->enableResultCache(); + $query->setResultCacheDriver($cache); + $query->setResultCacheId('testing_result_cache_id'); + $users = $query->getResult(); + + $this->assertTrue($cache->contains('testing_result_cache_id')); + + $this->_em->getConfiguration()->setResultCacheImpl(new ArrayCache()); + } + + /** + * @group DDC-1026 + */ + public function testEnableResultCacheParams() + { + $cache = new ArrayCache(); + $sqlCount = count($this->_sqlLoggerStack->queries); + $query = $this->_em->createQuery('select ux from Doctrine\Tests\Models\CMS\CmsUser ux WHERE ux.id = ?1'); + + $query->setParameter(1, 1); + $query->setResultCacheDriver($cache); + $query->enableResultCache(); + $query->getResult(); + + $query->setParameter(1, 2); + $query->getResult(); + + $this->assertCount($sqlCount + 2, $this->_sqlLoggerStack->queries, "Two non-cached queries."); + + $query->setParameter(1, 1); + $query->enableResultCache(); + $query->getResult(); + + $query->setParameter(1, 2); + $query->getResult(); + + $this->assertCount($sqlCount + 2, $this->_sqlLoggerStack->queries, "The next two sql should have been cached, but were not."); + } + + public function testDisableResultCache() + { + $cache = new ArrayCache(); + $query = $this->_em->createQuery('select ux from Doctrine\Tests\Models\CMS\CmsUser ux'); + + $query->setResultCacheDriver($cache); + $query->setResultCacheId('testing_result_cache_id'); + $query->disableResultCache(); + $users = $query->getResult(); + + $this->assertFalse($cache->contains('testing_result_cache_id')); + + $this->_em->getConfiguration()->setResultCacheImpl(new ArrayCache()); + } + public function testNativeQueryResultCaching() { $cache = new ArrayCache(); @@ -143,7 +218,7 @@ public function testNativeQueryResultCaching() $query = $this->_em->createNativeQuery('select u.id FROM cms_users u WHERE u.id = ?', $rsm); $query->setParameter(1, 10); - $query->setResultCacheDriver($cache)->useResultCache(true); + $query->setResultCacheDriver($cache)->enableResultCache(); $this->assertEquals(0, $this->getCacheSize($cache)); @@ -229,7 +304,7 @@ public function testResultCacheWithObjectParameter() $cache = new ArrayCache(); - $query->setResultCacheDriver($cache)->useResultCache(true); + $query->setResultCacheDriver($cache)->enableResultCache(); $articles = $query->getResult(); @@ -241,7 +316,7 @@ public function testResultCacheWithObjectParameter() $query2 = $this->_em->createQuery('select a from Doctrine\Tests\Models\CMS\CmsArticle a WHERE a.user = ?1'); $query2->setParameter(1, $user1); - $query2->setResultCacheDriver($cache)->useResultCache(true); + $query2->setResultCacheDriver($cache)->enableResultCache(); $articles = $query2->getResult(); @@ -251,7 +326,7 @@ public function testResultCacheWithObjectParameter() $query3 = $this->_em->createQuery('select a from Doctrine\Tests\Models\CMS\CmsArticle a WHERE a.user = ?1'); $query3->setParameter(1, $user2); - $query3->setResultCacheDriver($cache)->useResultCache(true); + $query3->setResultCacheDriver($cache)->enableResultCache(); $articles = $query3->getResult(); diff --git a/tests/Doctrine/Tests/ORM/Query/QueryTest.php b/tests/Doctrine/Tests/ORM/Query/QueryTest.php index 0045647a09..71422e641a 100644 --- a/tests/Doctrine/Tests/ORM/Query/QueryTest.php +++ b/tests/Doctrine/Tests/ORM/Query/QueryTest.php @@ -128,7 +128,7 @@ public function testQueryDefaultResultCache() { $this->_em->getConfiguration()->setResultCacheImpl(new ArrayCache()); $q = $this->_em->createQuery("select a from Doctrine\Tests\Models\CMS\CmsArticle a"); - $q->useResultCache(true); + $q->enableResultCache(); $this->assertSame($this->_em->getConfiguration()->getResultCacheImpl(), $q->getQueryCacheProfile()->getResultCacheDriver()); } @@ -245,7 +245,7 @@ public function testResultCacheCaching() $driverConnectionMock->setStatementMock($stmt); $res = $this->_em->createQuery("select u from Doctrine\Tests\Models\CMS\CmsUser u") ->useQueryCache(true) - ->useResultCache(true, 60) + ->enableResultCache(60) //let it cache ->getResult(); @@ -255,7 +255,7 @@ public function testResultCacheCaching() $res = $this->_em->createQuery("select u from Doctrine\Tests\Models\CMS\CmsUser u") ->useQueryCache(true) - ->useResultCache(false) + ->disableResultCache() ->getResult(); $this->assertCount(0, $res); } @@ -278,7 +278,7 @@ public function testResultCacheEviction() $this->_em->getConfiguration()->setResultCacheImpl(new ArrayCache()); $query = $this->_em->createQuery("SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u") - ->useResultCache(true); + ->enableResultCache(); /** @var DriverConnectionMock $driverConnectionMock */ $driverConnectionMock = $this->_em->getConnection() @@ -397,7 +397,7 @@ public function testResultCacheProfileCanBeRemovedViaSetter() : void $this->_em->getConfiguration()->setResultCacheImpl(new ArrayCache()); $query = $this->_em->createQuery('SELECT u FROM ' . CmsUser::class . ' u'); - $query->useResultCache(true); + $query->enableResultCache(); $query->setResultCacheProfile(); self::assertAttributeSame(null, '_queryCacheProfile', $query); From e8f265d4806f2f05237a944f2f44bb7a9f6d0cc4 Mon Sep 17 00:00:00 2001 From: someniatko Date: Sat, 25 May 2019 20:15:48 +0300 Subject: [PATCH 019/136] Make ResultCacheTest tests slightly more logical --- .../Tests/ORM/Functional/ResultCacheTest.php | 53 ++++++++++++------- 1 file changed, 35 insertions(+), 18 deletions(-) diff --git a/tests/Doctrine/Tests/ORM/Functional/ResultCacheTest.php b/tests/Doctrine/Tests/ORM/Functional/ResultCacheTest.php index 05c89b6025..cffe07fe7d 100644 --- a/tests/Doctrine/Tests/ORM/Functional/ResultCacheTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/ResultCacheTest.php @@ -8,6 +8,7 @@ use Doctrine\Tests\Models\CMS\CmsArticle; use Doctrine\Common\Cache\ArrayCache; use Doctrine\Tests\OrmFunctionalTestCase; +use function count; /** * ResultCacheTest @@ -112,7 +113,7 @@ public function testUseResultCacheFalse() $query->setResultCacheDriver($cache); $query->setResultCacheId('testing_result_cache_id'); $query->useResultCache(false); - $users = $query->getResult(); + $query->getResult(); $this->assertFalse($cache->contains('testing_result_cache_id')); @@ -129,27 +130,35 @@ public function testUseResultCacheParams() $sqlCount = count($this->_sqlLoggerStack->queries); $query = $this->_em->createQuery('select ux from Doctrine\Tests\Models\CMS\CmsUser ux WHERE ux.id = ?1'); - $query->setParameter(1, 1); $query->setResultCacheDriver($cache); $query->useResultCache(true); - $query->getResult(); + // these queries should result in cache miss: + $query->setParameter(1, 1); + $query->getResult(); $query->setParameter(1, 2); $query->getResult(); - $this->assertEquals($sqlCount + 2, count($this->_sqlLoggerStack->queries), "Two non-cached queries."); + $this->assertCount( + $sqlCount + 2, + $this->_sqlLoggerStack->queries, + 'Two non-cached queries.' + ); + // these two queries should actually be cached, as they repeat previous ones: $query->setParameter(1, 1); - $query->useResultCache(true); $query->getResult(); - $query->setParameter(1, 2); $query->getResult(); - $this->assertEquals($sqlCount + 2, count($this->_sqlLoggerStack->queries), "The next two sql should have been cached, but were not."); + $this->assertCount( + $sqlCount + 2, + $this->_sqlLoggerStack->queries, + 'The next two sql queries should have been cached, but were not.' + ); } - public function testEnableResultCache() + public function testEnableResultCache() : void { $cache = new ArrayCache(); $query = $this->_em->createQuery('select ux from Doctrine\Tests\Models\CMS\CmsUser ux'); @@ -157,7 +166,7 @@ public function testEnableResultCache() $query->enableResultCache(); $query->setResultCacheDriver($cache); $query->setResultCacheId('testing_result_cache_id'); - $users = $query->getResult(); + $query->getResult(); $this->assertTrue($cache->contains('testing_result_cache_id')); @@ -167,33 +176,41 @@ public function testEnableResultCache() /** * @group DDC-1026 */ - public function testEnableResultCacheParams() + public function testEnableResultCacheParams() : void { $cache = new ArrayCache(); $sqlCount = count($this->_sqlLoggerStack->queries); $query = $this->_em->createQuery('select ux from Doctrine\Tests\Models\CMS\CmsUser ux WHERE ux.id = ?1'); - $query->setParameter(1, 1); $query->setResultCacheDriver($cache); $query->enableResultCache(); - $query->getResult(); + // these queries should result in cache miss: + $query->setParameter(1, 1); + $query->getResult(); $query->setParameter(1, 2); $query->getResult(); - $this->assertCount($sqlCount + 2, $this->_sqlLoggerStack->queries, "Two non-cached queries."); + $this->assertCount( + $sqlCount + 2, + $this->_sqlLoggerStack->queries, + 'Two non-cached queries.' + ); + // these two queries should actually be cached, as they repeat previous ones: $query->setParameter(1, 1); - $query->enableResultCache(); $query->getResult(); - $query->setParameter(1, 2); $query->getResult(); - $this->assertCount($sqlCount + 2, $this->_sqlLoggerStack->queries, "The next two sql should have been cached, but were not."); + $this->assertCount( + $sqlCount + 2, + $this->_sqlLoggerStack->queries, + 'The next two sql queries should have been cached, but were not.' + ); } - public function testDisableResultCache() + public function testDisableResultCache() : void { $cache = new ArrayCache(); $query = $this->_em->createQuery('select ux from Doctrine\Tests\Models\CMS\CmsUser ux'); @@ -201,7 +218,7 @@ public function testDisableResultCache() $query->setResultCacheDriver($cache); $query->setResultCacheId('testing_result_cache_id'); $query->disableResultCache(); - $users = $query->getResult(); + $query->getResult(); $this->assertFalse($cache->contains('testing_result_cache_id')); From 0c36f879353fe92f5b6e697e578a83ec4a465cdf Mon Sep 17 00:00:00 2001 From: rtek Date: Wed, 15 May 2019 19:07:11 -0400 Subject: [PATCH 020/136] Prettify arrays in orm:mapping:describe command This will prevent excessive column width and wrapping in the output which uses Symfony\Component\Console\Style\SymfonyStyle::table(). --- .../ORM/Tools/Console/Command/MappingDescribeCommand.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/Doctrine/ORM/Tools/Console/Command/MappingDescribeCommand.php b/lib/Doctrine/ORM/Tools/Console/Command/MappingDescribeCommand.php index 355246731f..0e1f505f03 100644 --- a/lib/Doctrine/ORM/Tools/Console/Command/MappingDescribeCommand.php +++ b/lib/Doctrine/ORM/Tools/Console/Command/MappingDescribeCommand.php @@ -26,6 +26,10 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Style\SymfonyStyle; +use const JSON_PRETTY_PRINT; +use const JSON_UNESCAPED_SLASHES; +use const JSON_UNESCAPED_UNICODE; +use function json_encode; /** * Show information about mapped entities. @@ -213,7 +217,7 @@ private function formatValue($value) } if (is_array($value)) { - return json_encode($value, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES); + return json_encode($value, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT); } if (is_object($value)) { From 33b8d020a7b8df1e5662510b31deadd8d49c58be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Paris?= Date: Sat, 16 Nov 2019 10:58:58 +0100 Subject: [PATCH 021/136] Synchronize lock file and json manifest --- composer.lock | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/composer.lock b/composer.lock index cb5af059e5..fc220d2356 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": "6ee82c5580988d68204af241576da60f", + "content-hash": "4e24e01f599825550170acce0dda0b49", "packages": [ { "name": "doctrine/annotations", @@ -2673,8 +2673,8 @@ "authors": [ { "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" + "role": "Developer", + "email": "arne@blankerts.de" } ], "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", @@ -2740,8 +2740,5 @@ "php": "^7.1", "ext-pdo": "*" }, - "platform-dev": [], - "platform-overrides": { - "php": "7.1" - } + "platform-dev": [] } From c79d2e0dc2d304679ea5b31a5989256b8e5684cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Paris?= Date: Sat, 16 Nov 2019 10:46:42 +0100 Subject: [PATCH 022/136] Make sure composer files are valid The composer.lock is put under version control and it often happens to be out of sync with the composer.json, which could lead to hard-to-understand issues. Using the --strict option here because we might as well aim for a perfectly valid composer.json --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index bd6037e90c..9a40fe7d22 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,7 +18,7 @@ before_install: - mv ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini{,.disabled} || echo "xdebug not available" - composer self-update -install: travis_retry composer update --prefer-dist +install: travis_retry composer validate --strict && composer update --prefer-dist script: - if [[ "$DB" == "mysql" || "$DB" == "mariadb" ]]; then mysql -e "CREATE SCHEMA doctrine_tests; GRANT ALL PRIVILEGES ON doctrine_tests.* to travis@'%'"; fi From 0264ba17596bdd5eb70efd3ff3a8dc7afb1d747c Mon Sep 17 00:00:00 2001 From: mairo744 Date: Mon, 4 Nov 2019 22:39:45 +0100 Subject: [PATCH 023/136] Fix creation of join table names with schemas in SQLite Join table name doesnt depending on the platform. Table name was "schema.table" instead of "schema__table". (cherry picked from commit 4878cd3f4ef30ffc6047c18e0f7b16aafeabc3b4) --- .../ORM/Mapping/DefaultQuoteStrategy.php | 3 +- .../ORM/Functional/Ticket/GH7079Test.php | 123 ++++++++++++++++++ 2 files changed, 125 insertions(+), 1 deletion(-) create mode 100644 tests/Doctrine/Tests/ORM/Functional/Ticket/GH7079Test.php diff --git a/lib/Doctrine/ORM/Mapping/DefaultQuoteStrategy.php b/lib/Doctrine/ORM/Mapping/DefaultQuoteStrategy.php index 6929edfe45..ade44a0624 100644 --- a/lib/Doctrine/ORM/Mapping/DefaultQuoteStrategy.php +++ b/lib/Doctrine/ORM/Mapping/DefaultQuoteStrategy.php @@ -99,7 +99,8 @@ public function getJoinTableName(array $association, ClassMetadata $class, Abstr $schema = ''; if (isset($association['joinTable']['schema'])) { - $schema = $association['joinTable']['schema'] . '.'; + $schema = $association['joinTable']['schema']; + $schema .= ! $platform->supportsSchemas() && $platform->canEmulateSchemas() ? '__' : '.'; } $tableName = $association['joinTable']['name']; diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/GH7079Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/GH7079Test.php new file mode 100644 index 0000000000..5df5dfcb06 --- /dev/null +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/GH7079Test.php @@ -0,0 +1,123 @@ +platform = $this->_em->getConnection()->getDatabasePlatform(); + $this->strategy = new DefaultQuoteStrategy(); + } + + public function testGetTableName() : void + { + $table = [ + 'name' => 'cms_user', + 'schema' => 'cms', + ]; + + $cm = $this->createClassMetadata(GH7079CmsUser::class); + $cm->setPrimaryTable($table); + + self::assertEquals($this->getTableFullName($table), $this->strategy->getTableName($cm, $this->platform)); + } + + public function testJoinTableName() : void + { + $table = [ + 'name' => 'cmsaddress_cmsuser', + 'schema' => 'cms', + ]; + + $cm = $this->createClassMetadata(GH7079CmsAddress::class); + $cm->mapManyToMany( + [ + 'fieldName' => 'user', + 'targetEntity' => 'DDC7079CmsUser', + 'inversedBy' => 'users', + 'joinTable' => $table, + ] + ); + + self::assertEquals( + $this->getTableFullName($table), + $this->strategy->getJoinTableName($cm->associationMappings['user'], $cm, $this->platform) + ); + } + + private function getTableFullName(array $table) : string + { + $join = '.'; + if (! $this->platform->supportsSchemas() && $this->platform->canEmulateSchemas()) { + $join = '__'; + } + + return $table['schema'] . $join . $table['name']; + } + + private function createClassMetadata(string $className) : ClassMetadata + { + $cm = new ClassMetadata($className); + $cm->initializeReflection(new RuntimeReflectionService()); + + return $cm; + } +} + +/** + * @Entity + * @Table(name="cms_users", schema="cms") + */ +class GH7079CmsUser +{ + /** + * @Id @Column(type="integer") + * @GeneratedValue + */ + public $id; + + /** @OneToOne(targetEntity=GH7079CmsAddress::class, mappedBy="user", cascade={"persist"}, orphanRemoval=true) */ + public $address; +} + +/** + * @Entity + * @Table(name="cms_addresses", schema="cms") + */ +class GH7079CmsAddress +{ + /** + * @Column(type="integer") + * @Id @GeneratedValue + */ + public $id; + + /** + * @OneToOne(targetEntity=GH7079CmsUser::class, inversedBy="address") + * @JoinColumn(referencedColumnName="id") + */ + public $user; +} From 9ccb8837e7f0bc605117024561c07e487a57eca0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lu=C3=ADs=20Cobucci?= Date: Tue, 19 Nov 2019 01:33:36 +0100 Subject: [PATCH 024/136] Add deprecation message for EM#clear($entityName) --- UPGRADE.md | 8 ++++++++ lib/Doctrine/ORM/EntityManager.php | 8 ++++++++ tests/Doctrine/Tests/ORM/EntityManagerTest.php | 9 +++++++++ 3 files changed, 25 insertions(+) diff --git a/UPGRADE.md b/UPGRADE.md index d6970a42af..f8ae5f0356 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -82,6 +82,14 @@ restful operations, you should look at alternatives such as [JMSSerializer](http Final keyword will be added to the `EntityManager::class` in Doctrine 3.0 in order to ensure that EntityManager is not used as valid extension point. Valid extension point should be EntityManagerInterface. +## Deprecated `EntityManager#clear($entityName)` + +If your code relies on clearing a single entity type via `EntityManager#clear($entityName)`, +the signature has been changed to `EntityManager#clear()`. + +The main reason is that partial clears caused multiple issues with data integrity +in the managed entity graph, which was constantly spawning more edge-case bugs/scenarios. + ## Deprecated `EntityManager#flush($entity)` and `EntityManager#flush($entities)` If your code relies on single entity flushing optimisations via diff --git a/lib/Doctrine/ORM/EntityManager.php b/lib/Doctrine/ORM/EntityManager.php index a90dd9e6a9..6f58295914 100644 --- a/lib/Doctrine/ORM/EntityManager.php +++ b/lib/Doctrine/ORM/EntityManager.php @@ -29,6 +29,7 @@ use Doctrine\ORM\Query\FilterCollection; use Doctrine\Common\Util\ClassUtils; use Throwable; +use const E_USER_DEPRECATED; use function trigger_error; /** @@ -555,6 +556,13 @@ public function clear($entityName = null) throw ORMInvalidArgumentException::invalidEntityName($entityName); } + if ($entityName !== null) { + @trigger_error( + 'Calling ' . __METHOD__ . '() with any arguments to clear specific entities is deprecated and will not be supported in Doctrine 3.0.', + E_USER_DEPRECATED + ); + } + $this->unitOfWork->clear( null === $entityName ? null diff --git a/tests/Doctrine/Tests/ORM/EntityManagerTest.php b/tests/Doctrine/Tests/ORM/EntityManagerTest.php index e2774cf2dd..8531018a1e 100644 --- a/tests/Doctrine/Tests/ORM/EntityManagerTest.php +++ b/tests/Doctrine/Tests/ORM/EntityManagerTest.php @@ -309,6 +309,15 @@ public function testClearManagerWithNullValue() $this->assertFalse($this->_em->contains($entity)); } + public function testDeprecatedClearWithArguments() : void + { + $entity = new Country(456, 'United Kingdom'); + $this->_em->persist($entity); + + $this->expectDeprecationMessage('Calling Doctrine\ORM\EntityManager::clear() with any arguments to clear specific entities is deprecated and will not be supported in Doctrine 3.0.'); + $this->_em->clear(Country::class); + } + public function testDeprecatedFlushWithArguments() : void { $entity = new Country(456, 'United Kingdom'); From 50992eafa2b1d78edf81991faac1427d91102632 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lu=C3=ADs=20Cobucci?= Date: Tue, 19 Nov 2019 02:11:56 +0100 Subject: [PATCH 025/136] Deprecated the usage of number unaware underscore naming strategy --- UPGRADE.md | 8 +++++++ .../ORM/Mapping/UnderscoreNamingStrategy.php | 9 ++++++++ .../Mapping/UnderscoreNamingStrategyTest.php | 22 +++++++++++++++++++ 3 files changed, 39 insertions(+) create mode 100644 tests/Doctrine/Tests/Mapping/UnderscoreNamingStrategyTest.php diff --git a/UPGRADE.md b/UPGRADE.md index f8ae5f0356..9794f96831 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -10,6 +10,14 @@ Method `Doctrine\ORM\AbstractQuery#useResultCache()` which could be used for bot To optimize DB interaction, `Doctrine\ORM\Tools\Pagination\Paginator` no longer fetches identifiers to be able to perform the pagination with join collections when max results isn't set in the query. +## Deprecated number unaware `Doctrine\ORM\Mapping\UnderscoreNamingStrategy` + +In the last patch of the `v2.6.x` series, we fixed a bug that was not converting names properly when they had numbers +(e.g.: `base64Encoded` was wrongly converted to `base64encoded` instead of `base64_encoded`). + +In order to not break BC we've introduced a way to enable the fixed behavior using a boolean constructor argument. This +argument will be removed in 3.0 and the default behavior will be the fixed one. + ## Deprecated: `Doctrine\ORM\AbstractQuery#useResultCache()` Method `Doctrine\ORM\AbstractQuery#useResultCache()` is deprecated because it is split into `enableResultCache()` diff --git a/lib/Doctrine/ORM/Mapping/UnderscoreNamingStrategy.php b/lib/Doctrine/ORM/Mapping/UnderscoreNamingStrategy.php index 1c219caa2c..f4b77b97fa 100644 --- a/lib/Doctrine/ORM/Mapping/UnderscoreNamingStrategy.php +++ b/lib/Doctrine/ORM/Mapping/UnderscoreNamingStrategy.php @@ -22,12 +22,14 @@ use const CASE_LOWER; use const CASE_UPPER; +use const E_USER_DEPRECATED; use function preg_replace; use function strpos; use function strrpos; use function strtolower; use function strtoupper; use function substr; +use function trigger_error; /** * Naming strategy implementing the underscore naming convention. @@ -58,6 +60,13 @@ class UnderscoreNamingStrategy implements NamingStrategy */ public function __construct($case = CASE_LOWER, bool $numberAware = false) { + if (! $numberAware) { + @trigger_error( + 'Creating ' . self::class . ' without making it number aware is deprecated and will be removed in Doctrine 3.0.', + E_USER_DEPRECATED + ); + } + $this->case = $case; $this->pattern = $numberAware ? self::NUMBER_AWARE_PATTERN : self::DEFAULT_PATTERN; } diff --git a/tests/Doctrine/Tests/Mapping/UnderscoreNamingStrategyTest.php b/tests/Doctrine/Tests/Mapping/UnderscoreNamingStrategyTest.php new file mode 100644 index 0000000000..5d7782c1a3 --- /dev/null +++ b/tests/Doctrine/Tests/Mapping/UnderscoreNamingStrategyTest.php @@ -0,0 +1,22 @@ +expectDeprecationMessage('Creating Doctrine\ORM\Mapping\UnderscoreNamingStrategy without making it number aware is deprecated and will be removed in Doctrine 3.0.'); + new UnderscoreNamingStrategy(CASE_LOWER, false); + } +} From 33143229294916858f05c1c1bd7f888cf515dacb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lu=C3=ADs=20Cobucci?= Date: Tue, 19 Nov 2019 08:44:32 +0100 Subject: [PATCH 026/136] Be explicit about which Doctrine package in message Avoiding possible confusion while reading the deprecation messages. --- UPGRADE.md | 6 +++--- lib/Doctrine/ORM/EntityManager.php | 10 +++++----- lib/Doctrine/ORM/Mapping/Driver/YamlDriver.php | 2 +- lib/Doctrine/ORM/Mapping/UnderscoreNamingStrategy.php | 2 +- .../Console/Command/ConvertDoctrine1SchemaCommand.php | 2 +- .../Tools/Console/Command/GenerateEntitiesCommand.php | 2 +- .../Console/Command/GenerateRepositoriesCommand.php | 2 +- lib/Doctrine/ORM/Tools/EntityGenerator.php | 3 ++- lib/Doctrine/ORM/Tools/EntityRepositoryGenerator.php | 3 ++- .../ORM/Tools/Export/ClassMetadataExporter.php | 3 ++- .../ORM/Tools/Export/Driver/AbstractExporter.php | 3 ++- .../Tests/Mapping/UnderscoreNamingStrategyTest.php | 2 +- tests/Doctrine/Tests/ORM/EntityManagerTest.php | 10 +++++----- .../Tests/ORM/Mapping/Symfony/YamlDriverTest.php | 2 +- .../Tests/ORM/Mapping/YamlMappingDriverTest.php | 2 +- .../Command/GenerateRepositoriesCommandTest.php | 2 +- 16 files changed, 30 insertions(+), 26 deletions(-) diff --git a/UPGRADE.md b/UPGRADE.md index 9794f96831..c6c6eaaa01 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -40,7 +40,7 @@ Whole Doctrine\ORM\Tools\Export namespace with all its members have been depreca ## Deprecated `Doctrine\ORM\Proxy\Proxy` marker interface -Proxy objects in Doctrine 3.0 will no longer implement `Doctrine\ORM\Proxy\Proxy` nor +Proxy objects in Doctrine ORM 3.0 will no longer implement `Doctrine\ORM\Proxy\Proxy` nor `Doctrine\Common\Persistence\Proxy`: instead, they implement `ProxyManager\Proxy\GhostObjectInterface`. @@ -57,7 +57,7 @@ These methods have been deprecated: ## Deprecated `Doctrine\ORM\Version` -The `Doctrine\ORM\Version` class is now deprecated and will be removed in Doctrine 3.0: +The `Doctrine\ORM\Version` class is now deprecated and will be removed in Doctrine ORM 3.0: please refrain from checking the ORM version at runtime or use [ocramius/package-versions](https://github.com/Ocramius/PackageVersions/). @@ -87,7 +87,7 @@ restful operations, you should look at alternatives such as [JMSSerializer](http ## Extending `EntityManager` is deprecated -Final keyword will be added to the `EntityManager::class` in Doctrine 3.0 in order to ensure that EntityManager +Final keyword will be added to the `EntityManager::class` in Doctrine ORM 3.0 in order to ensure that EntityManager is not used as valid extension point. Valid extension point should be EntityManagerInterface. ## Deprecated `EntityManager#clear($entityName)` diff --git a/lib/Doctrine/ORM/EntityManager.php b/lib/Doctrine/ORM/EntityManager.php index 6f58295914..0752f0e897 100644 --- a/lib/Doctrine/ORM/EntityManager.php +++ b/lib/Doctrine/ORM/EntityManager.php @@ -358,7 +358,7 @@ public function flush($entity = null) { if ($entity !== null) { @trigger_error( - 'Calling ' . __METHOD__ . '() with any arguments to flush specific entities is deprecated and will not be supported in Doctrine 3.0.', + 'Calling ' . __METHOD__ . '() with any arguments to flush specific entities is deprecated and will not be supported in Doctrine ORM 3.0.', E_USER_DEPRECATED ); } @@ -558,7 +558,7 @@ public function clear($entityName = null) if ($entityName !== null) { @trigger_error( - 'Calling ' . __METHOD__ . '() with any arguments to clear specific entities is deprecated and will not be supported in Doctrine 3.0.', + 'Calling ' . __METHOD__ . '() with any arguments to clear specific entities is deprecated and will not be supported in Doctrine ORM 3.0.', E_USER_DEPRECATED ); } @@ -670,7 +670,7 @@ public function refresh($entity) */ public function detach($entity) { - @trigger_error('Method ' . __METHOD__ . '() is deprecated and will be removed in Doctrine 3.0.', E_USER_DEPRECATED); + @trigger_error('Method ' . __METHOD__ . '() is deprecated and will be removed in Doctrine ORM 3.0.', E_USER_DEPRECATED); if ( ! is_object($entity)) { throw ORMInvalidArgumentException::invalidObject('EntityManager#detach()', $entity); @@ -695,7 +695,7 @@ public function detach($entity) */ public function merge($entity) { - @trigger_error('Method ' . __METHOD__ . '() is deprecated and will be removed in Doctrine 3.0.', E_USER_DEPRECATED); + @trigger_error('Method ' . __METHOD__ . '() is deprecated and will be removed in Doctrine ORM 3.0.', E_USER_DEPRECATED); if ( ! is_object($entity)) { throw ORMInvalidArgumentException::invalidObject('EntityManager#merge()', $entity); @@ -711,7 +711,7 @@ public function merge($entity) */ public function copy($entity, $deep = false) { - @trigger_error('Method ' . __METHOD__ . '() is deprecated and will be removed in Doctrine 3.0.', E_USER_DEPRECATED); + @trigger_error('Method ' . __METHOD__ . '() is deprecated and will be removed in Doctrine ORM 3.0.', E_USER_DEPRECATED); throw new \BadMethodCallException("Not implemented."); } diff --git a/lib/Doctrine/ORM/Mapping/Driver/YamlDriver.php b/lib/Doctrine/ORM/Mapping/Driver/YamlDriver.php index 723c7b15c1..05339ec4f6 100644 --- a/lib/Doctrine/ORM/Mapping/Driver/YamlDriver.php +++ b/lib/Doctrine/ORM/Mapping/Driver/YamlDriver.php @@ -48,7 +48,7 @@ class YamlDriver extends FileDriver public function __construct($locator, $fileExtension = self::DEFAULT_FILE_EXTENSION) { @trigger_error( - 'YAML mapping driver is deprecated and will be removed in Doctrine 3.0, please migrate to annotation or XML driver.', + 'YAML mapping driver is deprecated and will be removed in Doctrine ORM 3.0, please migrate to annotation or XML driver.', E_USER_DEPRECATED ); diff --git a/lib/Doctrine/ORM/Mapping/UnderscoreNamingStrategy.php b/lib/Doctrine/ORM/Mapping/UnderscoreNamingStrategy.php index f4b77b97fa..177b390f4f 100644 --- a/lib/Doctrine/ORM/Mapping/UnderscoreNamingStrategy.php +++ b/lib/Doctrine/ORM/Mapping/UnderscoreNamingStrategy.php @@ -62,7 +62,7 @@ public function __construct($case = CASE_LOWER, bool $numberAware = false) { if (! $numberAware) { @trigger_error( - 'Creating ' . self::class . ' without making it number aware is deprecated and will be removed in Doctrine 3.0.', + 'Creating ' . self::class . ' without making it number aware is deprecated and will be removed in Doctrine ORM 3.0.', E_USER_DEPRECATED ); } diff --git a/lib/Doctrine/ORM/Tools/Console/Command/ConvertDoctrine1SchemaCommand.php b/lib/Doctrine/ORM/Tools/Console/Command/ConvertDoctrine1SchemaCommand.php index 4f316aca43..90de7322ad 100644 --- a/lib/Doctrine/ORM/Tools/Console/Command/ConvertDoctrine1SchemaCommand.php +++ b/lib/Doctrine/ORM/Tools/Console/Command/ConvertDoctrine1SchemaCommand.php @@ -120,7 +120,7 @@ protected function configure() protected function execute(InputInterface $input, OutputInterface $output) { $ui = new SymfonyStyle($input, $output); - $ui->warning('Command ' . $this->getName() . ' is deprecated and will be removed in Doctrine 3.0.'); + $ui->warning('Command ' . $this->getName() . ' is deprecated and will be removed in Doctrine ORM 3.0.'); // Process source directories $fromPaths = array_merge([$input->getArgument('from-path')], $input->getOption('from')); diff --git a/lib/Doctrine/ORM/Tools/Console/Command/GenerateEntitiesCommand.php b/lib/Doctrine/ORM/Tools/Console/Command/GenerateEntitiesCommand.php index 0d3a8daadc..f1bba22d2c 100644 --- a/lib/Doctrine/ORM/Tools/Console/Command/GenerateEntitiesCommand.php +++ b/lib/Doctrine/ORM/Tools/Console/Command/GenerateEntitiesCommand.php @@ -89,7 +89,7 @@ class is supposed to extend which. You have to adjust the entity protected function execute(InputInterface $input, OutputInterface $output) { $ui = new SymfonyStyle($input, $output); - $ui->warning('Command ' . $this->getName() . ' is deprecated and will be removed in Doctrine 3.0.'); + $ui->warning('Command ' . $this->getName() . ' is deprecated and will be removed in Doctrine ORM 3.0.'); $em = $this->getHelper('em')->getEntityManager(); diff --git a/lib/Doctrine/ORM/Tools/Console/Command/GenerateRepositoriesCommand.php b/lib/Doctrine/ORM/Tools/Console/Command/GenerateRepositoriesCommand.php index 82b7da6b46..379c93597f 100644 --- a/lib/Doctrine/ORM/Tools/Console/Command/GenerateRepositoriesCommand.php +++ b/lib/Doctrine/ORM/Tools/Console/Command/GenerateRepositoriesCommand.php @@ -61,7 +61,7 @@ protected function configure() protected function execute(InputInterface $input, OutputInterface $output) { $ui = new SymfonyStyle($input, $output); - $ui->warning('Command ' . $this->getName() . ' is deprecated and will be removed in Doctrine 3.0.'); + $ui->warning('Command ' . $this->getName() . ' is deprecated and will be removed in Doctrine ORM 3.0.'); $em = $this->getHelper('em')->getEntityManager(); diff --git a/lib/Doctrine/ORM/Tools/EntityGenerator.php b/lib/Doctrine/ORM/Tools/EntityGenerator.php index 0accfaeaec..5c304dbcb1 100644 --- a/lib/Doctrine/ORM/Tools/EntityGenerator.php +++ b/lib/Doctrine/ORM/Tools/EntityGenerator.php @@ -23,6 +23,7 @@ use Doctrine\Common\Inflector\Inflector; use Doctrine\DBAL\Types\Type; use Doctrine\ORM\Mapping\ClassMetadataInfo; +use const E_USER_DEPRECATED; use function str_replace; use function trigger_error; @@ -338,7 +339,7 @@ public function __construct() */ public function __construct() { - @trigger_error(self::class . ' is deprecated and will be removed in Doctrine 3.0', E_USER_DEPRECATED); + @trigger_error(self::class . ' is deprecated and will be removed in Doctrine ORM 3.0', E_USER_DEPRECATED); if (version_compare(\Doctrine\Common\Version::VERSION, '2.2.0-DEV', '>=')) { $this->annotationsPrefix = 'ORM\\'; diff --git a/lib/Doctrine/ORM/Tools/EntityRepositoryGenerator.php b/lib/Doctrine/ORM/Tools/EntityRepositoryGenerator.php index 07c7aaca0c..9b3b290ac7 100644 --- a/lib/Doctrine/ORM/Tools/EntityRepositoryGenerator.php +++ b/lib/Doctrine/ORM/Tools/EntityRepositoryGenerator.php @@ -20,6 +20,7 @@ namespace Doctrine\ORM\Tools; use Doctrine\ORM\EntityRepository; +use const E_USER_DEPRECATED; use function trigger_error; /** @@ -57,7 +58,7 @@ class extends public function __construct() { - @trigger_error(self::class . ' is deprecated and will be removed in Doctrine 3.0', E_USER_DEPRECATED); + @trigger_error(self::class . ' is deprecated and will be removed in Doctrine ORM 3.0', E_USER_DEPRECATED); } /** diff --git a/lib/Doctrine/ORM/Tools/Export/ClassMetadataExporter.php b/lib/Doctrine/ORM/Tools/Export/ClassMetadataExporter.php index bf0bbada76..15c03b5c5a 100644 --- a/lib/Doctrine/ORM/Tools/Export/ClassMetadataExporter.php +++ b/lib/Doctrine/ORM/Tools/Export/ClassMetadataExporter.php @@ -19,6 +19,7 @@ namespace Doctrine\ORM\Tools\Export; +use const E_USER_DEPRECATED; use function trigger_error; /** @@ -46,7 +47,7 @@ class ClassMetadataExporter public function __construct() { - @trigger_error(self::class . ' is deprecated and will be removed in Doctrine 3.0', E_USER_DEPRECATED); + @trigger_error(self::class . ' is deprecated and will be removed in Doctrine ORM 3.0', E_USER_DEPRECATED); } /** diff --git a/lib/Doctrine/ORM/Tools/Export/Driver/AbstractExporter.php b/lib/Doctrine/ORM/Tools/Export/Driver/AbstractExporter.php index 02cef5238b..efe8e7bcdc 100644 --- a/lib/Doctrine/ORM/Tools/Export/Driver/AbstractExporter.php +++ b/lib/Doctrine/ORM/Tools/Export/Driver/AbstractExporter.php @@ -21,6 +21,7 @@ use Doctrine\ORM\Mapping\ClassMetadataInfo; use Doctrine\ORM\Tools\Export\ExportException; +use const E_USER_DEPRECATED; use function trigger_error; /** @@ -60,7 +61,7 @@ abstract class AbstractExporter */ public function __construct($dir = null) { - @trigger_error(static::class . ' is deprecated and will be removed in Doctrine 3.0', E_USER_DEPRECATED); + @trigger_error(static::class . ' is deprecated and will be removed in Doctrine ORM 3.0', E_USER_DEPRECATED); $this->_outputDir = $dir; } diff --git a/tests/Doctrine/Tests/Mapping/UnderscoreNamingStrategyTest.php b/tests/Doctrine/Tests/Mapping/UnderscoreNamingStrategyTest.php index 5d7782c1a3..589dc7fd7e 100644 --- a/tests/Doctrine/Tests/Mapping/UnderscoreNamingStrategyTest.php +++ b/tests/Doctrine/Tests/Mapping/UnderscoreNamingStrategyTest.php @@ -16,7 +16,7 @@ final class UnderscoreNamingStrategyTest extends TestCase /** @test */ public function checkDeprecationMessage() : void { - $this->expectDeprecationMessage('Creating Doctrine\ORM\Mapping\UnderscoreNamingStrategy without making it number aware is deprecated and will be removed in Doctrine 3.0.'); + $this->expectDeprecationMessage('Creating Doctrine\ORM\Mapping\UnderscoreNamingStrategy without making it number aware is deprecated and will be removed in Doctrine ORM 3.0.'); new UnderscoreNamingStrategy(CASE_LOWER, false); } } diff --git a/tests/Doctrine/Tests/ORM/EntityManagerTest.php b/tests/Doctrine/Tests/ORM/EntityManagerTest.php index 8531018a1e..3eaf47d9f5 100644 --- a/tests/Doctrine/Tests/ORM/EntityManagerTest.php +++ b/tests/Doctrine/Tests/ORM/EntityManagerTest.php @@ -314,7 +314,7 @@ public function testDeprecatedClearWithArguments() : void $entity = new Country(456, 'United Kingdom'); $this->_em->persist($entity); - $this->expectDeprecationMessage('Calling Doctrine\ORM\EntityManager::clear() with any arguments to clear specific entities is deprecated and will not be supported in Doctrine 3.0.'); + $this->expectDeprecationMessage('Calling Doctrine\ORM\EntityManager::clear() with any arguments to clear specific entities is deprecated and will not be supported in Doctrine ORM 3.0.'); $this->_em->clear(Country::class); } @@ -323,7 +323,7 @@ public function testDeprecatedFlushWithArguments() : void $entity = new Country(456, 'United Kingdom'); $this->_em->persist($entity); - $this->expectDeprecationMessage('Calling Doctrine\ORM\EntityManager::flush() with any arguments to flush specific entities is deprecated and will not be supported in Doctrine 3.0.'); + $this->expectDeprecationMessage('Calling Doctrine\ORM\EntityManager::flush() with any arguments to flush specific entities is deprecated and will not be supported in Doctrine ORM 3.0.'); $this->_em->flush($entity); } @@ -332,7 +332,7 @@ public function testDeprecatedMerge() : void $entity = new Country(456, 'United Kingdom'); $this->_em->persist($entity); - $this->expectDeprecationMessage('Method Doctrine\ORM\EntityManager::merge() is deprecated and will be removed in Doctrine 3.0.'); + $this->expectDeprecationMessage('Method Doctrine\ORM\EntityManager::merge() is deprecated and will be removed in Doctrine ORM 3.0.'); $this->_em->merge($entity); } @@ -341,7 +341,7 @@ public function testDeprecatedDetach() : void $entity = new Country(456, 'United Kingdom'); $this->_em->persist($entity); - $this->expectDeprecationMessage('Method Doctrine\ORM\EntityManager::detach() is deprecated and will be removed in Doctrine 3.0.'); + $this->expectDeprecationMessage('Method Doctrine\ORM\EntityManager::detach() is deprecated and will be removed in Doctrine ORM 3.0.'); $this->_em->detach($entity); } @@ -351,7 +351,7 @@ public function testDeprecatedCopy() : void $this->_em->persist($entity); try { - $this->expectDeprecationMessage('Method Doctrine\ORM\EntityManager::copy() is deprecated and will be removed in Doctrine 3.0.'); + $this->expectDeprecationMessage('Method Doctrine\ORM\EntityManager::copy() is deprecated and will be removed in Doctrine ORM 3.0.'); $this->_em->copy($entity); } catch (\BadMethodCallException $e) { // do nothing diff --git a/tests/Doctrine/Tests/ORM/Mapping/Symfony/YamlDriverTest.php b/tests/Doctrine/Tests/ORM/Mapping/Symfony/YamlDriverTest.php index d74677fc7d..f167132f6b 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/Symfony/YamlDriverTest.php +++ b/tests/Doctrine/Tests/ORM/Mapping/Symfony/YamlDriverTest.php @@ -20,7 +20,7 @@ protected function getFileExtension() protected function getDriver(array $paths = []) { $driver = new SimplifiedYamlDriver(array_flip($paths)); - $this->expectDeprecationMessage('YAML mapping driver is deprecated and will be removed in Doctrine 3.0, please migrate to annotation or XML driver.'); + $this->expectDeprecationMessage('YAML mapping driver is deprecated and will be removed in Doctrine ORM 3.0, please migrate to annotation or XML driver.'); return $driver; } diff --git a/tests/Doctrine/Tests/ORM/Mapping/YamlMappingDriverTest.php b/tests/Doctrine/Tests/ORM/Mapping/YamlMappingDriverTest.php index d34460d268..7781b1622f 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/YamlMappingDriverTest.php +++ b/tests/Doctrine/Tests/ORM/Mapping/YamlMappingDriverTest.php @@ -86,7 +86,7 @@ public function testSpacesShouldBeIgnoredWhenUseExplode() public function testDeprecation() : void { $this->createClassMetadata(DDC2069Entity::class); - $this->expectDeprecationMessage('YAML mapping driver is deprecated and will be removed in Doctrine 3.0, please migrate to annotation or XML driver.'); + $this->expectDeprecationMessage('YAML mapping driver is deprecated and will be removed in Doctrine ORM 3.0, please migrate to annotation or XML driver.'); } } diff --git a/tests/Doctrine/Tests/ORM/Tools/Console/Command/GenerateRepositoriesCommandTest.php b/tests/Doctrine/Tests/ORM/Tools/Console/Command/GenerateRepositoriesCommandTest.php index cd05da25ec..c155b9aa7e 100644 --- a/tests/Doctrine/Tests/ORM/Tools/Console/Command/GenerateRepositoriesCommandTest.php +++ b/tests/Doctrine/Tests/ORM/Tools/Console/Command/GenerateRepositoriesCommandTest.php @@ -172,7 +172,7 @@ public function testNoMetadataClassesToProcess() : void ] ); - self::assertContains('Command orm:generate-repositories is deprecated and will be removed in Doctrine 3.0.', $tester->getDisplay()); + self::assertContains('Command orm:generate-repositories is deprecated and will be removed in Doctrine ORM 3.0.', $tester->getDisplay()); self::assertContains('[OK] No Metadata Classes to process.', $tester->getDisplay()); } } From 4d763ca4c925f647b248b9fa01b5f47aa3685d62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lu=C3=ADs=20Cobucci?= Date: Tue, 19 Nov 2019 09:38:05 +0100 Subject: [PATCH 027/136] Bump up version --- lib/Doctrine/ORM/Version.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Doctrine/ORM/Version.php b/lib/Doctrine/ORM/Version.php index 9a91b42ac2..1af55173c7 100644 --- a/lib/Doctrine/ORM/Version.php +++ b/lib/Doctrine/ORM/Version.php @@ -37,7 +37,7 @@ class Version /** * Current Doctrine Version */ - const VERSION = '2.7.0-DEV'; + const VERSION = '2.7.0'; /** * Compares a Doctrine version with the current one. From a416a9a8b2cd2ea0f7b7b5638986e8b398f34df8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lu=C3=ADs=20Cobucci?= Date: Tue, 19 Nov 2019 09:43:57 +0100 Subject: [PATCH 028/136] Bump up version --- lib/Doctrine/ORM/Version.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Doctrine/ORM/Version.php b/lib/Doctrine/ORM/Version.php index 1af55173c7..aa286eba4d 100644 --- a/lib/Doctrine/ORM/Version.php +++ b/lib/Doctrine/ORM/Version.php @@ -37,7 +37,7 @@ class Version /** * Current Doctrine Version */ - const VERSION = '2.7.0'; + const VERSION = '2.7.1-DEV'; /** * Compares a Doctrine version with the current one. From 2d833a5e86ee275dae3b3d920a296e26492df8da Mon Sep 17 00:00:00 2001 From: Tomoka Baba Date: Thu, 14 Nov 2019 14:56:41 +0900 Subject: [PATCH 029/136] Fix boolean properties default value when generating entities. --- lib/Doctrine/ORM/Tools/EntityGenerator.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/Doctrine/ORM/Tools/EntityGenerator.php b/lib/Doctrine/ORM/Tools/EntityGenerator.php index 5c304dbcb1..1c200f0fc8 100644 --- a/lib/Doctrine/ORM/Tools/EntityGenerator.php +++ b/lib/Doctrine/ORM/Tools/EntityGenerator.php @@ -1328,9 +1328,17 @@ protected function generateEntityFieldMappingProperties(ClassMetadataInfo $metad continue; } + $defaultValue = ''; + if (isset($fieldMapping['options']['default'])) { + if ($fieldMapping['type'] === 'boolean' && $fieldMapping['options']['default'] === '1') { + $defaultValue = " = true"; + } else { + $defaultValue = ' = ' . var_export($fieldMapping['options']['default'], true); + } + } + $lines[] = $this->generateFieldMappingPropertyDocBlock($fieldMapping, $metadata); - $lines[] = $this->spaces . $this->fieldVisibility . ' $' . $fieldMapping['fieldName'] - . (isset($fieldMapping['options']['default']) ? ' = ' . var_export($fieldMapping['options']['default'], true) : null) . ";\n"; + $lines[] = $this->spaces . $this->fieldVisibility . ' $' . $fieldMapping['fieldName'] . $defaultValue . ";\n"; } return implode("\n", $lines); From 6fc9b3ab16061286c5aac70a58b52fb4f539cb8a Mon Sep 17 00:00:00 2001 From: Tomoka Baba Date: Sat, 16 Nov 2019 00:22:27 +0900 Subject: [PATCH 030/136] Fix to pass code quality check. --- lib/Doctrine/ORM/Tools/EntityGenerator.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/Doctrine/ORM/Tools/EntityGenerator.php b/lib/Doctrine/ORM/Tools/EntityGenerator.php index 1c200f0fc8..a6b0792f5c 100644 --- a/lib/Doctrine/ORM/Tools/EntityGenerator.php +++ b/lib/Doctrine/ORM/Tools/EntityGenerator.php @@ -26,6 +26,7 @@ use const E_USER_DEPRECATED; use function str_replace; use function trigger_error; +use function var_export; /** * Generic class used to generate PHP5 entity classes from ClassMetadataInfo instances. @@ -1331,7 +1332,7 @@ protected function generateEntityFieldMappingProperties(ClassMetadataInfo $metad $defaultValue = ''; if (isset($fieldMapping['options']['default'])) { if ($fieldMapping['type'] === 'boolean' && $fieldMapping['options']['default'] === '1') { - $defaultValue = " = true"; + $defaultValue = ' = true'; } else { $defaultValue = ' = ' . var_export($fieldMapping['options']['default'], true); } From 3db992e953b473a392e81ac1ef78ce286b9c2b6a Mon Sep 17 00:00:00 2001 From: Tomoka Baba Date: Sat, 16 Nov 2019 00:25:17 +0900 Subject: [PATCH 031/136] Add test code. --- .../Tests/ORM/Tools/EntityGeneratorTest.php | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tests/Doctrine/Tests/ORM/Tools/EntityGeneratorTest.php b/tests/Doctrine/Tests/ORM/Tools/EntityGeneratorTest.php index 2551869153..29f68397a8 100644 --- a/tests/Doctrine/Tests/ORM/Tools/EntityGeneratorTest.php +++ b/tests/Doctrine/Tests/ORM/Tools/EntityGeneratorTest.php @@ -327,6 +327,26 @@ public function testGeneratedEntityClass() $this->assertEquals($isbnMetadata->name, $reflParameters[0]->getClass()->name); } + public function testBooleanDefaultValue() + { + $metadata = $this->generateBookEntityFixture(['isbn' => $this->generateIsbnEmbeddableFixture()]); + + $metadata->mapField(['fieldName' => 'foo', 'type' => 'boolean', 'options' => ['default' => '1']]); + + $testEmbeddableMetadata = $this->generateTestEmbeddableFixture(); + $this->mapEmbedded('testEmbedded', $metadata, $testEmbeddableMetadata); + + $this->_generator->writeEntityClass($metadata, $this->_tmpDir); + + $this->assertFileExists($this->_tmpDir . '/' . $this->_namespace . '/EntityGeneratorBook.php~'); + + $book = $this->newInstance($metadata); + $reflClass = new \ReflectionClass($metadata->name); + + $this->assertNotSame($book->getfoo(), '1'); + $this->assertSame($book->getFoo(), true); + } + public function testEntityUpdatingWorks() { $metadata = $this->generateBookEntityFixture(['isbn' => $this->generateIsbnEmbeddableFixture()]); From 2c956d55f2a7ed527700041a729dca277caaaad9 Mon Sep 17 00:00:00 2001 From: Tomoka Baba Date: Wed, 20 Nov 2019 09:20:05 +0900 Subject: [PATCH 032/136] Fix to pass code quality check. --- tests/Doctrine/Tests/ORM/Tools/EntityGeneratorTest.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/Doctrine/Tests/ORM/Tools/EntityGeneratorTest.php b/tests/Doctrine/Tests/ORM/Tools/EntityGeneratorTest.php index 29f68397a8..a6fe9c4f39 100644 --- a/tests/Doctrine/Tests/ORM/Tools/EntityGeneratorTest.php +++ b/tests/Doctrine/Tests/ORM/Tools/EntityGeneratorTest.php @@ -13,6 +13,7 @@ use Doctrine\Tests\Models\DDC2372\DDC2372User; use Doctrine\Tests\OrmTestCase; use Doctrine\Tests\VerifyDeprecations; +use \ReflectionClass; class EntityGeneratorTest extends OrmTestCase { @@ -340,8 +341,8 @@ public function testBooleanDefaultValue() $this->assertFileExists($this->_tmpDir . '/' . $this->_namespace . '/EntityGeneratorBook.php~'); - $book = $this->newInstance($metadata); - $reflClass = new \ReflectionClass($metadata->name); + $book = $this->newInstance($metadata); + $reflClass = new ReflectionClass($metadata->name); $this->assertNotSame($book->getfoo(), '1'); $this->assertSame($book->getFoo(), true); From 253fd10cc05e0e33521f3742838b6c1a3ee3dc06 Mon Sep 17 00:00:00 2001 From: Tomoka Baba Date: Wed, 20 Nov 2019 09:24:09 +0900 Subject: [PATCH 033/136] Modified test to use assertTrue. --- tests/Doctrine/Tests/ORM/Tools/EntityGeneratorTest.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/Doctrine/Tests/ORM/Tools/EntityGeneratorTest.php b/tests/Doctrine/Tests/ORM/Tools/EntityGeneratorTest.php index a6fe9c4f39..fda0ec5a48 100644 --- a/tests/Doctrine/Tests/ORM/Tools/EntityGeneratorTest.php +++ b/tests/Doctrine/Tests/ORM/Tools/EntityGeneratorTest.php @@ -344,8 +344,7 @@ public function testBooleanDefaultValue() $book = $this->newInstance($metadata); $reflClass = new ReflectionClass($metadata->name); - $this->assertNotSame($book->getfoo(), '1'); - $this->assertSame($book->getFoo(), true); + $this->assertTrue($book->getfoo()); } public function testEntityUpdatingWorks() From 2bf7916c5244b854defffae3517e32380674138d Mon Sep 17 00:00:00 2001 From: Tomoka Baba Date: Wed, 20 Nov 2019 09:48:27 +0900 Subject: [PATCH 034/136] Fix to pass code quality check. --- tests/Doctrine/Tests/ORM/Tools/EntityGeneratorTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Doctrine/Tests/ORM/Tools/EntityGeneratorTest.php b/tests/Doctrine/Tests/ORM/Tools/EntityGeneratorTest.php index fda0ec5a48..f93e16f3c5 100644 --- a/tests/Doctrine/Tests/ORM/Tools/EntityGeneratorTest.php +++ b/tests/Doctrine/Tests/ORM/Tools/EntityGeneratorTest.php @@ -13,7 +13,7 @@ use Doctrine\Tests\Models\DDC2372\DDC2372User; use Doctrine\Tests\OrmTestCase; use Doctrine\Tests\VerifyDeprecations; -use \ReflectionClass; +use ReflectionClass; class EntityGeneratorTest extends OrmTestCase { From cfd6fadf9c641fa956923288adc6d21ca657bba4 Mon Sep 17 00:00:00 2001 From: Benjamin Eberlei Date: Sun, 1 Dec 2019 11:23:45 +0100 Subject: [PATCH 035/136] Revert "#7841 SchemaTool generates extra diff for platforms without FK support" This reverts commit 3707c3912428423347473a9f20c86a7d858380c4. --- lib/Doctrine/ORM/Tools/SchemaTool.php | 5 -- .../ORM/Functional/Ticket/DDC2138Test.php | 3 - .../ORM/Functional/Ticket/GH7841Test.php | 57 ------------------- 3 files changed, 65 deletions(-) delete mode 100644 tests/Doctrine/Tests/ORM/Functional/Ticket/GH7841Test.php diff --git a/lib/Doctrine/ORM/Tools/SchemaTool.php b/lib/Doctrine/ORM/Tools/SchemaTool.php index ba63e6964d..423ed3b532 100644 --- a/lib/Doctrine/ORM/Tools/SchemaTool.php +++ b/lib/Doctrine/ORM/Tools/SchemaTool.php @@ -709,11 +709,6 @@ private function gatherRelationJoinColumns( } $compositeName = $theJoinTable->getName().'.'.implode('', $localColumns); - - if (! $this->platform->supportsForeignKeyConstraints()) { - return; - } - if (isset($addedFks[$compositeName]) && ($foreignTableName != $addedFks[$compositeName]['foreignTableName'] || 0 < count(array_diff($foreignColumns, $addedFks[$compositeName]['foreignColumns']))) diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2138Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2138Test.php index c6019f849c..960395e9c7 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2138Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2138Test.php @@ -14,9 +14,6 @@ class DDC2138Test extends OrmFunctionalTestCase public function testForeignKeyOnSTIWithMultipleMapping() { $em = $this->_em; - if (! $em->getConnection()->getDatabasePlatform()->supportsForeignKeyConstraints()) { - $this->markTestSkipped('Platform does not support foreign keys.'); - } $schemaTool = new SchemaTool($em); $classes = [ diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/GH7841Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/GH7841Test.php deleted file mode 100644 index 4e6f46324c..0000000000 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/GH7841Test.php +++ /dev/null @@ -1,57 +0,0 @@ -_em->getConnection()->getDatabasePlatform()->supportsForeignKeyConstraints()) { - $this->markTestSkipped('Test for platforms without foreign keys support'); - } - $class = $this->_em->getClassMetadata(GH7841Child::class); - $this->_schemaTool->updateSchema([$class], true); - $diff = $this->_schemaTool->getUpdateSchemaSql([$class], true); - - self::assertEmpty($diff); - - $this->_schemaTool->dropSchema([$class]); - } -} - -/** - * @Entity - */ -class GH7841Parent -{ - /** @Id @Column(type="integer") @GeneratedValue */ - public $id; - - /** @OneToMany(targetEntity=GH7841Child::class, mappedBy="parent") */ - public $children; - - public function __construct() - { - $this->children = new ArrayCollection(); - } -} - -/** - * @Entity - */ -class GH7841Child -{ - /** @Id @Column(type="integer") @GeneratedValue */ - public $id; - - /** @ManyToOne(targetEntity=GH7841Parent::class) */ - public $parent; -} From 75d5adf599deefc7b106708a5e06e23ecaef5ab1 Mon Sep 17 00:00:00 2001 From: Benjamin Eberlei Date: Sun, 1 Dec 2019 19:27:45 +0100 Subject: [PATCH 036/136] [GH-7864] Bugfix in PersistentCollection::removeElement for EXTRA_LAZY. --- docs/en/tutorials/extra-lazy-associations.rst | 1 + lib/Doctrine/ORM/PersistentCollection.php | 6 ++- .../ORM/Functional/Ticket/GH7864Test.php | 45 +++++++++++++++++++ 3 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 tests/Doctrine/Tests/ORM/Functional/Ticket/GH7864Test.php diff --git a/docs/en/tutorials/extra-lazy-associations.rst b/docs/en/tutorials/extra-lazy-associations.rst index 4452d6890a..84e9e7f098 100644 --- a/docs/en/tutorials/extra-lazy-associations.rst +++ b/docs/en/tutorials/extra-lazy-associations.rst @@ -19,6 +19,7 @@ can be called without triggering a full load of the collection: - ``Collection#count()`` - ``Collection#get($key)`` (available with Doctrine 2.4) - ``Collection#slice($offset, $length = null)`` +- ``Collection#removeElement($element)`` for either owning side collections or inverse collections with orphanRemoval=true For each of the above methods the following semantics apply: diff --git a/lib/Doctrine/ORM/PersistentCollection.php b/lib/Doctrine/ORM/PersistentCollection.php index 7d52d5392a..92cd37889d 100644 --- a/lib/Doctrine/ORM/PersistentCollection.php +++ b/lib/Doctrine/ORM/PersistentCollection.php @@ -374,7 +374,11 @@ public function removeElement($element) $persister = $this->em->getUnitOfWork()->getCollectionPersister($this->association); - return $persister->removeElement($this, $element); + if ($persister->removeElement($this, $element) === true) { + // only owning side or orphan removal triggers successful + // delete so that we can keep this collection unitialized. + return true; + } } $removed = parent::removeElement($element); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/GH7864Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/GH7864Test.php new file mode 100644 index 0000000000..babe42de1d --- /dev/null +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/GH7864Test.php @@ -0,0 +1,45 @@ +useModelSet('tweet'); + + parent::setup(); + } + + public function testExtraLazyRemoveElement() + { + $user = new User(); + $user->name = "test"; + + $tweet1 = new Tweet(); + $tweet1->content = "Hello World!"; + $user->addTweet($tweet1); + + $tweet2 = new Tweet(); + $tweet2->content = "Goodbye, and thanks for all the fish"; + $user->addTweet($tweet2); + + $this->_em->persist($user); + $this->_em->persist($tweet1); + $this->_em->persist($tweet2); + $this->_em->flush(); + $this->_em->clear(); + + $user = $this->_em->find(User::class, $user->id); + $tweet = $this->_em->find(Tweet::class, $tweet1->id); + + $user->tweets->removeElement($tweet); + + $tweets = $user->tweets->map(function (Tweet $tweet) { return $tweet->content; }); + + $this->assertEquals(['Goodbye, and thanks for all the fish'], array_values($tweets->toArray())); + } +} From d6f6b2e97c55a980141de266971c6dbe54f8306b Mon Sep 17 00:00:00 2001 From: Benjamin Eberlei Date: Sun, 1 Dec 2019 19:47:58 +0100 Subject: [PATCH 037/136] [GH-7864] Remove tests that checked invalid behavior. --- lib/Doctrine/ORM/PersistentCollection.php | 4 + .../Functional/ExtraLazyCollectionTest.php | 146 ++---------------- 2 files changed, 15 insertions(+), 135 deletions(-) diff --git a/lib/Doctrine/ORM/PersistentCollection.php b/lib/Doctrine/ORM/PersistentCollection.php index 92cd37889d..b10a17340b 100644 --- a/lib/Doctrine/ORM/PersistentCollection.php +++ b/lib/Doctrine/ORM/PersistentCollection.php @@ -372,6 +372,10 @@ public function removeElement($element) return $this->collection->removeElement($element); } + if ($this->em->getUnitOfWork()->getEntityState($element) === UnitOfWork::STATE_NEW) { + return true; + } + $persister = $this->em->getUnitOfWork()->getCollectionPersister($this->association); if ($persister->removeElement($this, $element) === true) { diff --git a/tests/Doctrine/Tests/ORM/Functional/ExtraLazyCollectionTest.php b/tests/Doctrine/Tests/ORM/Functional/ExtraLazyCollectionTest.php index e7f4fd2980..adba0de74a 100644 --- a/tests/Doctrine/Tests/ORM/Functional/ExtraLazyCollectionTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/ExtraLazyCollectionTest.php @@ -474,137 +474,6 @@ public function testContainsManyToManyInverse() $this->assertFalse($user->groups->isInitialized(), "Post-Condition: Collection is not initialized."); } - /** - * - */ - public function testRemoveElementOneToMany() - { - $user = $this->_em->find(CmsUser::class, $this->userId); - $this->assertFalse($user->articles->isInitialized(), "Pre-Condition: Collection is not initialized."); - - // Test One to Many removal with Entity retrieved from DB - $article = $this->_em->find(CmsArticle::class, $this->articleId); - $queryCount = $this->getCurrentQueryCount(); - - $user->articles->removeElement($article); - - $this->assertFalse($user->articles->isInitialized(), "Post-Condition: Collection is not initialized."); - $this->assertEquals($queryCount, $this->getCurrentQueryCount()); - - // Test One to Many removal with Entity state as new - $article = new CmsArticle(); - $article->topic = "Testnew"; - $article->text = "blub"; - - $queryCount = $this->getCurrentQueryCount(); - - $user->articles->removeElement($article); - - $this->assertEquals($queryCount, $this->getCurrentQueryCount(), "Removing a new entity should cause no query to be executed."); - - // Test One to Many removal with Entity state as clean - $this->_em->persist($article); - $this->_em->flush(); - - $queryCount = $this->getCurrentQueryCount(); - - $user->articles->removeElement($article); - - $this->assertEquals($queryCount, $this->getCurrentQueryCount(), "Removing a persisted entity will not cause queries when the owning side doesn't actually change."); - $this->assertFalse($user->articles->isInitialized(), "Post-Condition: Collection is not initialized."); - - // Test One to Many removal with Entity state as managed - $article = new CmsArticle(); - $article->topic = "How to not fail anymore on tests"; - $article->text = "That is simple! Just write more tests!"; - - $this->_em->persist($article); - - $queryCount = $this->getCurrentQueryCount(); - - $user->articles->removeElement($article); - - $this->assertEquals($queryCount, $this->getCurrentQueryCount(), "Removing a managed entity should cause no query to be executed."); - } - - /** - * @group DDC-2504 - */ - public function testRemovalOfManagedElementFromOneToManyJoinedInheritanceCollectionDoesNotInitializeIt() - { - /* @var $otherClass DDC2504OtherClass */ - $otherClass = $this->_em->find(DDC2504OtherClass::class, $this->ddc2504OtherClassId); - /* @var $childClass DDC2504ChildClass */ - $childClass = $this->_em->find(DDC2504ChildClass::class, $this->ddc2504ChildClassId); - - $queryCount = $this->getCurrentQueryCount(); - - $otherClass->childClasses->removeElement($childClass); - $childClass->other = null; // updating owning side - - $this->assertFalse($otherClass->childClasses->isInitialized(), 'Collection is not initialized.'); - - $this->assertEquals( - $queryCount, - $this->getCurrentQueryCount(), - 'No queries have been executed' - ); - - $this->assertTrue( - $otherClass->childClasses->contains($childClass), - 'Collection item still not updated (needs flushing)' - ); - - $this->_em->flush(); - - $this->assertFalse( - $otherClass->childClasses->contains($childClass), - 'Referenced item was removed in the transaction' - ); - - $this->assertFalse($otherClass->childClasses->isInitialized(), 'Collection is not initialized.'); - } - - /** - * @group DDC-2504 - */ - public function testRemovalOfNonManagedElementFromOneToManyJoinedInheritanceCollectionDoesNotInitializeIt() - { - /* @var $otherClass DDC2504OtherClass */ - $otherClass = $this->_em->find(DDC2504OtherClass::class, $this->ddc2504OtherClassId); - $queryCount = $this->getCurrentQueryCount(); - - $otherClass->childClasses->removeElement(new DDC2504ChildClass()); - - $this->assertEquals( - $queryCount, - $this->getCurrentQueryCount(), - 'Removing an unmanaged entity should cause no query to be executed.' - ); - } - - /** - * @group DDC-2504 - */ - public function testRemovalOfNewElementFromOneToManyJoinedInheritanceCollectionDoesNotInitializeIt() - { - /* @var $otherClass DDC2504OtherClass */ - $otherClass = $this->_em->find(DDC2504OtherClass::class, $this->ddc2504OtherClassId); - $childClass = new DDC2504ChildClass(); - - $this->_em->persist($childClass); - - $queryCount = $this->getCurrentQueryCount(); - - $otherClass->childClasses->removeElement($childClass); - - $this->assertEquals( - $queryCount, - $this->getCurrentQueryCount(), - 'Removing a new entity should cause no query to be executed.' - ); - } - /** * @group DDC-2504 */ @@ -618,6 +487,7 @@ public function testRemovalOfNewManagedElementFromOneToManyJoinedInheritanceColl $queryCount = $this->getCurrentQueryCount(); + $otherClass->childClasses->add($childClass); $otherClass->childClasses->removeElement($childClass); $this->assertEquals( @@ -646,7 +516,10 @@ public function testRemoveElementManyToMany() $this->assertFalse($user->groups->isInitialized(), "Post-Condition: Collection is not initialized."); $this->assertFalse($user->groups->removeElement($group), "Removing an already removed element returns false"); + $this->assertTrue($user->groups->isInitialized(), "Post-Condition: Remmoving entity that isnt in collection initializes"); + $this->_em->clear(); + $user = $this->_em->find(CmsUser::class, $this->userId); // Test Many to Many removal with Entity state as new $group = new CmsGroup(); $group->name = "A New group!"; @@ -666,8 +539,11 @@ public function testRemoveElementManyToMany() $user->groups->removeElement($group); - $this->assertEquals($queryCount + 1, $this->getCurrentQueryCount(), "Removing a persisted entity should cause one query to be executed."); - $this->assertFalse($user->groups->isInitialized(), "Post-Condition: Collection is not initialized."); + $this->assertEquals($queryCount + 2, $this->getCurrentQueryCount(), "Removing a persisted entity should cause one query to be executed."); + $this->assertTrue($user->groups->isInitialized(), "Post-Condition: Collection is initialized."); + $this->_em->clear(); + + $user = $this->_em->find(CmsUser::class, $this->userId); // Test Many to Many removal with Entity state as managed $group = new CmsGroup(); @@ -679,8 +555,8 @@ public function testRemoveElementManyToMany() $user->groups->removeElement($group); - $this->assertEquals($queryCount, $this->getCurrentQueryCount(), "Removing a managed entity should cause no query to be executed."); - $this->assertFalse($user->groups->isInitialized(), "Post-Condition: Collection is not initialized."); + $this->assertEquals($queryCount + 1, $this->getCurrentQueryCount(), "Removing a managed entity should cause query to be executed."); + $this->assertTrue($user->groups->isInitialized(), "Post-Condition: Collection is initialized."); } /** From 419df77a09775c5c751d5e4659fa9baeb865fe12 Mon Sep 17 00:00:00 2001 From: Benjamin Eberlei Date: Sun, 1 Dec 2019 20:28:30 +0100 Subject: [PATCH 038/136] [GH-7864] ExtraLazyCollectionTest is not cacahble and should not fail SLC suite. --- .../Doctrine/Tests/ORM/Functional/ExtraLazyCollectionTest.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/Doctrine/Tests/ORM/Functional/ExtraLazyCollectionTest.php b/tests/Doctrine/Tests/ORM/Functional/ExtraLazyCollectionTest.php index adba0de74a..998c1ed510 100644 --- a/tests/Doctrine/Tests/ORM/Functional/ExtraLazyCollectionTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/ExtraLazyCollectionTest.php @@ -499,7 +499,7 @@ public function testRemovalOfNewManagedElementFromOneToManyJoinedInheritanceColl } /** - * + * @group non-cacheable */ public function testRemoveElementManyToMany() { @@ -539,7 +539,6 @@ public function testRemoveElementManyToMany() $user->groups->removeElement($group); - $this->assertEquals($queryCount + 2, $this->getCurrentQueryCount(), "Removing a persisted entity should cause one query to be executed."); $this->assertTrue($user->groups->isInitialized(), "Post-Condition: Collection is initialized."); $this->_em->clear(); From ae2b9b1921d1c8c72c1ee54a0b9008dbc0254387 Mon Sep 17 00:00:00 2001 From: Benjamin Eberlei Date: Sun, 1 Dec 2019 21:11:09 +0100 Subject: [PATCH 039/136] Housekeeping: phpcbf to fix issues. --- .../Functional/ExtraLazyCollectionTest.php | 375 +++++++++--------- .../ORM/Functional/Ticket/GH7864Test.php | 26 +- 2 files changed, 204 insertions(+), 197 deletions(-) diff --git a/tests/Doctrine/Tests/ORM/Functional/ExtraLazyCollectionTest.php b/tests/Doctrine/Tests/ORM/Functional/ExtraLazyCollectionTest.php index 998c1ed510..955ae66cb8 100644 --- a/tests/Doctrine/Tests/ORM/Functional/ExtraLazyCollectionTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/ExtraLazyCollectionTest.php @@ -1,5 +1,7 @@ useModelSet('ddc2504'); parent::setUp(); - $class = $this->_em->getClassMetadata(CmsUser::class); - $class->associationMappings['groups']['fetch'] = ClassMetadataInfo::FETCH_EXTRA_LAZY; - $class->associationMappings['groups']['indexBy'] = 'name'; - $class->associationMappings['articles']['fetch'] = ClassMetadataInfo::FETCH_EXTRA_LAZY; - $class->associationMappings['articles']['indexBy'] = 'topic'; - $class->associationMappings['phonenumbers']['fetch'] = ClassMetadataInfo::FETCH_EXTRA_LAZY; + $class = $this->_em->getClassMetadata(CmsUser::class); + $class->associationMappings['groups']['fetch'] = ClassMetadataInfo::FETCH_EXTRA_LAZY; + $class->associationMappings['groups']['indexBy'] = 'name'; + $class->associationMappings['articles']['fetch'] = ClassMetadataInfo::FETCH_EXTRA_LAZY; + $class->associationMappings['articles']['indexBy'] = 'topic'; + $class->associationMappings['phonenumbers']['fetch'] = ClassMetadataInfo::FETCH_EXTRA_LAZY; $class->associationMappings['phonenumbers']['indexBy'] = 'phonenumber'; unset($class->associationMappings['phonenumbers']['cache']); unset($class->associationMappings['articles']['cache']); unset($class->associationMappings['users']['cache']); - $class = $this->_em->getClassMetadata(CmsGroup::class); - $class->associationMappings['users']['fetch'] = ClassMetadataInfo::FETCH_EXTRA_LAZY; + $class = $this->_em->getClassMetadata(CmsGroup::class); + $class->associationMappings['users']['fetch'] = ClassMetadataInfo::FETCH_EXTRA_LAZY; $class->associationMappings['users']['indexBy'] = 'username'; $this->loadFixture(); @@ -63,16 +65,16 @@ public function tearDown() { parent::tearDown(); - $class = $this->_em->getClassMetadata(CmsUser::class); - $class->associationMappings['groups']['fetch'] = ClassMetadataInfo::FETCH_LAZY; - $class->associationMappings['articles']['fetch'] = ClassMetadataInfo::FETCH_LAZY; + $class = $this->_em->getClassMetadata(CmsUser::class); + $class->associationMappings['groups']['fetch'] = ClassMetadataInfo::FETCH_LAZY; + $class->associationMappings['articles']['fetch'] = ClassMetadataInfo::FETCH_LAZY; $class->associationMappings['phonenumbers']['fetch'] = ClassMetadataInfo::FETCH_LAZY; unset($class->associationMappings['groups']['indexBy']); unset($class->associationMappings['articles']['indexBy']); unset($class->associationMappings['phonenumbers']['indexBy']); - $class = $this->_em->getClassMetadata(CmsGroup::class); + $class = $this->_em->getClassMetadata(CmsGroup::class); $class->associationMappings['users']['fetch'] = ClassMetadataInfo::FETCH_LAZY; unset($class->associationMappings['users']['indexBy']); @@ -84,16 +86,17 @@ public function tearDown() */ public function testCountNotInitializesCollection() { - $user = $this->_em->find(CmsUser::class, $this->userId); + $user = $this->_em->find(CmsUser::class, $this->userId); $queryCount = $this->getCurrentQueryCount(); $this->assertFalse($user->groups->isInitialized()); $this->assertEquals(3, count($user->groups)); $this->assertFalse($user->groups->isInitialized()); - foreach ($user->groups AS $group) { } + foreach ($user->groups as $group) { + } - $this->assertEquals($queryCount + 2, $this->getCurrentQueryCount(), "Expecting two queries to be fired for count, then iteration."); + $this->assertEquals($queryCount + 2, $this->getCurrentQueryCount(), 'Expecting two queries to be fired for count, then iteration.'); } /** @@ -103,8 +106,8 @@ public function testCountWhenNewEntityPresent() { $user = $this->_em->find(CmsUser::class, $this->userId); - $newGroup = new CmsGroup(); - $newGroup->name = "Test4"; + $newGroup = new CmsGroup(); + $newGroup->name = 'Test4'; $user->addGroup($newGroup); $this->_em->persist($newGroup); @@ -120,14 +123,15 @@ public function testCountWhenNewEntityPresent() */ public function testCountWhenInitialized() { - $user = $this->_em->find(CmsUser::class, $this->userId); + $user = $this->_em->find(CmsUser::class, $this->userId); $queryCount = $this->getCurrentQueryCount(); - foreach ($user->groups AS $group) { } + foreach ($user->groups as $group) { + } $this->assertTrue($user->groups->isInitialized()); $this->assertEquals(3, count($user->groups)); - $this->assertEquals($queryCount + 1, $this->getCurrentQueryCount(), "Should only execute one query to initialize collection, no extra query for count() more."); + $this->assertEquals($queryCount + 1, $this->getCurrentQueryCount(), 'Should only execute one query to initialize collection, no extra query for count() more.'); } /** @@ -136,10 +140,10 @@ public function testCountWhenInitialized() public function testCountInverseCollection() { $group = $this->_em->find(CmsGroup::class, $this->groupId); - $this->assertFalse($group->users->isInitialized(), "Pre-Condition"); + $this->assertFalse($group->users->isInitialized(), 'Pre-Condition'); $this->assertEquals(4, count($group->users)); - $this->assertFalse($group->users->isInitialized(), "Extra Lazy collection should not be initialized by counting the collection."); + $this->assertFalse($group->users->isInitialized(), 'Extra Lazy collection should not be initialized by counting the collection.'); } /** @@ -148,7 +152,7 @@ public function testCountInverseCollection() public function testCountOneToMany() { $user = $this->_em->find(CmsUser::class, $this->userId); - $this->assertFalse($user->groups->isInitialized(), "Pre-Condition"); + $this->assertFalse($user->groups->isInitialized(), 'Pre-Condition'); $this->assertEquals(2, count($user->articles)); } @@ -160,7 +164,7 @@ public function testCountOneToManyJoinedInheritance() { $otherClass = $this->_em->find(DDC2504OtherClass::class, $this->ddc2504OtherClassId); - $this->assertFalse($otherClass->childClasses->isInitialized(), "Pre-Condition"); + $this->assertFalse($otherClass->childClasses->isInitialized(), 'Pre-Condition'); $this->assertEquals(2, count($otherClass->childClasses)); } @@ -170,7 +174,7 @@ public function testCountOneToManyJoinedInheritance() public function testFullSlice() { $user = $this->_em->find(CmsUser::class, $this->userId); - $this->assertFalse($user->groups->isInitialized(), "Pre-Condition: Collection is not initialized."); + $this->assertFalse($user->groups->isInitialized(), 'Pre-Condition: Collection is not initialized.'); $someGroups = $user->groups->slice(null); $this->assertEquals(3, count($someGroups)); @@ -183,7 +187,7 @@ public function testFullSlice() public function testSlice() { $user = $this->_em->find(CmsUser::class, $this->userId); - $this->assertFalse($user->groups->isInitialized(), "Pre-Condition: Collection is not initialized."); + $this->assertFalse($user->groups->isInitialized(), 'Pre-Condition: Collection is not initialized.'); $queryCount = $this->getCurrentQueryCount(); @@ -199,7 +203,8 @@ public function testSlice() $this->assertEquals(1, count($otherGroup)); $this->assertFalse($user->groups->isInitialized()); - foreach ($user->groups AS $group) { } + foreach ($user->groups as $group) { + } $this->assertTrue($user->groups->isInitialized()); $this->assertEquals(3, count($user->groups)); @@ -213,10 +218,11 @@ public function testSlice() */ public function testSliceInitializedCollection() { - $user = $this->_em->find(CmsUser::class, $this->userId); + $user = $this->_em->find(CmsUser::class, $this->userId); $queryCount = $this->getCurrentQueryCount(); - foreach ($user->groups AS $group) { } + foreach ($user->groups as $group) { + } $someGroups = $user->groups->slice(0, 2); @@ -233,10 +239,10 @@ public function testSliceInitializedCollection() public function testSliceInverseCollection() { $group = $this->_em->find(CmsGroup::class, $this->groupId); - $this->assertFalse($group->users->isInitialized(), "Pre-Condition"); + $this->assertFalse($group->users->isInitialized(), 'Pre-Condition'); $queryCount = $this->getCurrentQueryCount(); - $someUsers = $group->users->slice(0, 2); + $someUsers = $group->users->slice(0, 2); $otherUsers = $group->users->slice(2, 2); $this->assertContainsOnly(CmsUser::class, $someUsers); @@ -245,7 +251,7 @@ public function testSliceInverseCollection() $this->assertEquals(2, count($otherUsers)); // +2 queries executed by slice - $this->assertEquals($queryCount + 2, $this->getCurrentQueryCount(), "Slicing two parts should only execute two additional queries."); + $this->assertEquals($queryCount + 2, $this->getCurrentQueryCount(), 'Slicing two parts should only execute two additional queries.'); } /** @@ -254,11 +260,11 @@ public function testSliceInverseCollection() public function testSliceOneToMany() { $user = $this->_em->find(CmsUser::class, $this->userId); - $this->assertFalse($user->articles->isInitialized(), "Pre-Condition: Collection is not initialized."); + $this->assertFalse($user->articles->isInitialized(), 'Pre-Condition: Collection is not initialized.'); $queryCount = $this->getCurrentQueryCount(); - $someArticle = $user->articles->slice(0, 1); + $someArticle = $user->articles->slice(0, 1); $otherArticle = $user->articles->slice(1, 1); $this->assertEquals($queryCount + 2, $this->getCurrentQueryCount()); @@ -270,24 +276,24 @@ public function testSliceOneToMany() public function testContainsOneToMany() { $user = $this->_em->find(CmsUser::class, $this->userId); - $this->assertFalse($user->articles->isInitialized(), "Pre-Condition: Collection is not initialized."); + $this->assertFalse($user->articles->isInitialized(), 'Pre-Condition: Collection is not initialized.'); // Test One to Many existence retrieved from DB $article = $this->_em->find(CmsArticle::class, $this->articleId); $queryCount = $this->getCurrentQueryCount(); $this->assertTrue($user->articles->contains($article)); - $this->assertFalse($user->articles->isInitialized(), "Post-Condition: Collection is not initialized."); + $this->assertFalse($user->articles->isInitialized(), 'Post-Condition: Collection is not initialized.'); $this->assertEquals($queryCount + 1, $this->getCurrentQueryCount()); // Test One to Many existence with state new - $article = new CmsArticle(); - $article->topic = "Testnew"; - $article->text = "blub"; + $article = new CmsArticle(); + $article->topic = 'Testnew'; + $article->text = 'blub'; $queryCount = $this->getCurrentQueryCount(); $this->assertFalse($user->articles->contains($article)); - $this->assertEquals($queryCount, $this->getCurrentQueryCount(), "Checking for contains of new entity should cause no query to be executed."); + $this->assertEquals($queryCount, $this->getCurrentQueryCount(), 'Checking for contains of new entity should cause no query to be executed.'); // Test One to Many existence with state clear $this->_em->persist($article); @@ -295,21 +301,21 @@ public function testContainsOneToMany() $queryCount = $this->getCurrentQueryCount(); $this->assertFalse($user->articles->contains($article)); - $this->assertEquals($queryCount+1, $this->getCurrentQueryCount(), "Checking for contains of persisted entity should cause one query to be executed."); - $this->assertFalse($user->articles->isInitialized(), "Post-Condition: Collection is not initialized."); + $this->assertEquals($queryCount+1, $this->getCurrentQueryCount(), 'Checking for contains of persisted entity should cause one query to be executed.'); + $this->assertFalse($user->articles->isInitialized(), 'Post-Condition: Collection is not initialized.'); // Test One to Many existence with state managed - $article = new CmsArticle(); - $article->topic = "How to not fail anymore on tests"; - $article->text = "That is simple! Just write more tests!"; + $article = new CmsArticle(); + $article->topic = 'How to not fail anymore on tests'; + $article->text = 'That is simple! Just write more tests!'; $this->_em->persist($article); $queryCount = $this->getCurrentQueryCount(); $this->assertFalse($user->articles->contains($article)); - $this->assertEquals($queryCount, $this->getCurrentQueryCount(), "Checking for contains of managed entity (but not persisted) should cause no query to be executed."); - $this->assertFalse($user->articles->isInitialized(), "Post-Condition: Collection is not initialized."); + $this->assertEquals($queryCount, $this->getCurrentQueryCount(), 'Checking for contains of managed entity (but not persisted) should cause no query to be executed.'); + $this->assertFalse($user->articles->isInitialized(), 'Post-Condition: Collection is not initialized.'); } /** @@ -368,8 +374,8 @@ public function testContainsOnOneToManyJoinedInheritanceWillNotInitializeCollect $queryCount = $this->getCurrentQueryCount(); $this->assertFalse($otherClass->childClasses->contains($childClass)); - $this->assertEquals($queryCount + 1, $this->getCurrentQueryCount(), "Checking for contains of persisted entity should cause one query to be executed."); - $this->assertFalse($otherClass->childClasses->isInitialized(), "Post-Condition: Collection is not initialized."); + $this->assertEquals($queryCount + 1, $this->getCurrentQueryCount(), 'Checking for contains of persisted entity should cause one query to be executed.'); + $this->assertFalse($otherClass->childClasses->isInitialized(), 'Post-Condition: Collection is not initialized.'); } /** @@ -385,8 +391,8 @@ public function testContainsOnOneToManyJoinedInheritanceWillNotInitializeCollect $queryCount = $this->getCurrentQueryCount(); $this->assertFalse($otherClass->childClasses->contains($childClass)); - $this->assertEquals($queryCount, $this->getCurrentQueryCount(), "Checking for contains of managed entity (but not persisted) should cause no query to be executed."); - $this->assertFalse($otherClass->childClasses->isInitialized(), "Post-Condition: Collection is not initialized."); + $this->assertEquals($queryCount, $this->getCurrentQueryCount(), 'Checking for contains of managed entity (but not persisted) should cause no query to be executed.'); + $this->assertFalse($otherClass->childClasses->isInitialized(), 'Post-Condition: Collection is not initialized.'); } /** @@ -407,25 +413,25 @@ public function testCountingOnOneToManyJoinedInheritanceWillNotInitializeCollect public function testContainsManyToMany() { $user = $this->_em->find(CmsUser::class, $this->userId); - $this->assertFalse($user->groups->isInitialized(), "Pre-Condition: Collection is not initialized."); + $this->assertFalse($user->groups->isInitialized(), 'Pre-Condition: Collection is not initialized.'); // Test Many to Many existence retrieved from DB $group = $this->_em->find(CmsGroup::class, $this->groupId); $queryCount = $this->getCurrentQueryCount(); $this->assertTrue($user->groups->contains($group)); - $this->assertEquals($queryCount + 1, $this->getCurrentQueryCount(), "Checking for contains of managed entity should cause one query to be executed."); - $this->assertFalse($user->groups->isInitialized(), "Post-Condition: Collection is not initialized."); + $this->assertEquals($queryCount + 1, $this->getCurrentQueryCount(), 'Checking for contains of managed entity should cause one query to be executed.'); + $this->assertFalse($user->groups->isInitialized(), 'Post-Condition: Collection is not initialized.'); // Test Many to Many existence with state new - $group = new CmsGroup(); - $group->name = "A New group!"; + $group = new CmsGroup(); + $group->name = 'A New group!'; $queryCount = $this->getCurrentQueryCount(); $this->assertFalse($user->groups->contains($group)); - $this->assertEquals($queryCount, $this->getCurrentQueryCount(), "Checking for contains of new entity should cause no query to be executed."); - $this->assertFalse($user->groups->isInitialized(), "Post-Condition: Collection is not initialized."); + $this->assertEquals($queryCount, $this->getCurrentQueryCount(), 'Checking for contains of new entity should cause no query to be executed.'); + $this->assertFalse($user->groups->isInitialized(), 'Post-Condition: Collection is not initialized.'); // Test Many to Many existence with state clear $this->_em->persist($group); @@ -434,20 +440,20 @@ public function testContainsManyToMany() $queryCount = $this->getCurrentQueryCount(); $this->assertFalse($user->groups->contains($group)); - $this->assertEquals($queryCount + 1, $this->getCurrentQueryCount(), "Checking for contains of persisted entity should cause one query to be executed."); - $this->assertFalse($user->groups->isInitialized(), "Post-Condition: Collection is not initialized."); + $this->assertEquals($queryCount + 1, $this->getCurrentQueryCount(), 'Checking for contains of persisted entity should cause one query to be executed.'); + $this->assertFalse($user->groups->isInitialized(), 'Post-Condition: Collection is not initialized.'); // Test Many to Many existence with state managed - $group = new CmsGroup(); - $group->name = "My managed group"; + $group = new CmsGroup(); + $group->name = 'My managed group'; $this->_em->persist($group); $queryCount = $this->getCurrentQueryCount(); $this->assertFalse($user->groups->contains($group)); - $this->assertEquals($queryCount, $this->getCurrentQueryCount(), "Checking for contains of managed entity (but not persisted) should cause no query to be executed."); - $this->assertFalse($user->groups->isInitialized(), "Post-Condition: Collection is not initialized."); + $this->assertEquals($queryCount, $this->getCurrentQueryCount(), 'Checking for contains of managed entity (but not persisted) should cause no query to be executed.'); + $this->assertFalse($user->groups->isInitialized(), 'Post-Condition: Collection is not initialized.'); } /** @@ -456,22 +462,22 @@ public function testContainsManyToMany() public function testContainsManyToManyInverse() { $group = $this->_em->find(CmsGroup::class, $this->groupId); - $this->assertFalse($group->users->isInitialized(), "Pre-Condition: Collection is not initialized."); + $this->assertFalse($group->users->isInitialized(), 'Pre-Condition: Collection is not initialized.'); $user = $this->_em->find(CmsUser::class, $this->userId); $queryCount = $this->getCurrentQueryCount(); $this->assertTrue($group->users->contains($user)); - $this->assertEquals($queryCount+1, $this->getCurrentQueryCount(), "Checking for contains of managed entity should cause one query to be executed."); - $this->assertFalse($user->groups->isInitialized(), "Post-Condition: Collection is not initialized."); + $this->assertEquals($queryCount+1, $this->getCurrentQueryCount(), 'Checking for contains of managed entity should cause one query to be executed.'); + $this->assertFalse($user->groups->isInitialized(), 'Post-Condition: Collection is not initialized.'); - $newUser = new CmsUser(); - $newUser->name = "A New group!"; + $newUser = new CmsUser(); + $newUser->name = 'A New group!'; $queryCount = $this->getCurrentQueryCount(); $this->assertFalse($group->users->contains($newUser)); - $this->assertEquals($queryCount, $this->getCurrentQueryCount(), "Checking for contains of new entity should cause no query to be executed."); - $this->assertFalse($user->groups->isInitialized(), "Post-Condition: Collection is not initialized."); + $this->assertEquals($queryCount, $this->getCurrentQueryCount(), 'Checking for contains of new entity should cause no query to be executed.'); + $this->assertFalse($user->groups->isInitialized(), 'Post-Condition: Collection is not initialized.'); } /** @@ -504,7 +510,7 @@ public function testRemovalOfNewManagedElementFromOneToManyJoinedInheritanceColl public function testRemoveElementManyToMany() { $user = $this->_em->find(CmsUser::class, $this->userId); - $this->assertFalse($user->groups->isInitialized(), "Pre-Condition: Collection is not initialized."); + $this->assertFalse($user->groups->isInitialized(), 'Pre-Condition: Collection is not initialized.'); // Test Many to Many removal with Entity retrieved from DB $group = $this->_em->find(CmsGroup::class, $this->groupId); @@ -512,24 +518,24 @@ public function testRemoveElementManyToMany() $this->assertTrue($user->groups->removeElement($group)); - $this->assertEquals($queryCount + 1, $this->getCurrentQueryCount(), "Removing a persisted entity should cause one query to be executed."); - $this->assertFalse($user->groups->isInitialized(), "Post-Condition: Collection is not initialized."); + $this->assertEquals($queryCount + 1, $this->getCurrentQueryCount(), 'Removing a persisted entity should cause one query to be executed.'); + $this->assertFalse($user->groups->isInitialized(), 'Post-Condition: Collection is not initialized.'); - $this->assertFalse($user->groups->removeElement($group), "Removing an already removed element returns false"); - $this->assertTrue($user->groups->isInitialized(), "Post-Condition: Remmoving entity that isnt in collection initializes"); + $this->assertFalse($user->groups->removeElement($group), 'Removing an already removed element returns false'); + $this->assertTrue($user->groups->isInitialized(), 'Post-Condition: Remmoving entity that isnt in collection initializes'); $this->_em->clear(); $user = $this->_em->find(CmsUser::class, $this->userId); // Test Many to Many removal with Entity state as new - $group = new CmsGroup(); - $group->name = "A New group!"; + $group = new CmsGroup(); + $group->name = 'A New group!'; $queryCount = $this->getCurrentQueryCount(); $user->groups->removeElement($group); - $this->assertEquals($queryCount, $this->getCurrentQueryCount(), "Removing new entity should cause no query to be executed."); - $this->assertFalse($user->groups->isInitialized(), "Post-Condition: Collection is not initialized."); + $this->assertEquals($queryCount, $this->getCurrentQueryCount(), 'Removing new entity should cause no query to be executed.'); + $this->assertFalse($user->groups->isInitialized(), 'Post-Condition: Collection is not initialized.'); // Test Many to Many removal with Entity state as clean $this->_em->persist($group); @@ -539,14 +545,14 @@ public function testRemoveElementManyToMany() $user->groups->removeElement($group); - $this->assertTrue($user->groups->isInitialized(), "Post-Condition: Collection is initialized."); + $this->assertTrue($user->groups->isInitialized(), 'Post-Condition: Collection is initialized.'); $this->_em->clear(); $user = $this->_em->find(CmsUser::class, $this->userId); // Test Many to Many removal with Entity state as managed - $group = new CmsGroup(); - $group->name = "A New group!"; + $group = new CmsGroup(); + $group->name = 'A New group!'; $this->_em->persist($group); @@ -554,35 +560,32 @@ public function testRemoveElementManyToMany() $user->groups->removeElement($group); - $this->assertEquals($queryCount + 1, $this->getCurrentQueryCount(), "Removing a managed entity should cause query to be executed."); - $this->assertTrue($user->groups->isInitialized(), "Post-Condition: Collection is initialized."); + $this->assertEquals($queryCount + 1, $this->getCurrentQueryCount(), 'Removing a managed entity should cause query to be executed.'); + $this->assertTrue($user->groups->isInitialized(), 'Post-Condition: Collection is initialized.'); } - /** - * - */ public function testRemoveElementManyToManyInverse() { $group = $this->_em->find(CmsGroup::class, $this->groupId); - $this->assertFalse($group->users->isInitialized(), "Pre-Condition: Collection is not initialized."); + $this->assertFalse($group->users->isInitialized(), 'Pre-Condition: Collection is not initialized.'); $user = $this->_em->find(CmsUser::class, $this->userId); $queryCount = $this->getCurrentQueryCount(); $group->users->removeElement($user); - $this->assertEquals($queryCount + 1, $this->getCurrentQueryCount(), "Removing a managed entity should cause one query to be executed."); - $this->assertFalse($user->groups->isInitialized(), "Post-Condition: Collection is not initialized."); + $this->assertEquals($queryCount + 1, $this->getCurrentQueryCount(), 'Removing a managed entity should cause one query to be executed.'); + $this->assertFalse($user->groups->isInitialized(), 'Post-Condition: Collection is not initialized.'); - $newUser = new CmsUser(); - $newUser->name = "A New group!"; + $newUser = new CmsUser(); + $newUser->name = 'A New group!'; $queryCount = $this->getCurrentQueryCount(); $group->users->removeElement($newUser); - $this->assertEquals($queryCount, $this->getCurrentQueryCount(), "Removing a new entity should cause no query to be executed."); - $this->assertFalse($user->groups->isInitialized(), "Post-Condition: Collection is not initialized."); + $this->assertEquals($queryCount, $this->getCurrentQueryCount(), 'Removing a new entity should cause no query to be executed.'); + $this->assertFalse($user->groups->isInitialized(), 'Post-Condition: Collection is not initialized.'); } /** @@ -592,8 +595,8 @@ public function testCountAfterAddThenFlush() { $user = $this->_em->find(CmsUser::class, $this->userId); - $newGroup = new CmsGroup(); - $newGroup->name = "Test4"; + $newGroup = new CmsGroup(); + $newGroup->name = 'Test4'; $user->addGroup($newGroup); $this->_em->persist($newGroup); @@ -614,15 +617,15 @@ public function testCountAfterAddThenFlush() public function testSliceOnDirtyCollection() { $user = $this->_em->find(CmsUser::class, $this->userId); - /* @var $user CmsUser */ + /** @var CmsUser $user */ - $newGroup = new CmsGroup(); - $newGroup->name = "Test4"; + $newGroup = new CmsGroup(); + $newGroup->name = 'Test4'; $user->addGroup($newGroup); $this->_em->persist($newGroup); - $qc = $this->getCurrentQueryCount(); + $qc = $this->getCurrentQueryCount(); $groups = $user->groups->slice(0, 10); $this->assertEquals(4, count($groups)); @@ -636,9 +639,9 @@ public function testSliceOnDirtyCollection() public function testGetIndexByIdentifier() { $user = $this->_em->find(CmsUser::class, $this->userId); - /* @var $user CmsUser */ + /** @var CmsUser $user */ - $queryCount = $this->getCurrentQueryCount(); + $queryCount = $this->getCurrentQueryCount(); $phonenumber = $user->phonenumbers->get($this->phonenumber); $this->assertFalse($user->phonenumbers->isInitialized()); @@ -646,7 +649,7 @@ public function testGetIndexByIdentifier() $this->assertSame($phonenumber, $this->_em->find(CmsPhonenumber::class, $this->phonenumber)); $article = $user->phonenumbers->get($this->phonenumber); - $this->assertEquals($queryCount + 1, $this->getCurrentQueryCount(), "Getting the same entity should not cause an extra query to be executed"); + $this->assertEquals($queryCount + 1, $this->getCurrentQueryCount(), 'Getting the same entity should not cause an extra query to be executed'); } /** @@ -655,7 +658,7 @@ public function testGetIndexByIdentifier() public function testGetIndexByOneToMany() { $user = $this->_em->find(CmsUser::class, $this->userId); - /* @var $user CmsUser */ + /** @var CmsUser $user */ $queryCount = $this->getCurrentQueryCount(); @@ -672,7 +675,7 @@ public function testGetIndexByOneToMany() public function testGetIndexByManyToManyInverseSide() { $group = $this->_em->find(CmsGroup::class, $this->groupId); - /* @var $group CmsGroup */ + /** @var CmsGroup $group */ $queryCount = $this->getCurrentQueryCount(); @@ -689,7 +692,7 @@ public function testGetIndexByManyToManyInverseSide() public function testGetIndexByManyToManyOwningSide() { $user = $this->_em->find(CmsUser::class, $this->userId); - /* @var $user CmsUser */ + /** @var CmsUser $user */ $queryCount = $this->getCurrentQueryCount(); @@ -713,7 +716,7 @@ public function testGetNonExistentIndexBy() public function testContainsKeyIndexByOneToMany() { $user = $this->_em->find(CmsUser::class, $this->userId); - /* @var $user CmsUser */ + /** @var CmsUser $user */ $queryCount = $this->getCurrentQueryCount(); @@ -726,7 +729,7 @@ public function testContainsKeyIndexByOneToMany() public function testContainsKeyIndexByOneToManyJoinedInheritance() { - $class = $this->_em->getClassMetadata(DDC2504OtherClass::class); + $class = $this->_em->getClassMetadata(DDC2504OtherClass::class); $class->associationMappings['childClasses']['indexBy'] = 'id'; $otherClass = $this->_em->find(DDC2504OtherClass::class, $this->ddc2504OtherClassId); @@ -750,27 +753,27 @@ public function testContainsKeyIndexByManyToMany() $contains = $user->groups->containsKey($group->name); - $this->assertTrue($contains, "The item is not into collection"); - $this->assertFalse($user->groups->isInitialized(), "The collection must not be initialized"); + $this->assertTrue($contains, 'The item is not into collection'); + $this->assertFalse($user->groups->isInitialized(), 'The collection must not be initialized'); $this->assertEquals($queryCount + 1, $this->getCurrentQueryCount()); } public function testContainsKeyIndexByManyToManyNonOwning() { - $user = $this->_em->find(CmsUser::class, $this->userId2); + $user = $this->_em->find(CmsUser::class, $this->userId2); $group = $this->_em->find(CmsGroup::class, $this->groupId); $queryCount = $this->getCurrentQueryCount(); $contains = $group->users->containsKey($user->username); - $this->assertTrue($contains, "The item is not into collection"); - $this->assertFalse($group->users->isInitialized(), "The collection must not be initialized"); + $this->assertTrue($contains, 'The item is not into collection'); + $this->assertFalse($group->users->isInitialized(), 'The collection must not be initialized'); $this->assertEquals($queryCount + 1, $this->getCurrentQueryCount()); } public function testContainsKeyIndexByWithPkManyToMany() { - $class = $this->_em->getClassMetadata(CmsUser::class); + $class = $this->_em->getClassMetadata(CmsUser::class); $class->associationMappings['groups']['indexBy'] = 'id'; $user = $this->_em->find(CmsUser::class, $this->userId2); @@ -779,13 +782,13 @@ public function testContainsKeyIndexByWithPkManyToMany() $contains = $user->groups->containsKey($this->groupId); - $this->assertTrue($contains, "The item is not into collection"); - $this->assertFalse($user->groups->isInitialized(), "The collection must not be initialized"); + $this->assertTrue($contains, 'The item is not into collection'); + $this->assertFalse($user->groups->isInitialized(), 'The collection must not be initialized'); $this->assertEquals($queryCount + 1, $this->getCurrentQueryCount()); } public function testContainsKeyIndexByWithPkManyToManyNonOwning() { - $class = $this->_em->getClassMetadata(CmsGroup::class); + $class = $this->_em->getClassMetadata(CmsGroup::class); $class->associationMappings['users']['indexBy'] = 'id'; $group = $this->_em->find(CmsGroup::class, $this->groupId); @@ -794,8 +797,8 @@ public function testContainsKeyIndexByWithPkManyToManyNonOwning() $contains = $group->users->containsKey($this->userId2); - $this->assertTrue($contains, "The item is not into collection"); - $this->assertFalse($group->users->isInitialized(), "The collection must not be initialized"); + $this->assertTrue($contains, 'The item is not into collection'); + $this->assertFalse($group->users->isInitialized(), 'The collection must not be initialized'); $this->assertEquals($queryCount + 1, $this->getCurrentQueryCount()); } @@ -805,7 +808,7 @@ public function testContainsKeyNonExistentIndexByOneToMany() $queryCount = $this->getCurrentQueryCount(); - $contains = $user->articles->containsKey("NonExistentTopic"); + $contains = $user->articles->containsKey('NonExistentTopic'); $this->assertFalse($contains); $this->assertFalse($user->articles->isInitialized()); @@ -816,10 +819,9 @@ public function testContainsKeyNonExistentIndexByManyToMany() { $user = $this->_em->find(CmsUser::class, $this->userId2); - $queryCount = $this->getCurrentQueryCount(); - $contains = $user->groups->containsKey("NonExistentTopic"); + $contains = $user->groups->containsKey('NonExistentTopic'); $this->assertFalse($contains); $this->assertFalse($user->groups->isInitialized()); @@ -828,39 +830,39 @@ public function testContainsKeyNonExistentIndexByManyToMany() private function loadFixture() { - $user1 = new CmsUser(); - $user1->username = "beberlei"; - $user1->name = "Benjamin"; - $user1->status = "active"; - - $user2 = new CmsUser(); - $user2->username = "jwage"; - $user2->name = "Jonathan"; - $user2->status = "active"; - - $user3 = new CmsUser(); - $user3->username = "romanb"; - $user3->name = "Roman"; - $user3->status = "active"; - - $user4 = new CmsUser(); - $user4->username = "gblanco"; - $user4->name = "Guilherme"; - $user4->status = "active"; + $user1 = new CmsUser(); + $user1->username = 'beberlei'; + $user1->name = 'Benjamin'; + $user1->status = 'active'; + + $user2 = new CmsUser(); + $user2->username = 'jwage'; + $user2->name = 'Jonathan'; + $user2->status = 'active'; + + $user3 = new CmsUser(); + $user3->username = 'romanb'; + $user3->name = 'Roman'; + $user3->status = 'active'; + + $user4 = new CmsUser(); + $user4->username = 'gblanco'; + $user4->name = 'Guilherme'; + $user4->status = 'active'; $this->_em->persist($user1); $this->_em->persist($user2); $this->_em->persist($user3); $this->_em->persist($user4); - $group1 = new CmsGroup(); - $group1->name = "Test1"; + $group1 = new CmsGroup(); + $group1->name = 'Test1'; - $group2 = new CmsGroup(); - $group2->name = "Test2"; + $group2 = new CmsGroup(); + $group2->name = 'Test2'; - $group3 = new CmsGroup(); - $group3->name = "Test3"; + $group3 = new CmsGroup(); + $group3->name = 'Test3'; $user1->addGroup($group1); $user1->addGroup($group2); @@ -874,23 +876,23 @@ private function loadFixture() $this->_em->persist($group2); $this->_em->persist($group3); - $article1 = new CmsArticle(); - $article1->topic = "Test1"; - $article1->text = "Test1"; + $article1 = new CmsArticle(); + $article1->topic = 'Test1'; + $article1->text = 'Test1'; $article1->setAuthor($user1); - $article2 = new CmsArticle(); - $article2->topic = "Test2"; - $article2->text = "Test2"; + $article2 = new CmsArticle(); + $article2->topic = 'Test2'; + $article2->text = 'Test2'; $article2->setAuthor($user1); $this->_em->persist($article1); $this->_em->persist($article2); - $phonenumber1 = new CmsPhonenumber(); + $phonenumber1 = new CmsPhonenumber(); $phonenumber1->phonenumber = '12345'; - $phonenumber2 = new CmsPhonenumber(); + $phonenumber2 = new CmsPhonenumber(); $phonenumber2->phonenumber = '67890'; $this->_em->persist($phonenumber1); @@ -899,7 +901,7 @@ private function loadFixture() $user1->addPhonenumber($phonenumber1); // DDC-2504 - $otherClass = new DDC2504OtherClass(); + $otherClass = new DDC2504OtherClass(); $childClass1 = new DDC2504ChildClass(); $childClass2 = new DDC2504ChildClass(); @@ -916,18 +918,17 @@ private function loadFixture() $this->_em->flush(); $this->_em->clear(); - $this->articleId = $article1->id; - $this->userId = $user1->getId(); - $this->userId2 = $user2->getId(); - $this->groupId = $group1->id; + $this->articleId = $article1->id; + $this->userId = $user1->getId(); + $this->userId2 = $user2->getId(); + $this->groupId = $group1->id; $this->ddc2504OtherClassId = $otherClass->id; $this->ddc2504ChildClassId = $childClass1->id; - $this->username = $user1->username; - $this->groupname = $group1->name; - $this->topic = $article1->topic; + $this->username = $user1->username; + $this->groupname = $group1->name; + $this->topic = $article1->topic; $this->phonenumber = $phonenumber1->phonenumber; - } /** @@ -935,16 +936,16 @@ private function loadFixture() */ public function testRemoveManagedElementFromOneToManyExtraLazyCollectionIsNoOp() { - list($userId, $tweetId) = $this->loadTweetFixture(); + [$userId, $tweetId] = $this->loadTweetFixture(); - /* @var $user User */ + /** @var User $user */ $user = $this->_em->find(User::class, $userId); $user->tweets->removeElement($this->_em->find(Tweet::class, $tweetId)); $this->_em->clear(); - /* @var $user User */ + /** @var User $user */ $user = $this->_em->find(User::class, $userId); $this->assertCount(1, $user->tweets, 'Element was not removed - need to update the owning side first'); @@ -955,9 +956,9 @@ public function testRemoveManagedElementFromOneToManyExtraLazyCollectionIsNoOp() */ public function testRemoveManagedElementFromOneToManyExtraLazyCollectionWithoutDeletingTheTargetEntityEntryIsNoOp() { - list($userId, $tweetId) = $this->loadTweetFixture(); + [$userId, $tweetId] = $this->loadTweetFixture(); - /* @var $user User */ + /** @var User $user */ $user = $this->_em->find(User::class, $userId); $tweet = $this->_em->find(Tweet::class, $tweetId); @@ -965,7 +966,7 @@ public function testRemoveManagedElementFromOneToManyExtraLazyCollectionWithoutD $this->_em->clear(); - /* @var $tweet Tweet */ + /** @var Tweet $tweet */ $tweet = $this->_em->find(Tweet::class, $tweetId); $this->assertInstanceOf( Tweet::class, @@ -985,9 +986,9 @@ public function testRemoveManagedElementFromOneToManyExtraLazyCollectionWithoutD */ public function testRemovingManagedLazyProxyFromExtraLazyOneToManyDoesRemoveTheAssociationButNotTheEntity() { - list($userId, $tweetId) = $this->loadTweetFixture(); + [$userId, $tweetId] = $this->loadTweetFixture(); - /* @var $user User */ + /** @var User $user */ $user = $this->_em->find(User::class, $userId); $tweet = $this->_em->getReference(Tweet::class, $tweetId); @@ -995,7 +996,7 @@ public function testRemovingManagedLazyProxyFromExtraLazyOneToManyDoesRemoveTheA $this->_em->clear(); - /* @var $tweet Tweet */ + /** @var Tweet $tweet */ $tweet = $this->_em->find(Tweet::class, $tweet->id); $this->assertInstanceOf( Tweet::class, @@ -1005,7 +1006,7 @@ public function testRemovingManagedLazyProxyFromExtraLazyOneToManyDoesRemoveTheA $this->assertInstanceOf(User::class, $tweet->author); - /* @var $user User */ + /** @var User $user */ $user = $this->_em->find(User::class, $userId); $this->assertCount(1, $user->tweets, 'Element was not removed - need to update the owning side first'); @@ -1016,16 +1017,16 @@ public function testRemovingManagedLazyProxyFromExtraLazyOneToManyDoesRemoveTheA */ public function testRemoveOrphanedManagedElementFromOneToManyExtraLazyCollection() { - list($userId, $userListId) = $this->loadUserListFixture(); + [$userId, $userListId] = $this->loadUserListFixture(); - /* @var $user User */ + /** @var User $user */ $user = $this->_em->find(User::class, $userId); $user->userLists->removeElement($this->_em->find(UserList::class, $userListId)); $this->_em->clear(); - /* @var $user User */ + /** @var User $user */ $user = $this->_em->find(User::class, $userId); $this->assertCount(0, $user->userLists, 'Element was removed from association due to orphan removal'); @@ -1040,16 +1041,16 @@ public function testRemoveOrphanedManagedElementFromOneToManyExtraLazyCollection */ public function testRemoveOrphanedUnManagedElementFromOneToManyExtraLazyCollection() { - list($userId, $userListId) = $this->loadUserListFixture(); + [$userId, $userListId] = $this->loadUserListFixture(); - /* @var $user User */ + /** @var User $user */ $user = $this->_em->find(User::class, $userId); $user->userLists->removeElement(new UserList()); $this->_em->clear(); - /* @var $userList UserList */ + /** @var UserList $userList */ $userList = $this->_em->find(UserList::class, $userListId); $this->assertInstanceOf( UserList::class, @@ -1069,16 +1070,16 @@ public function testRemoveOrphanedUnManagedElementFromOneToManyExtraLazyCollecti */ public function testRemoveOrphanedManagedLazyProxyFromExtraLazyOneToMany() { - list($userId, $userListId) = $this->loadUserListFixture(); + [$userId, $userListId] = $this->loadUserListFixture(); - /* @var $user User */ + /** @var User $user */ $user = $this->_em->find(User::class, $userId); $user->userLists->removeElement($this->_em->getReference(UserList::class, $userListId)); $this->_em->clear(); - /* @var $user User */ + /** @var User $user */ $user = $this->_em->find(User::class, $userId); $this->assertCount(0, $user->userLists, 'Element was removed from association due to orphan removal'); @@ -1117,7 +1118,7 @@ private function loadUserListFixture() $user = new User(); $userList = new UserList(); - $user->name = 'ocramius'; + $user->name = 'ocramius'; $userList->listName = 'PHP Developers to follow closely'; $user->addUserList($userList); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/GH7864Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/GH7864Test.php index babe42de1d..dc428f5877 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/GH7864Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/GH7864Test.php @@ -1,11 +1,15 @@ name = "test"; + $user = new User(); + $user->name = 'test'; - $tweet1 = new Tweet(); - $tweet1->content = "Hello World!"; + $tweet1 = new Tweet(); + $tweet1->content = 'Hello World!'; $user->addTweet($tweet1); - $tweet2 = new Tweet(); - $tweet2->content = "Goodbye, and thanks for all the fish"; + $tweet2 = new Tweet(); + $tweet2->content = 'Goodbye, and thanks for all the fish'; $user->addTweet($tweet2); $this->_em->persist($user); @@ -33,12 +37,14 @@ public function testExtraLazyRemoveElement() $this->_em->flush(); $this->_em->clear(); - $user = $this->_em->find(User::class, $user->id); + $user = $this->_em->find(User::class, $user->id); $tweet = $this->_em->find(Tweet::class, $tweet1->id); $user->tweets->removeElement($tweet); - $tweets = $user->tweets->map(function (Tweet $tweet) { return $tweet->content; }); + $tweets = $user->tweets->map(static function (Tweet $tweet) { + return $tweet->content; + }); $this->assertEquals(['Goodbye, and thanks for all the fish'], array_values($tweets->toArray())); } From 1e628370c488425ae17e638e903507aa0a160e84 Mon Sep 17 00:00:00 2001 From: Benjamin Eberlei Date: Tue, 3 Dec 2019 19:35:49 +0100 Subject: [PATCH 040/136] [GH-7864] Address review comments. --- lib/Doctrine/ORM/PersistentCollection.php | 2 +- .../ORM/Functional/Ticket/GH7864Test.php | 68 ++++++++++++++++--- 2 files changed, 59 insertions(+), 11 deletions(-) diff --git a/lib/Doctrine/ORM/PersistentCollection.php b/lib/Doctrine/ORM/PersistentCollection.php index b10a17340b..0a1a1f0244 100644 --- a/lib/Doctrine/ORM/PersistentCollection.php +++ b/lib/Doctrine/ORM/PersistentCollection.php @@ -380,7 +380,7 @@ public function removeElement($element) if ($persister->removeElement($this, $element) === true) { // only owning side or orphan removal triggers successful - // delete so that we can keep this collection unitialized. + // delete so that we can keep this collection uninitialized. return true; } } diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/GH7864Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/GH7864Test.php index dc428f5877..4c1bb64e69 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/GH7864Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/GH7864Test.php @@ -4,30 +4,37 @@ namespace Doctrine\Tests\ORM\Functional\Ticket; -use Doctrine\Tests\Models\Tweet\Tweet; -use Doctrine\Tests\Models\Tweet\User; +use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Tests\OrmFunctionalTestCase; use function array_values; +/** + * @group gh7864 + */ class GH7864Test extends OrmFunctionalTestCase { protected function setUp() : void { - $this->useModelSet('tweet'); - parent::setup(); + + $this->setUpEntitySchema( + [ + GH7864User::class, + GH7864Tweet::class, + ] + ); } public function testExtraLazyRemoveElement() { - $user = new User(); + $user = new GH7864User(); $user->name = 'test'; - $tweet1 = new Tweet(); + $tweet1 = new GH7864Tweet(); $tweet1->content = 'Hello World!'; $user->addTweet($tweet1); - $tweet2 = new Tweet(); + $tweet2 = new GH7864Tweet(); $tweet2->content = 'Goodbye, and thanks for all the fish'; $user->addTweet($tweet2); @@ -37,15 +44,56 @@ public function testExtraLazyRemoveElement() $this->_em->flush(); $this->_em->clear(); - $user = $this->_em->find(User::class, $user->id); - $tweet = $this->_em->find(Tweet::class, $tweet1->id); + $user = $this->_em->find(GH7864User::class, $user->id); + $tweet = $this->_em->find(GH7864Tweet::class, $tweet1->id); $user->tweets->removeElement($tweet); - $tweets = $user->tweets->map(static function (Tweet $tweet) { + $tweets = $user->tweets->map(static function (GH7864Tweet $tweet) { return $tweet->content; }); $this->assertEquals(['Goodbye, and thanks for all the fish'], array_values($tweets->toArray())); } } + +/** + * @Entity + */ +class GH7864User +{ + /** @Id @Column(type="integer") @GeneratedValue */ + public $id; + + /** @Column(type="string") */ + public $name; + + /** @OneToMany(targetEntity="GH7864Tweet", mappedBy="user", fetch="EXTRA_LAZY") */ + public $tweets; + + public function __construct() + { + $this->tweets = new ArrayCollection(); + } + + public function addTweet(GH7864Tweet $tweet) + { + $tweet->user = $this; + $this->tweets->add($tweet); + } +} + +/** + * @Entity + */ +class GH7864Tweet +{ + /** @Id @Column(type="integer") @GeneratedValue */ + public $id; + + /** @Column(type="string") */ + public $content; + + /** @ManyToOne(targetEntity="GH7864User", inversedBy="tweets") */ + public $user; +} From bfc68b3abaa858e88842cc5215e40fe4ca5ebb24 Mon Sep 17 00:00:00 2001 From: Benjamin Eberlei Date: Tue, 3 Dec 2019 20:34:44 +0100 Subject: [PATCH 041/136] Add warning about removeElement on extra lazy --- docs/en/tutorials/extra-lazy-associations.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/en/tutorials/extra-lazy-associations.rst b/docs/en/tutorials/extra-lazy-associations.rst index 84e9e7f098..beb9c4ec59 100644 --- a/docs/en/tutorials/extra-lazy-associations.rst +++ b/docs/en/tutorials/extra-lazy-associations.rst @@ -36,6 +36,13 @@ With extra lazy collections you can now not only add entities to large collectio easily using a combination of ``count`` and ``slice``. +.. warning:: + + Using ``removeElement`` will directly issue DELETE queries to the database. + This circumvents the flush operation and might run outside a transactional + boundary if you don't create one yourself. + + Enabling Extra-Lazy Associations ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ From 041404e8b351fde94b749738d85a932a4730e16a Mon Sep 17 00:00:00 2001 From: Benjamin Eberlei Date: Fri, 6 Dec 2019 23:55:49 +0100 Subject: [PATCH 042/136] [GH-7864] Revert removeElement EXTRA_LAZY support. --- docs/en/tutorials/extra-lazy-associations.rst | 9 +- .../AbstractCollectionPersister.php | 14 - lib/Doctrine/ORM/PersistentCollection.php | 18 - .../Collection/CollectionPersister.php | 10 - .../Collection/ManyToManyPersister.php | 16 - .../Collection/OneToManyPersister.php | 22 -- .../AbstractCollectionPersisterTest.php | 17 - .../Functional/ExtraLazyCollectionTest.php | 308 ------------------ 8 files changed, 5 insertions(+), 409 deletions(-) diff --git a/docs/en/tutorials/extra-lazy-associations.rst b/docs/en/tutorials/extra-lazy-associations.rst index beb9c4ec59..1146290428 100644 --- a/docs/en/tutorials/extra-lazy-associations.rst +++ b/docs/en/tutorials/extra-lazy-associations.rst @@ -19,7 +19,6 @@ can be called without triggering a full load of the collection: - ``Collection#count()`` - ``Collection#get($key)`` (available with Doctrine 2.4) - ``Collection#slice($offset, $length = null)`` -- ``Collection#removeElement($element)`` for either owning side collections or inverse collections with orphanRemoval=true For each of the above methods the following semantics apply: @@ -38,9 +37,11 @@ easily using a combination of ``count`` and ``slice``. .. warning:: - Using ``removeElement`` will directly issue DELETE queries to the database. - This circumvents the flush operation and might run outside a transactional - boundary if you don't create one yourself. + ``removeElement`` directly issued DELETE queries to the database from + version 2.4.0 to 2.7.0. This circumvents the flush operation and might run + outside a transactional boundary if you don't create one yourself. We + consider this a critical bug in the assumptio of how the ORM works and + reverted ``removeElement`` EXTRA_LAZY behavior in 2.7.1. Enabling Extra-Lazy Associations diff --git a/lib/Doctrine/ORM/Cache/Persister/Collection/AbstractCollectionPersister.php b/lib/Doctrine/ORM/Cache/Persister/Collection/AbstractCollectionPersister.php index 7a10d17d93..c13c20774a 100644 --- a/lib/Doctrine/ORM/Cache/Persister/Collection/AbstractCollectionPersister.php +++ b/lib/Doctrine/ORM/Cache/Persister/Collection/AbstractCollectionPersister.php @@ -243,20 +243,6 @@ public function get(PersistentCollection $collection, $index) return $this->persister->get($collection, $index); } - /** - * {@inheritdoc} - */ - public function removeElement(PersistentCollection $collection, $element) - { - if ($persisterResult = $this->persister->removeElement($collection, $element)) { - $this->evictCollectionCache($collection); - $this->evictElementCache($this->sourceEntity->rootEntityName, $collection->getOwner()); - $this->evictElementCache($this->targetEntity->rootEntityName, $element); - } - - return $persisterResult; - } - /** * {@inheritdoc} */ diff --git a/lib/Doctrine/ORM/PersistentCollection.php b/lib/Doctrine/ORM/PersistentCollection.php index 0a1a1f0244..6cfb341928 100644 --- a/lib/Doctrine/ORM/PersistentCollection.php +++ b/lib/Doctrine/ORM/PersistentCollection.php @@ -367,24 +367,6 @@ public function remove($key) */ public function removeElement($element) { - if ( ! $this->initialized && $this->association['fetch'] === ClassMetadata::FETCH_EXTRA_LAZY) { - if ($this->collection->contains($element)) { - return $this->collection->removeElement($element); - } - - if ($this->em->getUnitOfWork()->getEntityState($element) === UnitOfWork::STATE_NEW) { - return true; - } - - $persister = $this->em->getUnitOfWork()->getCollectionPersister($this->association); - - if ($persister->removeElement($this, $element) === true) { - // only owning side or orphan removal triggers successful - // delete so that we can keep this collection uninitialized. - return true; - } - } - $removed = parent::removeElement($element); if ( ! $removed) { diff --git a/lib/Doctrine/ORM/Persisters/Collection/CollectionPersister.php b/lib/Doctrine/ORM/Persisters/Collection/CollectionPersister.php index 36b5706a07..3a30c99038 100644 --- a/lib/Doctrine/ORM/Persisters/Collection/CollectionPersister.php +++ b/lib/Doctrine/ORM/Persisters/Collection/CollectionPersister.php @@ -90,16 +90,6 @@ public function contains(PersistentCollection $collection, $element); */ public function containsKey(PersistentCollection $collection, $key); - /** - * Removes an element. - * - * @param \Doctrine\ORM\PersistentCollection $collection - * @param object $element - * - * @return mixed - */ - public function removeElement(PersistentCollection $collection, $element); - /** * Gets an element by key. * diff --git a/lib/Doctrine/ORM/Persisters/Collection/ManyToManyPersister.php b/lib/Doctrine/ORM/Persisters/Collection/ManyToManyPersister.php index c817f60979..208504bfa7 100644 --- a/lib/Doctrine/ORM/Persisters/Collection/ManyToManyPersister.php +++ b/lib/Doctrine/ORM/Persisters/Collection/ManyToManyPersister.php @@ -211,22 +211,6 @@ public function contains(PersistentCollection $collection, $element) return (bool) $this->conn->fetchColumn($sql, $params, 0, $types); } - /** - * {@inheritDoc} - */ - public function removeElement(PersistentCollection $collection, $element) - { - if ( ! $this->isValidEntityState($element)) { - return false; - } - - list($quotedJoinTable, $whereClauses, $params, $types) = $this->getJoinTableRestrictions($collection, $element, false); - - $sql = 'DELETE FROM ' . $quotedJoinTable . ' WHERE ' . implode(' AND ', $whereClauses); - - return (bool) $this->conn->executeUpdate($sql, $params, $types); - } - /** * {@inheritDoc} */ diff --git a/lib/Doctrine/ORM/Persisters/Collection/OneToManyPersister.php b/lib/Doctrine/ORM/Persisters/Collection/OneToManyPersister.php index 82115071f3..21dc4baaa4 100644 --- a/lib/Doctrine/ORM/Persisters/Collection/OneToManyPersister.php +++ b/lib/Doctrine/ORM/Persisters/Collection/OneToManyPersister.php @@ -166,28 +166,6 @@ public function contains(PersistentCollection $collection, $element) return $persister->exists($element, $criteria); } - /** - * {@inheritdoc} - */ - public function removeElement(PersistentCollection $collection, $element) - { - $mapping = $collection->getMapping(); - - if ( ! $mapping['orphanRemoval']) { - // no-op: this is not the owning side, therefore no operations should be applied - return false; - } - - if ( ! $this->isValidEntityState($element)) { - return false; - } - - return $this - ->uow - ->getEntityPersister($mapping['targetEntity']) - ->delete($element); - } - /** * {@inheritdoc} */ diff --git a/tests/Doctrine/Tests/ORM/Cache/Persister/Collection/AbstractCollectionPersisterTest.php b/tests/Doctrine/Tests/ORM/Cache/Persister/Collection/AbstractCollectionPersisterTest.php index c950cea70d..fed92a3972 100644 --- a/tests/Doctrine/Tests/ORM/Cache/Persister/Collection/AbstractCollectionPersisterTest.php +++ b/tests/Doctrine/Tests/ORM/Cache/Persister/Collection/AbstractCollectionPersisterTest.php @@ -227,23 +227,6 @@ public function testInvokeContainsKey() $this->assertFalse($persister->containsKey($collection, 0)); } - public function testInvokeRemoveElement() - { - $entity = new State("Foo"); - $element = new State("Bar"); - $persister = $this->createPersisterDefault(); - $collection = $this->createCollection($entity); - - $this->em->getUnitOfWork()->registerManaged($entity, ['id'=>1], ['id'=>1, 'name'=>'Foo']); - - $this->collectionPersister->expects($this->once()) - ->method('removeElement') - ->with($this->equalTo($collection), $this->equalTo($element)) - ->will($this->returnValue(false)); - - $this->assertFalse($persister->removeElement($collection, $element)); - } - public function testInvokeGet() { $entity = new State("Foo"); diff --git a/tests/Doctrine/Tests/ORM/Functional/ExtraLazyCollectionTest.php b/tests/Doctrine/Tests/ORM/Functional/ExtraLazyCollectionTest.php index 955ae66cb8..cfd303fcf1 100644 --- a/tests/Doctrine/Tests/ORM/Functional/ExtraLazyCollectionTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/ExtraLazyCollectionTest.php @@ -480,114 +480,6 @@ public function testContainsManyToManyInverse() $this->assertFalse($user->groups->isInitialized(), 'Post-Condition: Collection is not initialized.'); } - /** - * @group DDC-2504 - */ - public function testRemovalOfNewManagedElementFromOneToManyJoinedInheritanceCollectionDoesNotInitializeIt() - { - $otherClass = $this->_em->find(DDC2504OtherClass::class, $this->ddc2504OtherClassId); - $childClass = new DDC2504ChildClass(); - - $this->_em->persist($childClass); - $this->_em->flush(); - - $queryCount = $this->getCurrentQueryCount(); - - $otherClass->childClasses->add($childClass); - $otherClass->childClasses->removeElement($childClass); - - $this->assertEquals( - $queryCount, - $this->getCurrentQueryCount(), - 'No queries are executed, as the owning side of the association is not actually updated.' - ); - $this->assertFalse($otherClass->childClasses->isInitialized(), 'Collection is not initialized.'); - } - - /** - * @group non-cacheable - */ - public function testRemoveElementManyToMany() - { - $user = $this->_em->find(CmsUser::class, $this->userId); - $this->assertFalse($user->groups->isInitialized(), 'Pre-Condition: Collection is not initialized.'); - - // Test Many to Many removal with Entity retrieved from DB - $group = $this->_em->find(CmsGroup::class, $this->groupId); - $queryCount = $this->getCurrentQueryCount(); - - $this->assertTrue($user->groups->removeElement($group)); - - $this->assertEquals($queryCount + 1, $this->getCurrentQueryCount(), 'Removing a persisted entity should cause one query to be executed.'); - $this->assertFalse($user->groups->isInitialized(), 'Post-Condition: Collection is not initialized.'); - - $this->assertFalse($user->groups->removeElement($group), 'Removing an already removed element returns false'); - $this->assertTrue($user->groups->isInitialized(), 'Post-Condition: Remmoving entity that isnt in collection initializes'); - $this->_em->clear(); - - $user = $this->_em->find(CmsUser::class, $this->userId); - // Test Many to Many removal with Entity state as new - $group = new CmsGroup(); - $group->name = 'A New group!'; - - $queryCount = $this->getCurrentQueryCount(); - - $user->groups->removeElement($group); - - $this->assertEquals($queryCount, $this->getCurrentQueryCount(), 'Removing new entity should cause no query to be executed.'); - $this->assertFalse($user->groups->isInitialized(), 'Post-Condition: Collection is not initialized.'); - - // Test Many to Many removal with Entity state as clean - $this->_em->persist($group); - $this->_em->flush(); - - $queryCount = $this->getCurrentQueryCount(); - - $user->groups->removeElement($group); - - $this->assertTrue($user->groups->isInitialized(), 'Post-Condition: Collection is initialized.'); - $this->_em->clear(); - - $user = $this->_em->find(CmsUser::class, $this->userId); - - // Test Many to Many removal with Entity state as managed - $group = new CmsGroup(); - $group->name = 'A New group!'; - - $this->_em->persist($group); - - $queryCount = $this->getCurrentQueryCount(); - - $user->groups->removeElement($group); - - $this->assertEquals($queryCount + 1, $this->getCurrentQueryCount(), 'Removing a managed entity should cause query to be executed.'); - $this->assertTrue($user->groups->isInitialized(), 'Post-Condition: Collection is initialized.'); - } - - public function testRemoveElementManyToManyInverse() - { - $group = $this->_em->find(CmsGroup::class, $this->groupId); - $this->assertFalse($group->users->isInitialized(), 'Pre-Condition: Collection is not initialized.'); - - $user = $this->_em->find(CmsUser::class, $this->userId); - $queryCount = $this->getCurrentQueryCount(); - - $group->users->removeElement($user); - - $this->assertEquals($queryCount + 1, $this->getCurrentQueryCount(), 'Removing a managed entity should cause one query to be executed.'); - $this->assertFalse($user->groups->isInitialized(), 'Post-Condition: Collection is not initialized.'); - - $newUser = new CmsUser(); - $newUser->name = 'A New group!'; - - $queryCount = $this->getCurrentQueryCount(); - - $group->users->removeElement($newUser); - - $this->assertEquals($queryCount, $this->getCurrentQueryCount(), 'Removing a new entity should cause no query to be executed.'); - $this->assertFalse($user->groups->isInitialized(), 'Post-Condition: Collection is not initialized.'); - } - /** * @group DDC-1399 */ @@ -930,204 +822,4 @@ private function loadFixture() $this->topic = $article1->topic; $this->phonenumber = $phonenumber1->phonenumber; } - - /** - * @group DDC-3343 - */ - public function testRemoveManagedElementFromOneToManyExtraLazyCollectionIsNoOp() - { - [$userId, $tweetId] = $this->loadTweetFixture(); - - /** @var User $user */ - $user = $this->_em->find(User::class, $userId); - - $user->tweets->removeElement($this->_em->find(Tweet::class, $tweetId)); - - $this->_em->clear(); - - /** @var User $user */ - $user = $this->_em->find(User::class, $userId); - - $this->assertCount(1, $user->tweets, 'Element was not removed - need to update the owning side first'); - } - - /** - * @group DDC-3343 - */ - public function testRemoveManagedElementFromOneToManyExtraLazyCollectionWithoutDeletingTheTargetEntityEntryIsNoOp() - { - [$userId, $tweetId] = $this->loadTweetFixture(); - - /** @var User $user */ - $user = $this->_em->find(User::class, $userId); - $tweet = $this->_em->find(Tweet::class, $tweetId); - - $user->tweets->removeElement($tweet); - - $this->_em->clear(); - - /** @var Tweet $tweet */ - $tweet = $this->_em->find(Tweet::class, $tweetId); - $this->assertInstanceOf( - Tweet::class, - $tweet, - 'Even though the collection is extra lazy, the tweet should not have been deleted' - ); - - $this->assertInstanceOf( - User::class, - $tweet->author, - 'Tweet author link has not been removed - need to update the owning side first' - ); - } - - /** - * @group DDC-3343 - */ - public function testRemovingManagedLazyProxyFromExtraLazyOneToManyDoesRemoveTheAssociationButNotTheEntity() - { - [$userId, $tweetId] = $this->loadTweetFixture(); - - /** @var User $user */ - $user = $this->_em->find(User::class, $userId); - $tweet = $this->_em->getReference(Tweet::class, $tweetId); - - $user->tweets->removeElement($this->_em->getReference(Tweet::class, $tweetId)); - - $this->_em->clear(); - - /** @var Tweet $tweet */ - $tweet = $this->_em->find(Tweet::class, $tweet->id); - $this->assertInstanceOf( - Tweet::class, - $tweet, - 'Even though the collection is extra lazy, the tweet should not have been deleted' - ); - - $this->assertInstanceOf(User::class, $tweet->author); - - /** @var User $user */ - $user = $this->_em->find(User::class, $userId); - - $this->assertCount(1, $user->tweets, 'Element was not removed - need to update the owning side first'); - } - - /** - * @group DDC-3343 - */ - public function testRemoveOrphanedManagedElementFromOneToManyExtraLazyCollection() - { - [$userId, $userListId] = $this->loadUserListFixture(); - - /** @var User $user */ - $user = $this->_em->find(User::class, $userId); - - $user->userLists->removeElement($this->_em->find(UserList::class, $userListId)); - - $this->_em->clear(); - - /** @var User $user */ - $user = $this->_em->find(User::class, $userId); - - $this->assertCount(0, $user->userLists, 'Element was removed from association due to orphan removal'); - $this->assertNull( - $this->_em->find(UserList::class, $userListId), - 'Element was deleted due to orphan removal' - ); - } - - /** - * @group DDC-3343 - */ - public function testRemoveOrphanedUnManagedElementFromOneToManyExtraLazyCollection() - { - [$userId, $userListId] = $this->loadUserListFixture(); - - /** @var User $user */ - $user = $this->_em->find(User::class, $userId); - - $user->userLists->removeElement(new UserList()); - - $this->_em->clear(); - - /** @var UserList $userList */ - $userList = $this->_em->find(UserList::class, $userListId); - $this->assertInstanceOf( - UserList::class, - $userList, - 'Even though the collection is extra lazy + orphan removal, the user list should not have been deleted' - ); - - $this->assertInstanceOf( - User::class, - $userList->owner, - 'User list to owner link has not been removed' - ); - } - - /** - * @group DDC-3343 - */ - public function testRemoveOrphanedManagedLazyProxyFromExtraLazyOneToMany() - { - [$userId, $userListId] = $this->loadUserListFixture(); - - /** @var User $user */ - $user = $this->_em->find(User::class, $userId); - - $user->userLists->removeElement($this->_em->getReference(UserList::class, $userListId)); - - $this->_em->clear(); - - /** @var User $user */ - $user = $this->_em->find(User::class, $userId); - - $this->assertCount(0, $user->userLists, 'Element was removed from association due to orphan removal'); - $this->assertNull( - $this->_em->find(UserList::class, $userListId), - 'Element was deleted due to orphan removal' - ); - } - - /** - * @return int[] ordered tuple: user id and tweet id - */ - private function loadTweetFixture() - { - $user = new User(); - $tweet = new Tweet(); - - $user->name = 'ocramius'; - $tweet->content = 'The cat is on the table'; - - $user->addTweet($tweet); - - $this->_em->persist($user); - $this->_em->persist($tweet); - $this->_em->flush(); - $this->_em->clear(); - - return [$user->id, $tweet->id]; - } - - /** - * @return int[] ordered tuple: user id and user list id - */ - private function loadUserListFixture() - { - $user = new User(); - $userList = new UserList(); - - $user->name = 'ocramius'; - $userList->listName = 'PHP Developers to follow closely'; - - $user->addUserList($userList); - - $this->_em->persist($user); - $this->_em->persist($userList); - $this->_em->flush(); - $this->_em->clear(); - - return [$user->id, $userList->id]; - } } From f37c12834d0e2cccfbc4dcc4c04039ef82780007 Mon Sep 17 00:00:00 2001 From: Benjamin Morel Date: Fri, 29 Nov 2019 18:34:51 +0100 Subject: [PATCH 043/136] Fix Trying to access array offset on value of type null --- lib/Doctrine/ORM/Query/Parser.php | 2 +- tests/Doctrine/Tests/ORM/Query/ParserTest.php | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/lib/Doctrine/ORM/Query/Parser.php b/lib/Doctrine/ORM/Query/Parser.php index 7b3e8ff491..f87cf9e5d1 100644 --- a/lib/Doctrine/ORM/Query/Parser.php +++ b/lib/Doctrine/ORM/Query/Parser.php @@ -302,7 +302,7 @@ public function getAST() */ public function match($token) { - $lookaheadType = $this->lexer->lookahead['type']; + $lookaheadType = $this->lexer->lookahead['type'] ?? null; // Short-circuit on first condition, usually types match if ($lookaheadType === $token) { diff --git a/tests/Doctrine/Tests/ORM/Query/ParserTest.php b/tests/Doctrine/Tests/ORM/Query/ParserTest.php index b290812fc8..65937a0942 100644 --- a/tests/Doctrine/Tests/ORM/Query/ParserTest.php +++ b/tests/Doctrine/Tests/ORM/Query/ParserTest.php @@ -134,6 +134,24 @@ public function invalidMatches() ]; } + /** + * PHP 7.4 would fail with Notice: Trying to access array offset on value of type null. + * + * @see https://github.com/doctrine/orm/pull/7934 + * + * @group GH7934 + */ + public function testNullLookahead() : void + { + $query = new Query($this->_getTestEntityManager()); + $query->setDQL('SELECT CURRENT_TIMESTAMP()'); + + $parser = new Parser($query); + + $this->expectException(QueryException::class); + $parser->match(Lexer::T_SELECT); + } + private function createParser($dql) { $query = new Query($this->_getTestEntityManager()); From 85528f28e201336067684f4ec6e63c8f1a3ceb62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lu=C3=ADs=20Cobucci?= Date: Mon, 16 Dec 2019 21:22:23 +0100 Subject: [PATCH 044/136] Fix CS errors --- tests/Doctrine/Tests/VerifyDeprecations.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/Doctrine/Tests/VerifyDeprecations.php b/tests/Doctrine/Tests/VerifyDeprecations.php index 8ccd9472e6..43fe9887f5 100644 --- a/tests/Doctrine/Tests/VerifyDeprecations.php +++ b/tests/Doctrine/Tests/VerifyDeprecations.php @@ -1,10 +1,12 @@ Date: Mon, 16 Dec 2019 21:22:28 +0100 Subject: [PATCH 045/136] Ignore Doctrine\Common\Persistence\ObjectManagerDecorator deprecation Since applying the fixes requires bumping up the dependency, which isn't done in a patch release. This should be removed in v2.8.0. --- .../ORM/Decorator/EntityManagerDecoratorTest.php | 6 ++++++ tests/Doctrine/Tests/VerifyDeprecations.php | 13 +++++++++++++ 2 files changed, 19 insertions(+) diff --git a/tests/Doctrine/Tests/ORM/Decorator/EntityManagerDecoratorTest.php b/tests/Doctrine/Tests/ORM/Decorator/EntityManagerDecoratorTest.php index 14b06893b8..e38c56973b 100644 --- a/tests/Doctrine/Tests/ORM/Decorator/EntityManagerDecoratorTest.php +++ b/tests/Doctrine/Tests/ORM/Decorator/EntityManagerDecoratorTest.php @@ -28,6 +28,12 @@ class EntityManagerDecoratorTest extends TestCase */ private $wrapped; + /** @before */ + public function ignoreDeprecationMessagesFromDoctrinePersistence() : void + { + $this->ignoreDeprecationMessage('The Doctrine\Common\Persistence\ObjectManagerDecorator class is deprecated since doctrine/persistence 1.3 and will be removed in 2.0. Use \Doctrine\Persistence\ObjectManagerDecorator instead.'); + } + public function setUp() { $this->wrapped = $this->createMock(EntityManagerInterface::class); diff --git a/tests/Doctrine/Tests/VerifyDeprecations.php b/tests/Doctrine/Tests/VerifyDeprecations.php index 43fe9887f5..bd71337832 100644 --- a/tests/Doctrine/Tests/VerifyDeprecations.php +++ b/tests/Doctrine/Tests/VerifyDeprecations.php @@ -16,6 +16,9 @@ trait VerifyDeprecations /** @var string[] */ private $actualDeprecations = []; + /** @var string[] */ + private $ignoredDeprecations = []; + /** @var callable|null */ private $originalHandler; @@ -24,9 +27,14 @@ public function resetDeprecations() : void { $this->actualDeprecations = []; $this->expectedDeprecations = []; + $this->ignoredDeprecations = []; $this->originalHandler = set_error_handler( function (int $errorNumber, string $errorMessage) : void { + if (in_array($errorMessage, $this->ignoredDeprecations, true)) { + return; + } + $this->actualDeprecations[] = $errorMessage; }, E_USER_DEPRECATED @@ -54,6 +62,11 @@ public function validateDeprecationExpectations() : void ); } + protected function ignoreDeprecationMessage(string $message) : void + { + $this->ignoredDeprecations[] = $message; + } + protected function expectDeprecationMessage(string $message) : void { $this->expectedDeprecations[] = $message; From 5c2b6870bfa9efc5d06d6056a34958969e60b8ea Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Mon, 21 Oct 2019 23:32:06 +0200 Subject: [PATCH 046/136] Whitelist existing assets we know about from metadata in SchemaTool::getUpdateSchemaSql() --- lib/Doctrine/ORM/Tools/SchemaTool.php | 38 ++++++++++++++++++++++++--- 1 file changed, 34 insertions(+), 4 deletions(-) diff --git a/lib/Doctrine/ORM/Tools/SchemaTool.php b/lib/Doctrine/ORM/Tools/SchemaTool.php index 423ed3b532..4c46e329a8 100644 --- a/lib/Doctrine/ORM/Tools/SchemaTool.php +++ b/lib/Doctrine/ORM/Tools/SchemaTool.php @@ -19,7 +19,7 @@ namespace Doctrine\ORM\Tools; -use Doctrine\ORM\ORMException; +use Doctrine\DBAL\Schema\AbstractAsset; use Doctrine\DBAL\Schema\Comparator; use Doctrine\DBAL\Schema\Index; use Doctrine\DBAL\Schema\Schema; @@ -28,6 +28,7 @@ use Doctrine\DBAL\Schema\Visitor\RemoveNamespacedAssets; use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\Mapping\ClassMetadata; +use Doctrine\ORM\ORMException; use Doctrine\ORM\Tools\Event\GenerateSchemaTableEventArgs; use Doctrine\ORM\Tools\Event\GenerateSchemaEventArgs; @@ -891,10 +892,8 @@ public function updateSchema(array $classes, $saveMode = false) */ public function getUpdateSchemaSql(array $classes, $saveMode = false) { - $sm = $this->em->getConnection()->getSchemaManager(); - - $fromSchema = $sm->createSchema(); $toSchema = $this->getSchemaFromMetadata($classes); + $fromSchema = $this->createSchemaForComparison($toSchema); $comparator = new Comparator(); $schemaDiff = $comparator->compare($fromSchema, $toSchema); @@ -905,4 +904,35 @@ public function getUpdateSchemaSql(array $classes, $saveMode = false) return $schemaDiff->toSql($this->platform); } + + /** + * Creates the schema from the database, ensuring tables from the target schema are whitelisted for comparison. + */ + private function createSchemaForComparison(Schema $toSchema) : Schema + { + $connection = $this->em->getConnection(); + $schemaManager = $connection->getSchemaManager(); + + // backup schema assets filter + $config = $connection->getConfiguration(); + $previousFilter = $config->getSchemaAssetsFilter(); + + if ($previousFilter === null) { + return $schemaManager->createSchema(); + } + + // whitelist assets we already know about in $toSchema, use the existing filter otherwise + $config->setSchemaAssetsFilter(static function ($asset) use ($previousFilter, $toSchema) : bool { + $assetName = $asset instanceof AbstractAsset ? $asset->getName() : $asset; + + return $toSchema->hasTable($assetName) || $toSchema->hasSequence($assetName) || $previousFilter($asset); + }); + + try { + return $schemaManager->createSchema(); + } finally { + // restore schema assets filter + $config->setSchemaAssetsFilter($previousFilter); + } + } } From 9aa28b4e33dbf68f3ba66419ac65683398c02ce8 Mon Sep 17 00:00:00 2001 From: Laurent VOULLEMIER Date: Tue, 22 Oct 2019 17:55:30 +0200 Subject: [PATCH 047/136] Test asset whitelisting on SchemaTool#getUpdateSchemasSql() --- .../ORM/Functional/Ticket/GH7875Test.php | 136 ++++++++++++++++++ 1 file changed, 136 insertions(+) create mode 100644 tests/Doctrine/Tests/ORM/Functional/Ticket/GH7875Test.php diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/GH7875Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/GH7875Test.php new file mode 100644 index 0000000000..41fbaabdd8 --- /dev/null +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/GH7875Test.php @@ -0,0 +1,136 @@ +_em->getConnection(); + + $connection->exec('DROP TABLE IF EXISTS gh7875_my_entity'); + $connection->exec('DROP TABLE IF EXISTS gh7875_my_other_entity'); + + if ($connection->getDatabasePlatform() instanceof PostgreSqlPlatform) { + $connection->exec('DROP SEQUENCE IF EXISTS gh7875_my_entity_id_seq'); + $connection->exec('DROP SEQUENCE IF EXISTS gh7875_my_other_entity_id_seq'); + } + } + + /** + * @param string[] $sqls + * + * @return string[] + */ + private function filterCreateTable(array $sqls, string $tableName) : array + { + return array_filter($sqls, static function (string $sql) use ($tableName) : bool { + return strpos($sql, sprintf('CREATE TABLE %s (', $tableName)) === 0; + }); + } + + public function testUpdateSchemaSql() : void + { + $classes = [$this->_em->getClassMetadata(GH7875MyEntity::class)]; + + $tool = new SchemaTool($this->_em); + $sqls = $this->filterCreateTable($tool->getUpdateSchemaSql($classes), 'gh7875_my_entity'); + + self::assertCount(1, $sqls); + + $this->_em->getConnection()->exec(current($sqls)); + + $sqls = array_filter($tool->getUpdateSchemaSql($classes), static function (string $sql) : bool { + return strpos($sql, ' gh7875_my_entity ') !== false; + }); + + self::assertSame([], $sqls); + + $classes[] = $this->_em->getClassMetadata(GH7875MyOtherEntity::class); + + $sqls = $tool->getUpdateSchemaSql($classes); + + self::assertCount(0, $this->filterCreateTable($sqls, 'gh7875_my_entity')); + self::assertCount(1, $this->filterCreateTable($sqls, 'gh7875_my_other_entity')); + } + + /** + * @return array> + */ + public function provideUpdateSchemaSqlWithSchemaAssetFilter() : array + { + return [ + ['/^(?!my_enti)/', null], + [ + null, + static function ($assetName) : bool { + return $assetName !== 'gh7875_my_entity'; + }, + ], + ]; + } + + /** @dataProvider provideUpdateSchemaSqlWithSchemaAssetFilter */ + public function testUpdateSchemaSqlWithSchemaAssetFilter(?string $filterRegex, ?callable $filterCallback) : void + { + if ($filterRegex && ! method_exists(Configuration::class, 'setFilterSchemaAssetsExpression')) { + self::markTestSkipped(sprintf('Test require %s::setFilterSchemaAssetsExpression method', Configuration::class)); + } + + $classes = [$this->_em->getClassMetadata(GH7875MyEntity::class)]; + + $tool = new SchemaTool($this->_em); + $tool->createSchema($classes); + + $config = $this->_em->getConnection()->getConfiguration(); + if ($filterRegex) { + $config->setFilterSchemaAssetsExpression($filterRegex); + } else { + $config->setSchemaAssetsFilter($filterCallback); + } + + $previousFilter = $config->getSchemaAssetsFilter(); + + $sqls = $tool->getUpdateSchemaSql($classes); + $sqls = array_filter($sqls, static function (string $sql) : bool { + return strpos($sql, ' gh7875_my_entity ') !== false; + }); + + self::assertCount(0, $sqls); + self::assertSame($previousFilter, $config->getSchemaAssetsFilter()); + } +} + +/** + * @Entity + * @Table(name="gh7875_my_entity") + */ +class GH7875MyEntity +{ + /** @Id @Column(type="integer") @GeneratedValue(strategy="AUTO") */ + public $id; +} + +/** + * @Entity + * @Table(name="gh7875_my_other_entity") + */ +class GH7875MyOtherEntity +{ + /** @Id @Column(type="integer") @GeneratedValue(strategy="AUTO") */ + public $id; +} From 0ce14408842794a3a70f96303c1920b40cd2099b Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Sun, 24 Nov 2019 08:11:00 +0100 Subject: [PATCH 048/136] Add upgrade note about schema_filter change --- UPGRADE.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/UPGRADE.md b/UPGRADE.md index c6c6eaaa01..732adf8dd7 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -10,6 +10,12 @@ Method `Doctrine\ORM\AbstractQuery#useResultCache()` which could be used for bot To optimize DB interaction, `Doctrine\ORM\Tools\Pagination\Paginator` no longer fetches identifiers to be able to perform the pagination with join collections when max results isn't set in the query. +## Minor BC BREAK: tables filtered with `schema_filter` are no longer created + +When generating schema diffs, if a source table is filtered out by a `schema_filter` expression, then a `CREATE TABLE` was +always generated, even if the table already existed. This has been changed in this release and the table will no longer +be created. + ## Deprecated number unaware `Doctrine\ORM\Mapping\UnderscoreNamingStrategy` In the last patch of the `v2.6.x` series, we fixed a bug that was not converting names properly when they had numbers From d629c4e4873ece61a9c7d15718381647d8c97c07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lu=C3=ADs=20Cobucci?= Date: Tue, 17 Dec 2019 01:03:34 +0100 Subject: [PATCH 049/136] Remove build.xml and related files We aren't using ant/phing to handle the releases any more. --- build.properties | 3 -- build.properties.dev | 16 ------- build.xml | 101 ------------------------------------------- 3 files changed, 120 deletions(-) delete mode 100644 build.properties delete mode 100644 build.properties.dev delete mode 100644 build.xml diff --git a/build.properties b/build.properties deleted file mode 100644 index 4b4c921a55..0000000000 --- a/build.properties +++ /dev/null @@ -1,3 +0,0 @@ -# Version class and file -project.version_class = Doctrine\\ORM\\Version -project.version_file = lib/Doctrine/ORM/Version.php diff --git a/build.properties.dev b/build.properties.dev deleted file mode 100644 index 20e91dc372..0000000000 --- a/build.properties.dev +++ /dev/null @@ -1,16 +0,0 @@ -version=2.0.0BETA2 -dependencies.common=2.0.0BETA4 -dependencies.dbal=2.0.0BETA4 -stability=beta -build.dir=build -dist.dir=dist -report.dir=reports -log.archive.dir=logs -project.pirum_dir= -project.download_dir= -project.xsd_dir= -test.phpunit_configuration_file= -test.phpunit_generate_coverage=0 -test.pmd_reports=0 -test.pdepend_exec= -test.phpmd_exec= \ No newline at end of file diff --git a/build.xml b/build.xml deleted file mode 100644 index 26132d19ca..0000000000 --- a/build.xml +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - From d67e3e8b1bc21d6b313f57dfe1904e7895b01edc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lu=C3=ADs=20Cobucci?= Date: Tue, 17 Dec 2019 01:08:10 +0100 Subject: [PATCH 050/136] Rely on ocramius/package-versions to render the version Since `Doctrine\ORM\Version` is now deprecated it shall not be updated on future releases. This ensures that our CLI tool will present the correct version number. --- composer.json | 1 + composer.lock | 56 ++++++++++++++++++- .../ORM/Tools/Console/ConsoleRunner.php | 6 +- .../ORM/Tools/Console/ConsoleRunnerTest.php | 4 +- tests/Doctrine/Tests/ORM/Tools/SetupTest.php | 5 -- 5 files changed, 60 insertions(+), 12 deletions(-) diff --git a/composer.json b/composer.json index c74e9cff64..0881695f0e 100644 --- a/composer.json +++ b/composer.json @@ -26,6 +26,7 @@ "doctrine/event-manager": "^1.1", "doctrine/instantiator": "^1.3", "doctrine/persistence": "^1.2", + "ocramius/package-versions": "^1.4", "symfony/console": "^3.0|^4.0|^5.0" }, "require-dev": { diff --git a/composer.lock b/composer.lock index fc220d2356..ecb1204e60 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": "4e24e01f599825550170acce0dda0b49", + "content-hash": "aebc17b1c97778b6eae0d36bb1ecf03e", "packages": [ { "name": "doctrine/annotations", @@ -805,6 +805,56 @@ ], "time": "2018-06-14T14:45:07+00:00" }, + { + "name": "ocramius/package-versions", + "version": "1.4.2", + "source": { + "type": "git", + "url": "https://github.com/Ocramius/PackageVersions.git", + "reference": "44af6f3a2e2e04f2af46bcb302ad9600cba41c7d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Ocramius/PackageVersions/zipball/44af6f3a2e2e04f2af46bcb302ad9600cba41c7d", + "reference": "44af6f3a2e2e04f2af46bcb302ad9600cba41c7d", + "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.5.17" + }, + "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-11-15T16:17:10+00:00" + }, { "name": "psr/log", "version": "1.1.2", @@ -2673,8 +2723,8 @@ "authors": [ { "name": "Arne Blankerts", - "role": "Developer", - "email": "arne@blankerts.de" + "email": "arne@blankerts.de", + "role": "Developer" } ], "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", diff --git a/lib/Doctrine/ORM/Tools/Console/ConsoleRunner.php b/lib/Doctrine/ORM/Tools/Console/ConsoleRunner.php index c6a265cc07..a84db75f41 100644 --- a/lib/Doctrine/ORM/Tools/Console/ConsoleRunner.php +++ b/lib/Doctrine/ORM/Tools/Console/ConsoleRunner.php @@ -22,7 +22,8 @@ use Doctrine\DBAL\Tools\Console as DBALConsole; use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\Tools\Console\Helper\EntityManagerHelper; -use Doctrine\ORM\Version; +use OutOfBoundsException; +use PackageVersions\Versions; use Symfony\Component\Console\Application; use Symfony\Component\Console\Helper\HelperSet; @@ -70,10 +71,11 @@ public static function run(HelperSet $helperSet, array $commands = []) : void * @param array $commands * * @return \Symfony\Component\Console\Application + * @throws OutOfBoundsException */ public static function createApplication(HelperSet $helperSet, array $commands = []) : Application { - $cli = new Application('Doctrine Command Line Interface', Version::VERSION); + $cli = new Application('Doctrine Command Line Interface', Versions::getVersion('doctrine/orm')); $cli->setCatchExceptions(true); $cli->setHelperSet($helperSet); self::addCommands($cli); diff --git a/tests/Doctrine/Tests/ORM/Tools/Console/ConsoleRunnerTest.php b/tests/Doctrine/Tests/ORM/Tools/Console/ConsoleRunnerTest.php index a53ba514dd..62225a87e8 100644 --- a/tests/Doctrine/Tests/ORM/Tools/Console/ConsoleRunnerTest.php +++ b/tests/Doctrine/Tests/ORM/Tools/Console/ConsoleRunnerTest.php @@ -3,8 +3,8 @@ namespace Doctrine\Tests\ORM\Tools\Console; use Doctrine\ORM\Tools\Console\ConsoleRunner; -use Doctrine\ORM\Version; use Doctrine\Tests\DoctrineTestCase; +use PackageVersions\Versions; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Helper\HelperSet; @@ -21,7 +21,7 @@ public function testCreateApplicationShouldReturnAnApplicationWithTheCorrectComm $app = ConsoleRunner::createApplication($helperSet); self::assertSame($helperSet, $app->getHelperSet()); - self::assertEquals(Version::VERSION, $app->getVersion()); + self::assertSame(Versions::getVersion('doctrine/orm'), $app->getVersion()); self::assertTrue($app->has('dbal:import')); self::assertTrue($app->has('dbal:reserved-words')); diff --git a/tests/Doctrine/Tests/ORM/Tools/SetupTest.php b/tests/Doctrine/Tests/ORM/Tools/SetupTest.php index 3678a4cf4c..99fafe4390 100644 --- a/tests/Doctrine/Tests/ORM/Tools/SetupTest.php +++ b/tests/Doctrine/Tests/ORM/Tools/SetupTest.php @@ -9,7 +9,6 @@ use Doctrine\ORM\Mapping\Driver\XmlDriver; use Doctrine\ORM\Mapping\Driver\YamlDriver; use Doctrine\ORM\Tools\Setup; -use Doctrine\ORM\Version; use Doctrine\Tests\OrmTestCase; use Doctrine\Tests\VerifyDeprecations; @@ -22,10 +21,6 @@ class SetupTest extends OrmTestCase public function setUp() { - if (strpos(Version::VERSION, "DEV") === false) { - $this->markTestSkipped("Test only runs in a dev-installation from Github"); - } - $this->originalAutoloaderCount = count(spl_autoload_functions()); $this->originalIncludePath = get_include_path(); } From 324aacfb54d5eb8ec60f8d3c11ea39fbfb3ff417 Mon Sep 17 00:00:00 2001 From: William Pinaud Date: Wed, 8 Jan 2020 18:52:11 +0100 Subject: [PATCH 051/136] Just a micro grammar update. --- docs/en/reference/annotations-reference.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/reference/annotations-reference.rst b/docs/en/reference/annotations-reference.rst index 20381da598..42c232526e 100644 --- a/docs/en/reference/annotations-reference.rst +++ b/docs/en/reference/annotations-reference.rst @@ -99,7 +99,7 @@ Optional attributes: - **length**: Used by the "string" type to determine its maximum length in the database. Doctrine does not validate the length of a - string values for you. + string value for you. - **precision**: The precision for a decimal (exact numeric) column (applies only for decimal column), which is the maximum number of From 20c46035d129a478e438a4c65d94063ef234f4ea Mon Sep 17 00:00:00 2001 From: Woody Gilk Date: Wed, 8 Jan 2020 19:36:08 +0100 Subject: [PATCH 052/136] [Docs] Prefer PhpFileCache for caching and remove APC/XCache. --- docs/en/reference/caching.rst | 89 ++++++++++++++++------------------- 1 file changed, 40 insertions(+), 49 deletions(-) diff --git a/docs/en/reference/caching.rst b/docs/en/reference/caching.rst index 4c07e1607c..04370bb4ca 100644 --- a/docs/en/reference/caching.rst +++ b/docs/en/reference/caching.rst @@ -45,42 +45,30 @@ This documentation does not cover every single cache driver included with Doctrine. For an up-to-date-list, see the `cache directory on GitHub `_. -APC -~~~ - -In order to use the APC cache driver you must have it compiled and -enabled in your php.ini. You can read about APC -`in the PHP Documentation `_. It will give -you a little background information about what it is and how you -can use it as well as how to install it. - -Below is a simple example of how you could use the APC cache driver -by itself. - -.. code-block:: php - - save('cache_id', 'my_data'); +PhpFileCache +~~~~~~~~~~~~ -APCu -~~~~ +The preferred cache driver for metadata and query caches is ``PhpFileCache``. +This driver serializes cache items and writes them to a file. This allows for +opcode caching to be used and provides high performance in most scenarios. -In order to use the APCu cache driver you must have it compiled and -enabled in your php.ini. You can read about APCu -`in the PHP Documentation `_. It will give -you a little background information about what it is and how you -can use it as well as how to install it. +In order to use the ``PhpFileCache`` driver it must be able to write to +a directory. -Below is a simple example of how you could use the APCu cache driver -by itself. +Below is an example of how to use the ``PhpFileCache`` driver by itself. .. code-block:: php save('cache_id', 'my_data'); +The PhpFileCache is not distributed across multiple machines if you are running +your application in a distributed setup. This is ok for the metadata and query +cache but is not a good approach for the result cache. + Memcache ~~~~~~~~ @@ -128,24 +116,6 @@ driver by itself. $cacheDriver->setMemcached($memcached); $cacheDriver->save('cache_id', 'my_data'); -Xcache -~~~~~~ - -In order to use the Xcache cache driver you must have it compiled -and enabled in your php.ini. You can read about Xcache -`here `_. It will give you a little -background information about what it is and how you can use it as -well as how to install it. - -Below is a simple example of how you could use the Xcache cache -driver by itself. - -.. code-block:: php - - save('cache_id', 'my_data'); - Redis ~~~~~ @@ -306,8 +276,11 @@ use on your ORM configuration. .. code-block:: php setQueryCacheImpl(new \Doctrine\Common\Cache\ApcuCache()); + $config->setQueryCacheImpl($cacheDriver); Result Cache ~~~~~~~~~~~~ @@ -320,7 +293,11 @@ cache implementation. .. code-block:: php setResultCacheImpl(new \Doctrine\Common\Cache\ApcuCache()); + $cacheDriver = new \Doctrine\Common\Cache\PhpFileCache( + '/path/to/writable/directory' + ); + $config = new \Doctrine\ORM\Configuration(); + $config->setResultCacheImpl($cacheDriver); Now when you're executing DQL queries you can configure them to use the result cache. @@ -337,7 +314,11 @@ result cache driver. .. code-block:: php setResultCacheDriver(new \Doctrine\Common\Cache\ApcuCache()); + $cacheDriver = new \Doctrine\Common\Cache\PhpFileCache( + '/path/to/writable/directory' + ); + $config = new \Doctrine\ORM\Configuration(); + $query->setResultCacheDriver($cacheDriver); .. note:: @@ -389,7 +370,11 @@ first. .. code-block:: php setMetadataCacheImpl(new \Doctrine\Common\Cache\ApcuCache()); + $cacheDriver = new \Doctrine\Common\Cache\PhpFileCache( + '/path/to/writable/directory' + ); + $config = new \Doctrine\ORM\Configuration(); + $config->setMetadataCacheImpl($cacheDriver); Now the metadata information will only be parsed once and stored in the cache driver. @@ -425,6 +410,12 @@ To clear the result cache use the ``orm:clear-cache:result`` task. All these tasks accept a ``--flush`` option to flush the entire contents of the cache instead of invalidating the entries. +.. note:: + + None of these tasks will work with APC, APCu, or XCache drivers + because the memory that the cache is stored in is only accessible + to the webserver. + Cache Chaining -------------- From edce36598f88840a1e3e97908d5a2472723cc9bd Mon Sep 17 00:00:00 2001 From: Benjamin Eberlei Date: Thu, 9 Jan 2020 00:41:47 +0100 Subject: [PATCH 053/136] Adjust tests back for 2.x. --- .../ORM/Functional/Ticket/GH7505Test.php | 33 +++++++++---------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/GH7505Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/GH7505Test.php index b7191d1e2b..eb6eda208f 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/GH7505Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/GH7505Test.php @@ -4,7 +4,6 @@ namespace Doctrine\Tests\ORM\Functional\Ticket; -use Doctrine\ORM\Annotation as ORM; use Doctrine\Tests\OrmFunctionalTestCase; final class GH7505Test extends OrmFunctionalTestCase @@ -26,15 +25,15 @@ protected function setUp() : void public function testSimpleArrayTypeHydratedCorrectly() : void { $arrayResponse = new GH7505ArrayResponse(); - $this->em->persist($arrayResponse); + $this->_em->persist($arrayResponse); $textResponse = new GH7505TextResponse(); - $this->em->persist($textResponse); + $this->_em->persist($textResponse); - $this->em->flush(); - $this->em->clear(); + $this->_em->flush(); + $this->_em->clear(); - $repository = $this->em->getRepository(GH7505AbstractResponse::class); + $repository = $this->_em->getRepository(GH7505AbstractResponse::class); /** @var GH7505ArrayResponse $arrayResponse */ $arrayResponse = $repository->find($arrayResponse->id); @@ -47,11 +46,11 @@ public function testSimpleArrayTypeHydratedCorrectly() : void } /** - * @ORM\Entity() - * @ORM\Table(name="gh7505_responses") - * @ORM\InheritanceType("SINGLE_TABLE") - * @ORM\DiscriminatorColumn(name="discr", type="string") - * @ORM\DiscriminatorMap({ + * @Entity() + * @Table(name="gh7505_responses") + * @InheritanceType("SINGLE_TABLE") + * @DiscriminatorColumn(name="discr", type="string") + * @DiscriminatorMap({ * "array" = GH7505ArrayResponse::class, * "text" = GH7505TextResponse::class, * }) @@ -59,19 +58,19 @@ public function testSimpleArrayTypeHydratedCorrectly() : void abstract class GH7505AbstractResponse { /** - * @ORM\Id @ORM\GeneratedValue - * @ORM\Column(type="integer") + * @Id @GeneratedValue + * @Column(type="integer") */ public $id; } /** - * @ORM\Entity() + * @Entity() */ class GH7505ArrayResponse extends GH7505AbstractResponse { /** - * @ORM\Column(name="value_array", type="simple_array") + * @Column(name="value_array", type="simple_array") * * @var array */ @@ -79,12 +78,12 @@ class GH7505ArrayResponse extends GH7505AbstractResponse } /** - * @ORM\Entity() + * @Entity() */ class GH7505TextResponse extends GH7505AbstractResponse { /** - * @ORM\Column(name="value_string", type="string") + * @Column(name="value_string", type="string") * * @var string|null */ From 87e491465a3cbc48b82ff20ffc77dee2fc632f2e Mon Sep 17 00:00:00 2001 From: Benjamin Eberlei Date: Wed, 15 Jan 2020 21:13:25 +0100 Subject: [PATCH 054/136] Add @group --- tests/Doctrine/Tests/ORM/Functional/Ticket/GH7505Test.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/GH7505Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/GH7505Test.php index eb6eda208f..559a24d3b9 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/GH7505Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/GH7505Test.php @@ -6,6 +6,9 @@ use Doctrine\Tests\OrmFunctionalTestCase; +/** + * @group GH7505 + */ final class GH7505Test extends OrmFunctionalTestCase { /** From 6e59ec8f16443e1e203a546351b56181b2e0bff8 Mon Sep 17 00:00:00 2001 From: Benjamin Eberlei Date: Wed, 15 Jan 2020 21:52:11 +0100 Subject: [PATCH 055/136] [GH-7505] Fix cs --- lib/Doctrine/ORM/Internal/Hydration/SimpleObjectHydrator.php | 1 + tests/Doctrine/Tests/ORM/Functional/Ticket/GH7505Test.php | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/Doctrine/ORM/Internal/Hydration/SimpleObjectHydrator.php b/lib/Doctrine/ORM/Internal/Hydration/SimpleObjectHydrator.php index f70bf9caf8..a7ca1b9266 100644 --- a/lib/Doctrine/ORM/Internal/Hydration/SimpleObjectHydrator.php +++ b/lib/Doctrine/ORM/Internal/Hydration/SimpleObjectHydrator.php @@ -22,6 +22,7 @@ use PDO; use Doctrine\ORM\Mapping\ClassMetadata; use Doctrine\ORM\Query; +use function in_array; class SimpleObjectHydrator extends AbstractHydrator { diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/GH7505Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/GH7505Test.php index 559a24d3b9..2537c46103 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/GH7505Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/GH7505Test.php @@ -74,7 +74,6 @@ class GH7505ArrayResponse extends GH7505AbstractResponse { /** * @Column(name="value_array", type="simple_array") - * * @var array */ public $value = []; @@ -87,7 +86,6 @@ class GH7505TextResponse extends GH7505AbstractResponse { /** * @Column(name="value_string", type="string") - * * @var string|null */ public $value; From a2f01f7ccc0bc3740b279f9555f70842c998a8cd Mon Sep 17 00:00:00 2001 From: Benjamin Eberlei Date: Wed, 15 Jan 2020 22:56:08 +0100 Subject: [PATCH 056/136] Allow everything from ocramius/package-versions ^1.0. --- composer.json | 2 +- composer.lock | 29 +++++++++++++++-------------- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/composer.json b/composer.json index 0881695f0e..14d2d6305b 100644 --- a/composer.json +++ b/composer.json @@ -26,7 +26,7 @@ "doctrine/event-manager": "^1.1", "doctrine/instantiator": "^1.3", "doctrine/persistence": "^1.2", - "ocramius/package-versions": "^1.4", + "ocramius/package-versions": "^1.0", "symfony/console": "^3.0|^4.0|^5.0" }, "require-dev": { diff --git a/composer.lock b/composer.lock index ecb1204e60..d3c6ba63b9 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": "aebc17b1c97778b6eae0d36bb1ecf03e", + "content-hash": "d404c911e2a46d2abe29f3f70f772f7e", "packages": [ { "name": "doctrine/annotations", @@ -807,34 +807,35 @@ }, { "name": "ocramius/package-versions", - "version": "1.4.2", + "version": "1.5.1", "source": { "type": "git", "url": "https://github.com/Ocramius/PackageVersions.git", - "reference": "44af6f3a2e2e04f2af46bcb302ad9600cba41c7d" + "reference": "1d32342b8c1eb27353c8887c366147b4c2da673c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Ocramius/PackageVersions/zipball/44af6f3a2e2e04f2af46bcb302ad9600cba41c7d", - "reference": "44af6f3a2e2e04f2af46bcb302ad9600cba41c7d", + "url": "https://api.github.com/repos/Ocramius/PackageVersions/zipball/1d32342b8c1eb27353c8887c366147b4c2da673c", + "reference": "1d32342b8c1eb27353c8887c366147b4c2da673c", "shasum": "" }, "require": { "composer-plugin-api": "^1.0.0", - "php": "^7.1.0" + "php": "^7.3.0" }, "require-dev": { - "composer/composer": "^1.6.3", - "doctrine/coding-standard": "^5.0.1", + "composer/composer": "^1.8.6", + "doctrine/coding-standard": "^6.0.0", "ext-zip": "*", - "infection/infection": "^0.7.1", - "phpunit/phpunit": "^7.5.17" + "infection/infection": "^0.13.4", + "phpunit/phpunit": "^8.2.5", + "vimeo/psalm": "^3.4.9" }, "type": "composer-plugin", "extra": { "class": "PackageVersions\\Installer", "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "1.6.x-dev" } }, "autoload": { @@ -853,7 +854,7 @@ } ], "description": "Composer plugin that provides efficient querying for installed package versions (no runtime IO)", - "time": "2019-11-15T16:17:10+00:00" + "time": "2019-07-17T15:49:50+00:00" }, { "name": "psr/log", @@ -2723,8 +2724,8 @@ "authors": [ { "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" + "role": "Developer", + "email": "arne@blankerts.de" } ], "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", From 3bc1096fd01bf62d389ff1a74fbc3786424eb923 Mon Sep 17 00:00:00 2001 From: Benjamin Eberlei Date: Wed, 15 Jan 2020 23:30:59 +0100 Subject: [PATCH 057/136] [GH-7982] Default Query state to dirty to fix execution of empty query. --- lib/Doctrine/ORM/Query.php | 2 +- .../Doctrine/Tests/ORM/Query/LanguageRecognitionTest.php | 2 ++ tests/Doctrine/Tests/ORM/Query/QueryTest.php | 9 +++++++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/lib/Doctrine/ORM/Query.php b/lib/Doctrine/ORM/Query.php index c9d8fb673e..f582d99150 100644 --- a/lib/Doctrine/ORM/Query.php +++ b/lib/Doctrine/ORM/Query.php @@ -133,7 +133,7 @@ final class Query extends AbstractQuery * * @var integer */ - private $_state = self::STATE_CLEAN; + private $_state = self::STATE_DIRTY; /** * A snapshot of the parameter types the query was parsed with. diff --git a/tests/Doctrine/Tests/ORM/Query/LanguageRecognitionTest.php b/tests/Doctrine/Tests/ORM/Query/LanguageRecognitionTest.php index fe3b298cbf..50a4653b3a 100644 --- a/tests/Doctrine/Tests/ORM/Query/LanguageRecognitionTest.php +++ b/tests/Doctrine/Tests/ORM/Query/LanguageRecognitionTest.php @@ -134,6 +134,8 @@ public function invalidDQL() ['SELECT \'foo\' AS foo\\\\bar FROM Doctrine\Tests\Models\CMS\CmsUser u'], ['SELECT \'foo\' AS foo: FROM Doctrine\Tests\Models\CMS\CmsUser u'], ['SELECT \'foo\' AS foo:bar FROM Doctrine\Tests\Models\CMS\CmsUser u'], + + ['0'], ]; } diff --git a/tests/Doctrine/Tests/ORM/Query/QueryTest.php b/tests/Doctrine/Tests/ORM/Query/QueryTest.php index 71422e641a..5ac6eef904 100644 --- a/tests/Doctrine/Tests/ORM/Query/QueryTest.php +++ b/tests/Doctrine/Tests/ORM/Query/QueryTest.php @@ -420,4 +420,13 @@ public function testValuesAreNotBeingResolvedForSpecifiedParameterTypes() : void self::assertEmpty($query->getResult()); } + + /** @group 7982 */ + public function testNonExistentExecutor() + { + $this->expectException(QueryException::class); + $this->expectExceptionMessage('[Syntax Error] line 0, col -1: Error: Expected SELECT, UPDATE or DELETE, got end of string.'); + + $query = $this->_em->createQuery('0')->execute(); + } } From 5d7d3e99a088447c73e1abe2bb7ce42980934f8e Mon Sep 17 00:00:00 2001 From: Benjamin Eberlei Date: Thu, 16 Jan 2020 23:18:00 +0100 Subject: [PATCH 058/136] Downgrade ocramius/package-versions to lowest in composer.lock to support all PHP versions. --- composer.lock | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/composer.lock b/composer.lock index d3c6ba63b9..21c9fbc30d 100644 --- a/composer.lock +++ b/composer.lock @@ -807,35 +807,31 @@ }, { "name": "ocramius/package-versions", - "version": "1.5.1", + "version": "1.0.0", "source": { "type": "git", "url": "https://github.com/Ocramius/PackageVersions.git", - "reference": "1d32342b8c1eb27353c8887c366147b4c2da673c" + "reference": "df93e9e62fb7eb246f52a810b1710f95f332a53d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Ocramius/PackageVersions/zipball/1d32342b8c1eb27353c8887c366147b4c2da673c", - "reference": "1d32342b8c1eb27353c8887c366147b4c2da673c", + "url": "https://api.github.com/repos/Ocramius/PackageVersions/zipball/df93e9e62fb7eb246f52a810b1710f95f332a53d", + "reference": "df93e9e62fb7eb246f52a810b1710f95f332a53d", "shasum": "" }, "require": { - "composer-plugin-api": "^1.0.0", - "php": "^7.3.0" + "composer-plugin-api": "^1.0", + "php": "~7.0" }, "require-dev": { - "composer/composer": "^1.8.6", - "doctrine/coding-standard": "^6.0.0", - "ext-zip": "*", - "infection/infection": "^0.13.4", - "phpunit/phpunit": "^8.2.5", - "vimeo/psalm": "^3.4.9" + "composer/composer": "^1.0.0-ALPHA8@ALPHA", + "phpunit/phpunit": "^5.0" }, "type": "composer-plugin", "extra": { "class": "PackageVersions\\Installer", "branch-alias": { - "dev-master": "1.6.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { @@ -854,7 +850,7 @@ } ], "description": "Composer plugin that provides efficient querying for installed package versions (no runtime IO)", - "time": "2019-07-17T15:49:50+00:00" + "time": "2016-01-25T23:26:33+00:00" }, { "name": "psr/log", @@ -2786,7 +2782,7 @@ "minimum-stability": "stable", "stability-flags": [], "prefer-stable": false, - "prefer-lowest": false, + "prefer-lowest": true, "platform": { "php": "^7.1", "ext-pdo": "*" From dea3e5df448786b6cb923cbcd3115e0da88b03b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Paris?= Date: Thu, 16 Jan 2020 23:49:15 +0100 Subject: [PATCH 059/136] Try running phpstan on php 7.4 It might be easier to find packages compatible with both our locked deps and phpstan with that version of php. --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 9a40fe7d22..3da3d929bc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -87,6 +87,7 @@ jobs: - stage: Code Quality env: DB=none STATIC_ANALYSIS + php: 7.4 install: travis_retry composer install --prefer-dist before_script: - echo "extension=memcached.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini From fc94127d7f3dcd5a1f2150898aad7fe7dbd37981 Mon Sep 17 00:00:00 2001 From: Benjamin Eberlei Date: Thu, 16 Jan 2020 23:51:17 +0100 Subject: [PATCH 060/136] Make ocramius/package-versions 1.2 the lowest version for phpstan --- composer.json | 2 +- composer.lock | 18 ++++++++++-------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/composer.json b/composer.json index 14d2d6305b..ed05a26760 100644 --- a/composer.json +++ b/composer.json @@ -26,7 +26,7 @@ "doctrine/event-manager": "^1.1", "doctrine/instantiator": "^1.3", "doctrine/persistence": "^1.2", - "ocramius/package-versions": "^1.0", + "ocramius/package-versions": "^1.2", "symfony/console": "^3.0|^4.0|^5.0" }, "require-dev": { diff --git a/composer.lock b/composer.lock index 21c9fbc30d..b8517dec91 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": "d404c911e2a46d2abe29f3f70f772f7e", + "content-hash": "22be7b4b42da2931c1033f8818a0caa9", "packages": [ { "name": "doctrine/annotations", @@ -807,16 +807,16 @@ }, { "name": "ocramius/package-versions", - "version": "1.0.0", + "version": "1.2.0", "source": { "type": "git", "url": "https://github.com/Ocramius/PackageVersions.git", - "reference": "df93e9e62fb7eb246f52a810b1710f95f332a53d" + "reference": "ad8a245decad4897cc6b432743913dad0d69753c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Ocramius/PackageVersions/zipball/df93e9e62fb7eb246f52a810b1710f95f332a53d", - "reference": "df93e9e62fb7eb246f52a810b1710f95f332a53d", + "url": "https://api.github.com/repos/Ocramius/PackageVersions/zipball/ad8a245decad4897cc6b432743913dad0d69753c", + "reference": "ad8a245decad4897cc6b432743913dad0d69753c", "shasum": "" }, "require": { @@ -824,8 +824,10 @@ "php": "~7.0" }, "require-dev": { - "composer/composer": "^1.0.0-ALPHA8@ALPHA", - "phpunit/phpunit": "^5.0" + "composer/composer": "^1.3", + "ext-zip": "*", + "humbug/humbug": "dev-master", + "phpunit/phpunit": "^6.4" }, "type": "composer-plugin", "extra": { @@ -850,7 +852,7 @@ } ], "description": "Composer plugin that provides efficient querying for installed package versions (no runtime IO)", - "time": "2016-01-25T23:26:33+00:00" + "time": "2017-11-24T11:07:03+00:00" }, { "name": "psr/log", From a64d254d07c880f401b719e2d2af63a2cff8378c Mon Sep 17 00:00:00 2001 From: Benjamin Eberlei Date: Wed, 12 Feb 2020 23:23:12 +0100 Subject: [PATCH 061/136] [GH-7982] Bugfix: Passing string|null DQL to Lexer(string $input) leads to downstream notice. --- lib/Doctrine/ORM/Query/Parser.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Doctrine/ORM/Query/Parser.php b/lib/Doctrine/ORM/Query/Parser.php index f87cf9e5d1..193e85ac20 100644 --- a/lib/Doctrine/ORM/Query/Parser.php +++ b/lib/Doctrine/ORM/Query/Parser.php @@ -189,7 +189,7 @@ public function __construct(Query $query) { $this->query = $query; $this->em = $query->getEntityManager(); - $this->lexer = new Lexer($query->getDQL()); + $this->lexer = new Lexer((string) $query->getDQL()); $this->parserResult = new ParserResult(); } From 58677c29b4bc97273da950f6312e43ff540a7407 Mon Sep 17 00:00:00 2001 From: Maciej Malarz Date: Thu, 30 Jan 2020 20:21:41 +0100 Subject: [PATCH 062/136] Make Embeddable not transient --- lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php | 1 + tests/Doctrine/Tests/ORM/Functional/ValueObjectsTest.php | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php b/lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php index d59fd3bb77..bafd5d2749 100644 --- a/lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php +++ b/lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php @@ -44,6 +44,7 @@ class AnnotationDriver extends AbstractAnnotationDriver protected $entityAnnotationClasses = [ Mapping\Entity::class => 1, Mapping\MappedSuperclass::class => 2, + Mapping\Embeddable::class => 3, ]; /** diff --git a/tests/Doctrine/Tests/ORM/Functional/ValueObjectsTest.php b/tests/Doctrine/Tests/ORM/Functional/ValueObjectsTest.php index 7a483ebc78..f78b313e78 100644 --- a/tests/Doctrine/Tests/ORM/Functional/ValueObjectsTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/ValueObjectsTest.php @@ -328,6 +328,11 @@ public function getInfiniteEmbeddableNestingData() ['DDCNestingEmbeddable1', 'DDCNestingEmbeddable4'], ]; } + + public function testEmbeddableIsNotTransient() + { + $this->assertFalse($this->_em->getMetadataFactory()->isTransient(DDC93Address::class)); + } } From ab932852848473817ab8150035b15090f05a6c7e Mon Sep 17 00:00:00 2001 From: Benjamin Eberlei Date: Sat, 15 Feb 2020 15:34:36 +0100 Subject: [PATCH 063/136] Remove nightly builds from .travis.yml --- .travis.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3da3d929bc..192cc8b0c7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,7 +7,6 @@ php: - 7.2 - 7.3 - 7.4snapshot - - nightly env: - DB=sqlite @@ -124,7 +123,6 @@ jobs: - php git-phpcs.phar origin/$TRAVIS_BRANCH...$TRAVIS_PULL_REQUEST_SHA allow_failures: - - php: nightly - stage: Code Quality env: DB=none CODING_STANDARDS From 445796af0e873d9bd04f2502d322a7d5009b6846 Mon Sep 17 00:00:00 2001 From: Benjamin Eberlei Date: Sat, 15 Feb 2020 15:35:56 +0100 Subject: [PATCH 064/136] Travis: Use 7.4 instead of 7.4snapshot --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 192cc8b0c7..8b0564efb2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,7 +6,7 @@ php: - 7.1 - 7.2 - 7.3 - - 7.4snapshot + - 7.4 env: - DB=sqlite @@ -54,7 +54,7 @@ jobs: - stage: Test dist: xenial env: DB=mysql MYSQL_VERSION=5.7 - php: 7.4snapshot + php: 7.4 services: - mysql before_script: @@ -102,7 +102,7 @@ jobs: - stage: Code Quality if: NOT type = pull_request env: DB=none CODING_STANDARDS - php: 7.4snapshot + php: 7.4 install: travis_retry composer install --prefer-dist script: - ./vendor/bin/phpcs From 9bb2bf0cce37df024c5cdedc1aa05bef6a6ec3f5 Mon Sep 17 00:00:00 2001 From: Peter Keating Date: Sat, 15 Feb 2020 15:53:47 +0000 Subject: [PATCH 065/136] Put into cache using root entity name --- lib/Doctrine/ORM/Cache/DefaultQueryCache.php | 7 ++- .../ORM/Functional/Ticket/DDC7969Test.php | 49 +++++++++++++++++++ 2 files changed, 54 insertions(+), 2 deletions(-) create mode 100644 tests/Doctrine/Tests/ORM/Functional/Ticket/DDC7969Test.php diff --git a/lib/Doctrine/ORM/Cache/DefaultQueryCache.php b/lib/Doctrine/ORM/Cache/DefaultQueryCache.php index 866ea0db25..96f0fbd0ed 100644 --- a/lib/Doctrine/ORM/Cache/DefaultQueryCache.php +++ b/lib/Doctrine/ORM/Cache/DefaultQueryCache.php @@ -279,9 +279,12 @@ public function put(QueryCacheKey $key, ResultSetMapping $rsm, $result, array $h $region = $persister->getCacheRegion(); + $cm = $this->em->getClassMetadata($entityName); + assert($cm instanceof ClassMetadata); + foreach ($result as $index => $entity) { - $identifier = $this->uow->getEntityIdentifier($entity); - $entityKey = new EntityCacheKey($entityName, $identifier); + $identifier = $this->uow->getEntityIdentifier($entity); + $entityKey = new EntityCacheKey($cm->rootEntityName, $identifier); if (($key->cacheMode & Cache::MODE_REFRESH) || ! $region->contains($entityKey)) { // Cancel put result if entity put fail diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC7969Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC7969Test.php new file mode 100644 index 0000000000..7d9592714e --- /dev/null +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC7969Test.php @@ -0,0 +1,49 @@ +loadFixturesCountries(); + $this->loadFixturesStates(); + $this->loadFixturesCities(); + $this->loadFixturesAttractions(); + + // Entities are already cached due to fixtures - hence flush before testing + $region = $this->cache->getEntityCacheRegion(Attraction::class); + + if ($region instanceof DefaultMultiGetRegion) { + $region->getCache()->flushAll(); + } + + /** @var Bar $bar */ + $bar = $this->attractions[0]; + + $repository = $this->_em->getRepository(Bar::class); + + $this->assertFalse($this->cache->containsEntity(Bar::class, $bar->getId())); + $this->assertFalse($this->cache->containsEntity(Attraction::class, $bar->getId())); + + $repository->findOneBy([ + 'name' => $bar->getName(), + ]); + + $this->assertTrue($this->cache->containsEntity(Bar::class, $bar->getId())); + + $repository->findOneBy([ + 'name' => $bar->getName(), + ]); + + // One hit for entity cache, one hit for query cache + $this->assertEquals(2, $this->secondLevelCacheLogger->getHitCount()); + } +} From d157a6cbeb68f8d1fe866ee00902deedc0ffb1e2 Mon Sep 17 00:00:00 2001 From: Menno Holtkamp Date: Fri, 18 May 2018 23:58:04 +0200 Subject: [PATCH 066/136] Mention that lifecycle callbacks do not support Embeddables As discussed in https://github.com/doctrine/doctrine2/issues/6855 --- docs/en/reference/events.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/en/reference/events.rst b/docs/en/reference/events.rst index 9bcafe4813..d68d561dc5 100644 --- a/docs/en/reference/events.rst +++ b/docs/en/reference/events.rst @@ -243,6 +243,11 @@ a relevant lifecycle event. More than one callback can be defined for each lifecycle event. Lifecycle Callbacks are best used for simple operations specific to a particular entity class's lifecycle. + +.. note:: + + Note that Licecycle Callbacks are not supported for Embeddables. + .. code-block:: php Date: Sun, 1 Mar 2020 14:01:26 +0100 Subject: [PATCH 067/136] Annotations override naming strategy (#8041) Add a note/warning that annotations override the naming strategy. --- docs/en/reference/namingstrategy.rst | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/en/reference/namingstrategy.rst b/docs/en/reference/namingstrategy.rst index 23aa573534..027d53fd65 100644 --- a/docs/en/reference/namingstrategy.rst +++ b/docs/en/reference/namingstrategy.rst @@ -4,9 +4,13 @@ Implementing a NamingStrategy .. versionadded:: 2.3 Using a naming strategy you can provide rules for generating database identifiers, -column or table names when the column or table name is not given. This feature helps +column or table names. This feature helps reduce the verbosity of the mapping document, eliminating repetitive noise (eg: ``TABLE_``). +.. warning + + The naming strategy is always overridden by entity mapping such as the `Table` annotation. + Configuring a naming strategy ----------------------------- The default strategy used by Doctrine is quite minimal. From eb700405be89c9586e678975a011930825e56459 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Fri, 6 Mar 2020 16:08:53 +0100 Subject: [PATCH 068/136] Fix: Use neutral pronouns (#8059) --- docs/en/cookbook/entities-in-session.rst | 2 +- docs/en/cookbook/validation-of-entities.rst | 4 ++-- docs/en/reference/dql-doctrine-query-language.rst | 4 ++-- docs/en/reference/unitofwork-associations.rst | 2 +- docs/en/reference/unitofwork.rst | 4 ++-- docs/en/tutorials/getting-started.rst | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/en/cookbook/entities-in-session.rst b/docs/en/cookbook/entities-in-session.rst index 664cff53f5..b9d9c6656d 100644 --- a/docs/en/cookbook/entities-in-session.rst +++ b/docs/en/cookbook/entities-in-session.rst @@ -44,7 +44,7 @@ Serializing entity into the session ----------------------------------- Entities that are serialized into the session normally contain references to -other entities as well. Think of the user entity has a reference to his +other entities as well. Think of the user entity has a reference to their articles, groups, photos or many other different entities. If you serialize this object into the session then you don't want to serialize the related entities as well. This is why you should call ``EntityManager#detach()`` on this diff --git a/docs/en/cookbook/validation-of-entities.rst b/docs/en/cookbook/validation-of-entities.rst index dd10b8b9af..7560a65d6e 100644 --- a/docs/en/cookbook/validation-of-entities.rst +++ b/docs/en/cookbook/validation-of-entities.rst @@ -25,8 +25,8 @@ the additional benefit of being able to re-use your validation in any other part of your domain. Say we have an ``Order`` with several ``OrderLine`` instances. We -never want to allow any customer to order for a larger sum than he -is allowed to: +never want to allow any customer to order for a larger sum than they +are allowed to: .. code-block:: php diff --git a/docs/en/reference/dql-doctrine-query-language.rst b/docs/en/reference/dql-doctrine-query-language.rst index 5a38101be9..ffb5b7957b 100644 --- a/docs/en/reference/dql-doctrine-query-language.rst +++ b/docs/en/reference/dql-doctrine-query-language.rst @@ -250,7 +250,7 @@ Retrieve the Username and Name of a CmsUser: $users = $query->getResult(); // array of CmsUser username and name values echo $users[0]['username']; -Retrieve a ForumUser and his single associated entity: +Retrieve a ForumUser and its single associated entity: .. code-block:: php @@ -259,7 +259,7 @@ Retrieve a ForumUser and his single associated entity: $users = $query->getResult(); // array of ForumUser objects with the avatar association loaded echo get_class($users[0]->getAvatar()); -Retrieve a CmsUser and fetch join all the phonenumbers he has: +Retrieve a CmsUser and fetch join all the phonenumbers it has: .. code-block:: php diff --git a/docs/en/reference/unitofwork-associations.rst b/docs/en/reference/unitofwork-associations.rst index c9ccf73fc8..cade197cdc 100644 --- a/docs/en/reference/unitofwork-associations.rst +++ b/docs/en/reference/unitofwork-associations.rst @@ -39,7 +39,7 @@ side of the association and these 2 references both represent the same association but can change independently of one another. Of course, in a correct application the semantics of the bidirectional association are properly maintained by the application developer -(that's his responsibility). Doctrine needs to know which of these +(that's their responsibility). Doctrine needs to know which of these two in-memory references is the one that should be persisted and which not. This is what the owning/inverse concept is mainly used for. diff --git a/docs/en/reference/unitofwork.rst b/docs/en/reference/unitofwork.rst index b060c464a1..75b2add4dc 100644 --- a/docs/en/reference/unitofwork.rst +++ b/docs/en/reference/unitofwork.rst @@ -148,8 +148,8 @@ Hydration ~~~~~~~~~ Responsible for creating a final result from a raw database statement and a -result-set mapping object. The developer can choose which kind of result he -wishes to be hydrated. Default result-types include: +result-set mapping object. The developer can choose which kind of result they +wish to be hydrated. Default result-types include: - SQL to Entities - SQL to structured Arrays diff --git a/docs/en/tutorials/getting-started.rst b/docs/en/tutorials/getting-started.rst index 52190e5709..989cb314f7 100644 --- a/docs/en/tutorials/getting-started.rst +++ b/docs/en/tutorials/getting-started.rst @@ -72,7 +72,7 @@ requirements: - Bug reporters and engineers are both Users of the system. - A User can create new Bugs. - The assigned engineer can close a Bug. -- A User can see all his reported or assigned Bugs. +- A User can see all their reported or assigned Bugs. - Bugs can be paginated through a list-view. Project Setup From cd905fff77bfc5d923c65cfbb226f3469f78103c Mon Sep 17 00:00:00 2001 From: Jorrit Schippers Date: Fri, 13 Mar 2020 20:40:31 +0100 Subject: [PATCH 069/136] Fix documentation of default generated value behavior (#8068) --- docs/en/reference/basic-mapping.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/en/reference/basic-mapping.rst b/docs/en/reference/basic-mapping.rst index 91a8fef811..5ddeafc74a 100644 --- a/docs/en/reference/basic-mapping.rst +++ b/docs/en/reference/basic-mapping.rst @@ -328,8 +328,8 @@ annotation. In most cases using the automatic generator strategy (``@GeneratedValue``) is what you want. It defaults to the identifier generation mechanism your current -database vendor prefers: AUTO_INCREMENT with MySQL, SERIAL with PostgreSQL, -Sequences with Oracle and so on. +database vendor prefers: AUTO_INCREMENT with MySQL, sequences with PostgreSQL +and Oracle and so on. Identifier Generation Strategies ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ From a9b6b720175fae69e90247e6b7a0e34d7da2f1cc Mon Sep 17 00:00:00 2001 From: Maciej Malarz Date: Sun, 15 Mar 2020 01:00:58 +0100 Subject: [PATCH 070/136] Fix inherited embeddables and nesting after AnnotationDriver change #8006 (#8036) * Add test case * Treat parent embeddables as mapped superclasses * [GH-8031] Bugfix: Get working again on nested embeddables in inherited embeddables. * Housekeeping: CS * Update note on limitations * [GH-8031] Verify assocations still do not work with Embeddables. * Housekeeping: CS Co-authored-by: Benjamin Eberlei --- docs/en/tutorials/embeddables.rst | 4 +- .../ORM/Mapping/ClassMetadataFactory.php | 13 +- .../ORM/Mapping/Driver/AnnotationDriver.php | 2 + .../ORM/Functional/Ticket/GH8031Test.php | 163 ++++++++++++++++++ 4 files changed, 174 insertions(+), 8 deletions(-) create mode 100644 tests/Doctrine/Tests/ORM/Functional/Ticket/GH8031Test.php diff --git a/docs/en/tutorials/embeddables.rst b/docs/en/tutorials/embeddables.rst index 483e58d9da..c49bdfc65a 100644 --- a/docs/en/tutorials/embeddables.rst +++ b/docs/en/tutorials/embeddables.rst @@ -8,7 +8,9 @@ or address are the primary use case for this feature. .. note:: - Embeddables can only contain properties with basic ``@Column`` mapping. + Embeddables can not contain references to entities. They can however compose + other embeddables in addition to holding properties with basic ``@Column`` + mapping. For the purposes of this tutorial, we will assume that you have a ``User`` class in your application and you would like to store an address in diff --git a/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php b/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php index 8410ce5b0d..e1142e41bf 100644 --- a/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php +++ b/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php @@ -31,6 +31,7 @@ use Doctrine\ORM\Id\IdentityGenerator; use Doctrine\ORM\ORMException; use ReflectionException; +use function assert; /** * The ClassMetadataFactory is used to create ClassMetadata objects that contain all the @@ -401,10 +402,10 @@ private function getShortName($className) private function addInheritedFields(ClassMetadata $subClass, ClassMetadata $parentClass) { foreach ($parentClass->fieldMappings as $mapping) { - if ( ! isset($mapping['inherited']) && ! $parentClass->isMappedSuperclass) { + if (! isset($mapping['inherited']) && ! $parentClass->isMappedSuperclass && ! $parentClass->isEmbeddedClass) { $mapping['inherited'] = $parentClass->name; } - if ( ! isset($mapping['declared'])) { + if (! isset($mapping['declared'])) { $mapping['declared'] = $parentClass->name; } $subClass->addInheritedFieldMapping($mapping); @@ -469,10 +470,6 @@ private function addInheritedEmbeddedClasses(ClassMetadata $subClass, ClassMetad private function addNestedEmbeddedClasses(ClassMetadata $subClass, ClassMetadata $parentClass, $prefix) { foreach ($subClass->embeddedClasses as $property => $embeddableClass) { - if (isset($embeddableClass['inherited'])) { - continue; - } - $embeddableMetadata = $this->getMetadataFor($embeddableClass['class']); $parentClass->mapEmbedded( @@ -780,7 +777,9 @@ protected function getDriver() */ protected function isEntity(ClassMetadataInterface $class) { - return isset($class->isMappedSuperclass) && $class->isMappedSuperclass === false; + assert($class instanceof ClassMetadata); + + return $class->isMappedSuperclass === false && $class->isEmbeddedClass === false; } /** diff --git a/lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php b/lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php index bafd5d2749..28cf958a31 100644 --- a/lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php +++ b/lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php @@ -277,6 +277,8 @@ public function loadMetadataForClass($className, ClassMetadata $metadata) /* @var $property \ReflectionProperty */ foreach ($class->getProperties() as $property) { if ($metadata->isMappedSuperclass && ! $property->isPrivate() + || + $metadata->isEmbeddedClass && $property->getDeclaringClass()->getName() !== $class->getName() || $metadata->isInheritedField($property->name) || diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/GH8031Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/GH8031Test.php new file mode 100644 index 0000000000..7ae17d3f2f --- /dev/null +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/GH8031Test.php @@ -0,0 +1,163 @@ +setUpEntitySchema([ + GH8031Invoice::class, + ]); + } + + public function testEntityIsFetched() + { + $entity = new GH8031Invoice(new GH8031InvoiceCode(1, 2020, new GH8031Nested(10))); + $this->_em->persist($entity); + $this->_em->flush(); + $this->_em->clear(); + + /** @var GH8031Invoice $fetched */ + $fetched = $this->_em->find(GH8031Invoice::class, $entity->getId()); + $this->assertInstanceOf(GH8031Invoice::class, $fetched); + $this->assertSame(1, $fetched->getCode()->getNumber()); + $this->assertSame(2020, $fetched->getCode()->getYear()); + + $this->_em->clear(); + $this->assertCount( + 1, + $this->_em->getRepository(GH8031Invoice::class)->findBy([], ['code.number' => 'ASC']) + ); + } + + public function testEmbeddableWithAssociationNotAllowed() + { + $cm = $this->_em->getClassMetadata(GH8031EmbeddableWithAssociation::class); + + $this->assertArrayHasKey('invoice', $cm->associationMappings); + + $cm = $this->_em->getClassMetadata(GH8031Invoice::class); + + $this->assertCount(0, $cm->associationMappings); + } +} + +/** + * @Embeddable + */ +class GH8031EmbeddableWithAssociation +{ + /** @ManyToOne(targetEntity=GH8031Invoice::class) */ + public $invoice; +} + +/** + * @Embeddable + */ +class GH8031Nested +{ + /** + * @Column(type="integer", name="number", length=6) + * @var int + */ + protected $number; + + public function __construct(int $number) + { + $this->number = $number; + } + + public function getNumber() : int + { + return $this->number; + } +} + +/** + * @Embeddable + */ +class GH8031InvoiceCode extends GH8031AbstractYearSequenceValue +{ +} + +/** + * @Embeddable + */ +abstract class GH8031AbstractYearSequenceValue +{ + /** + * @Column(type="integer", name="number", length=6) + * @var int + */ + protected $number; + + /** + * @Column(type="smallint", name="year", length=4) + * @var int + */ + protected $year; + + /** @Embedded(class=GH8031Nested::class) */ + protected $nested; + + public function __construct(int $number, int $year, GH8031Nested $nested) + { + $this->number = $number; + $this->year = $year; + $this->nested = $nested; + } + + public function getNumber() : int + { + return $this->number; + } + + public function getYear() : int + { + return $this->year; + } +} + +/** + * @Entity + */ +class GH8031Invoice +{ + /** + * @Id + * @GeneratedValue + * @Column(type="integer") + */ + private $id; + + /** + * @Embedded(class=GH8031InvoiceCode::class) + * @var GH8031InvoiceCode + */ + private $code; + + /** @Embedded(class=GH8031EmbeddableWithAssociation::class) */ + private $embeddedAssoc; + + public function __construct(GH8031InvoiceCode $code) + { + $this->code = $code; + } + + public function getId() + { + return $this->id; + } + + public function getCode() : GH8031InvoiceCode + { + return $this->code; + } +} From a705f526fb5bbd6b6bb51c4800956cb727f510f3 Mon Sep 17 00:00:00 2001 From: Benjamin Eberlei Date: Sun, 15 Mar 2020 01:11:34 +0100 Subject: [PATCH 071/136] [GH-7633] disallow cache partial objects (#8050) * [GH-7633] Bugfix: Partial queries were stored in 2LC. There was a check in DefaultQueryCache that prevented partial queries, because they are not supported. However the checked hint Query::HINT_FORCE_PARTIAL_LOAD is optional, so cant be used to prevent caching partial DQL queries. Introduce a new hint that the SqlWalker sets on detecing a PARTIAL query and throw an exception in the DefaultQueryCache if thats found. * Housekeeping: CS * [GH-7633] HINT_FORCE_PARTIAL_LOAD still needs to be checked. * Housekeeping: Fix CS --- lib/Doctrine/ORM/Cache/DefaultQueryCache.php | 2 +- lib/Doctrine/ORM/Query/SqlWalker.php | 7 +++++++ .../SecondLevelCacheQueryCacheTest.php | 16 +++++++++++++++- 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/lib/Doctrine/ORM/Cache/DefaultQueryCache.php b/lib/Doctrine/ORM/Cache/DefaultQueryCache.php index 96f0fbd0ed..83cc6128f9 100644 --- a/lib/Doctrine/ORM/Cache/DefaultQueryCache.php +++ b/lib/Doctrine/ORM/Cache/DefaultQueryCache.php @@ -260,7 +260,7 @@ public function put(QueryCacheKey $key, ResultSetMapping $rsm, $result, array $h throw new CacheException("Second-level cache query supports only select statements."); } - if (isset($hints[Query::HINT_FORCE_PARTIAL_LOAD]) && $hints[Query::HINT_FORCE_PARTIAL_LOAD]) { + if (($hints[Query\SqlWalker::HINT_PARTIAL] ?? false) === true || ($hints[Query::HINT_FORCE_PARTIAL_LOAD] ?? false) === true) { throw new CacheException("Second level cache does not support partial entities."); } diff --git a/lib/Doctrine/ORM/Query/SqlWalker.php b/lib/Doctrine/ORM/Query/SqlWalker.php index d06d070610..e3eb975020 100644 --- a/lib/Doctrine/ORM/Query/SqlWalker.php +++ b/lib/Doctrine/ORM/Query/SqlWalker.php @@ -46,6 +46,11 @@ class SqlWalker implements TreeWalker */ const HINT_DISTINCT = 'doctrine.distinct'; + /** + * Used to mark a query as containing a PARTIAL expression, which needs to be known by SLC. + */ + public const HINT_PARTIAL = 'doctrine.partial'; + /** * @var ResultSetMapping */ @@ -1366,6 +1371,8 @@ public function walkSelectExpression($selectExpression) default: // IdentificationVariable or PartialObjectExpression if ($expr instanceof AST\PartialObjectExpression) { + $this->query->setHint(self::HINT_PARTIAL, true); + $dqlAlias = $expr->identificationVariable; $partialFieldSet = $expr->partialFieldSet; } else { diff --git a/tests/Doctrine/Tests/ORM/Functional/SecondLevelCacheQueryCacheTest.php b/tests/Doctrine/Tests/ORM/Functional/SecondLevelCacheQueryCacheTest.php index 0a32886dd0..56188ade6c 100644 --- a/tests/Doctrine/Tests/ORM/Functional/SecondLevelCacheQueryCacheTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/SecondLevelCacheQueryCacheTest.php @@ -1095,11 +1095,25 @@ public function testCacheablePartialQueryException() $this->loadFixturesCountries(); $this->_em->createQuery("SELECT PARTIAL c.{id} FROM Doctrine\Tests\Models\Cache\Country c") - ->setHint(Query::HINT_FORCE_PARTIAL_LOAD, true) ->setCacheable(true) ->getResult(); } + /** + * @expectedException \Doctrine\ORM\Cache\CacheException + * @expectedExceptionMessage Second level cache does not support partial entities. + */ + public function testCacheableForcePartialLoadHintQueryException() + { + $this->evictRegions(); + $this->loadFixturesCountries(); + + $this->_em->createQuery('SELECT c FROM Doctrine\Tests\Models\Cache\Country c') + ->setCacheable(true) + ->setHint(Query::HINT_FORCE_PARTIAL_LOAD, true) + ->getResult(); + } + /** * @expectedException \Doctrine\ORM\Cache\CacheException * @expectedExceptionMessage Second-level cache query supports only select statements. From 58b8130ea1dba4d37fb4afbe10e5a95ac593a4b3 Mon Sep 17 00:00:00 2001 From: Matthias Pigulla Date: Mon, 16 Mar 2020 11:19:12 +0100 Subject: [PATCH 072/136] Fix regression in 2.7.1 when `mysqli` is used with discriminator column that is not a string (#8055) * Add a test case showing the regression * Cast the discriminator value to string * Fix CS --- .../Hydration/SimpleObjectHydrator.php | 2 +- .../ORM/Functional/Ticket/GH8055Test.php | 71 +++++++++++++++++++ 2 files changed, 72 insertions(+), 1 deletion(-) create mode 100644 tests/Doctrine/Tests/ORM/Functional/Ticket/GH8055Test.php diff --git a/lib/Doctrine/ORM/Internal/Hydration/SimpleObjectHydrator.php b/lib/Doctrine/ORM/Internal/Hydration/SimpleObjectHydrator.php index a7ca1b9266..ec5eef1ac5 100644 --- a/lib/Doctrine/ORM/Internal/Hydration/SimpleObjectHydrator.php +++ b/lib/Doctrine/ORM/Internal/Hydration/SimpleObjectHydrator.php @@ -138,7 +138,7 @@ protected function hydrateRowData(array $sqlResult, array &$result) // Prevent overwrite in case of inherit classes using same property name (See AbstractHydrator) if ( ! isset($data[$fieldName]) || ! $valueIsNull) { // If we have inheritance in resultset, make sure the field belongs to the correct class - if (isset($cacheKeyInfo['discriminatorValues']) && ! in_array($discrColumnValue, $cacheKeyInfo['discriminatorValues'], true)) { + if (isset($cacheKeyInfo['discriminatorValues']) && ! in_array((string) $discrColumnValue, $cacheKeyInfo['discriminatorValues'], true)) { continue; } diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/GH8055Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/GH8055Test.php new file mode 100644 index 0000000000..cb48fac4f8 --- /dev/null +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/GH8055Test.php @@ -0,0 +1,71 @@ +setUpEntitySchema([ + GH8055BaseClass::class, + GH8055SubClass::class, + ]); + } + + public function testNumericDescriminatorColumn() : void + { + $entity = new GH8055SubClass(); + $entity->value = 'test'; + $this->_em->persist($entity); + $this->_em->flush(); + $this->_em->clear(); + + $repository = $this->_em->getRepository(GH8055SubClass::class); + $hydrated = $repository->find($entity->id); + + self::assertSame('test', $hydrated->value); + } +} + +/** + * @Entity() + * @Table(name="gh8055") + * @InheritanceType("JOINED") + * @DiscriminatorColumn(name="discr", type="integer") + * @DiscriminatorMap({ + * "1" = GH8055BaseClass::class, + * "2" = GH8055SubClass::class + * }) + */ +class GH8055BaseClass +{ + /** + * @Id @GeneratedValue + * @Column(type="integer") + */ + public $id; +} + +/** + * @Entity() + */ +class GH8055SubClass extends GH8055BaseClass +{ + /** + * @Column(name="test", type="string") + * @var string + */ + public $value; +} From dafe298ce5d0b995ebe1746670704c0a35868a6a Mon Sep 17 00:00:00 2001 From: Vincent Langlet Date: Thu, 19 Mar 2020 07:41:02 +0100 Subject: [PATCH 073/136] Fix phpdoc (#8074) --- lib/Doctrine/ORM/Query.php | 2 +- lib/Doctrine/ORM/QueryBuilder.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/Doctrine/ORM/Query.php b/lib/Doctrine/ORM/Query.php index f582d99150..1264997657 100644 --- a/lib/Doctrine/ORM/Query.php +++ b/lib/Doctrine/ORM/Query.php @@ -624,7 +624,7 @@ public function contains($dql) /** * Sets the position of the first result to retrieve (the "offset"). * - * @param integer $firstResult The first result to return. + * @param int|null $firstResult The first result to return. * * @return Query This query object. */ diff --git a/lib/Doctrine/ORM/QueryBuilder.php b/lib/Doctrine/ORM/QueryBuilder.php index af4d8cd2be..618a6b6921 100644 --- a/lib/Doctrine/ORM/QueryBuilder.php +++ b/lib/Doctrine/ORM/QueryBuilder.php @@ -100,7 +100,7 @@ class QueryBuilder /** * The index of the first result to retrieve. * - * @var integer + * @var int|null */ private $_firstResult = null; @@ -616,7 +616,7 @@ function (Query\Parameter $parameter) use ($key) : bool { /** * Sets the position of the first result to retrieve (the "offset"). * - * @param integer $firstResult The first result to return. + * @param int|null $firstResult The first result to return. * * @return self */ @@ -631,7 +631,7 @@ public function setFirstResult($firstResult) * Gets the position of the first result the query object was set to retrieve (the "offset"). * Returns NULL if {@link setFirstResult} was not applied to this QueryBuilder. * - * @return integer The position of the first result. + * @return int|null The position of the first result. */ public function getFirstResult() { From 6138afdca9b78a75e162fecaf8be20fff99e15f8 Mon Sep 17 00:00:00 2001 From: Arne <1255879+arneee@users.noreply.github.com> Date: Fri, 27 Mar 2020 19:42:39 +0100 Subject: [PATCH 074/136] [Docs] Make clear that calling remove() detaches the object (#8081) I changed a relationship from eager to lazy loading which broker the behaviour of my application in regards to object removal. It was not clear for me that removing an object detaches it and subsequent calls like contains() in a OneToMany relationship with the object scheduled for removal will return false afterwards. --- docs/en/reference/working-with-objects.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/en/reference/working-with-objects.rst b/docs/en/reference/working-with-objects.rst index 4b16fc3579..cb6336e747 100644 --- a/docs/en/reference/working-with-objects.rst +++ b/docs/en/reference/working-with-objects.rst @@ -330,6 +330,13 @@ in multiple ways with very different performance impacts. because Doctrine will fetch and remove all associated entities explicitly nevertheless. +.. note:: + + Calling ``remove`` on an entity will remove the object from the identiy + map and therefore detach it. Querying the same entity again, for example + via a lazy loaded relation, will return a new object. + + Detaching entities ------------------ From a418cf641833bf25434203a9054b2a82437a59a3 Mon Sep 17 00:00:00 2001 From: Vincent Langlet Date: Mon, 30 Mar 2020 20:06:04 +0200 Subject: [PATCH 075/136] Remove TODO (#8078) --- lib/Doctrine/ORM/QueryBuilder.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/lib/Doctrine/ORM/QueryBuilder.php b/lib/Doctrine/ORM/QueryBuilder.php index 618a6b6921..18efdf9a0f 100644 --- a/lib/Doctrine/ORM/QueryBuilder.php +++ b/lib/Doctrine/ORM/QueryBuilder.php @@ -1336,8 +1336,6 @@ public function addCriteria(Criteria $criteria) * @param string $queryPartName * * @return mixed $queryPart - * - * @todo Rename: getQueryPart (or remove?) */ public function getDQLPart($queryPartName) { @@ -1348,8 +1346,6 @@ public function getDQLPart($queryPartName) * Gets all query parts. * * @return array $dqlParts - * - * @todo Rename: getQueryParts (or remove?) */ public function getDQLParts() { From 8d67eec812b70b57aeeb135252d723c1dbc7ebec Mon Sep 17 00:00:00 2001 From: Mathieu Date: Mon, 30 Mar 2020 21:33:13 +0200 Subject: [PATCH 076/136] Fix JoinColumn documentation (#7966) --- docs/en/reference/annotations-reference.rst | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/docs/en/reference/annotations-reference.rst b/docs/en/reference/annotations-reference.rst index 42c232526e..e91992dd45 100644 --- a/docs/en/reference/annotations-reference.rst +++ b/docs/en/reference/annotations-reference.rst @@ -619,22 +619,17 @@ Examples: This annotation is used in the context of relations in :ref:`@ManyToOne `, :ref:`@OneToOne ` fields and in the Context of :ref:`@JoinTable ` nested inside -a @ManyToMany. This annotation is not required. If it is not -specified the attributes *name* and *referencedColumnName* are -inferred from the table and primary key names. - -Required attributes: +a @ManyToMany. If this annotation or both *name* and *referencedColumnName* +are missing they will be computed considering the field's name and the current +:doc:`naming strategy `. +Optional attributes: - **name**: Column name that holds the foreign key identifier for this relation. In the context of @JoinTable it specifies the column name in the join table. - **referencedColumnName**: Name of the primary key identifier that - is used for joining of this relation. - -Optional attributes: - - + is used for joining of this relation. Defaults to *id*. - **unique**: Determines whether this relation is exclusive between the affected entities and should be enforced as such on the database constraint level. Defaults to false. From 73ec483e9d1b8e726d3f18200572ee815f9a4ed9 Mon Sep 17 00:00:00 2001 From: Jeroen van den Heuvel Date: Thu, 16 Apr 2020 23:01:43 +0200 Subject: [PATCH 077/136] Convert PHP to SQL for new object expression (#8062) --- lib/Doctrine/ORM/Query/SqlWalker.php | 19 +++-- .../ORM/Functional/Ticket/GH8061Test.php | 76 +++++++++++++++++++ 2 files changed, 90 insertions(+), 5 deletions(-) create mode 100644 tests/Doctrine/Tests/ORM/Functional/Ticket/GH8061Test.php diff --git a/lib/Doctrine/ORM/Query/SqlWalker.php b/lib/Doctrine/ORM/Query/SqlWalker.php index e3eb975020..0749fb715d 100644 --- a/lib/Doctrine/ORM/Query/SqlWalker.php +++ b/lib/Doctrine/ORM/Query/SqlWalker.php @@ -27,6 +27,7 @@ use Doctrine\ORM\Query; use Doctrine\ORM\Utility\HierarchyDiscriminatorResolver; use Doctrine\ORM\Utility\PersisterHelper; +use function trim; /** * The SqlWalker is a TreeWalker that walks over a DQL AST and constructs @@ -1553,12 +1554,20 @@ public function walkNewObject($newObjectExpression, $newObjectResultAlias=null) break; case ($e instanceof AST\PathExpression): - $dqlAlias = $e->identificationVariable; - $qComp = $this->queryComponents[$dqlAlias]; - $class = $qComp['metadata']; - $fieldType = $class->fieldMappings[$e->field]['type']; + $dqlAlias = $e->identificationVariable; + $qComp = $this->queryComponents[$dqlAlias]; + $class = $qComp['metadata']; + $fieldType = $class->fieldMappings[$e->field]['type']; + $fieldName = $e->field; + $fieldMapping = $class->fieldMappings[$fieldName]; + $col = trim($e->dispatch($this)); + + if (isset($fieldMapping['requireSQLConversion'])) { + $type = Type::getType($fieldType); + $col = $type->convertToPHPValueSQL($col, $this->platform); + } - $sqlSelectExpressions[] = trim($e->dispatch($this)) . ' AS ' . $columnAlias; + $sqlSelectExpressions[] = $col . ' AS ' . $columnAlias; break; case ($e instanceof AST\Literal): diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/GH8061Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/GH8061Test.php new file mode 100644 index 0000000000..ed4f8f5a7b --- /dev/null +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/GH8061Test.php @@ -0,0 +1,76 @@ +_getTestEntityManager(); + $query = $entityManager->createQuery($dql); + + self::assertRegExp('/SELECT DatabaseFunction\(\w+\.field\) AS /', $query->getSQL()); + } +} + +/** + * @Entity + */ +final class GH8061Entity +{ + /** @Id @Column(type="integer") @GeneratedValue */ + public $id; + + /** @Column(type="GH8061Type") */ + public $field; +} + +final class GH8061Type extends Type +{ + public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform) : string + { + return $platform->getVarcharTypeDeclarationSQL($fieldDeclaration); + } + + public function getName() : string + { + return 'GH8061'; + } + + public function canRequireSQLConversion() : bool + { + return true; + } + + public function convertToPHPValueSQL($sqlExpr, $platform) : string + { + return sprintf('DatabaseFunction(%s)', $sqlExpr); + } +} + +final class GH8061Class +{ + /** @var string */ + public $field; + + public function __construct(string $field) + { + $this->field = $field; + } +} From 70fb1ecd7847102cbd18175ba909a2157233f2fd Mon Sep 17 00:00:00 2001 From: Maks Rafalko Date: Sat, 25 Apr 2020 23:16:17 +0300 Subject: [PATCH 078/136] Warn users about performance issues with DateTime objects in setParameter() (#8114) --- docs/en/reference/query-builder.rst | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/docs/en/reference/query-builder.rst b/docs/en/reference/query-builder.rst index 91833aee53..85ca5dc16b 100644 --- a/docs/en/reference/query-builder.rst +++ b/docs/en/reference/query-builder.rst @@ -255,6 +255,21 @@ and for managed entities. If you want to set a type explicitly you can call the third argument to ``setParameter()`` explicitly. It accepts either a PDO type or a DBAL Type name for conversion. +.. note:: + + Even though passing DateTime instance is allowed, it impacts performance + as by default there is an attempt to load metadata for object, and if it's not found, + type is inferred from the original value. + +.. code-block:: php + + setParameter('date', new \DateTimeImmutable(), Types::DATE_IMMUTABLE) + If you've got several parameters to bind to your query, you can also use setParameters() instead of setParameter() with the following syntax: @@ -581,4 +596,3 @@ same query of example 6 written using ->add('from', new Expr\From('User', 'u')) ->add('where', new Expr\Comparison('u.id', '=', '?1')) ->add('orderBy', new Expr\OrderBy('u.name', 'ASC')); - From 527fff53ccdc7324b77680dcba70f9de36218a67 Mon Sep 17 00:00:00 2001 From: Grzesiek Date: Sun, 3 May 2020 21:58:20 +0200 Subject: [PATCH 079/136] removed repository class from metadata (#8125) The annotation is required only in the next chapter of the tutorial, specifically the "Entity Repositories" --- docs/en/tutorials/getting-started.rst | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/en/tutorials/getting-started.rst b/docs/en/tutorials/getting-started.rst index 989cb314f7..6297fc3700 100644 --- a/docs/en/tutorials/getting-started.rst +++ b/docs/en/tutorials/getting-started.rst @@ -488,7 +488,6 @@ classes. We'll store them in ``src/Bug.php`` and ``src/User.php``, respectively. use Doctrine\ORM\Mapping as ORM; /** - * @ORM\Entity(repositoryClass="BugRepository") * @ORM\Table(name="bugs") */ class Bug From 8a9954e46c1a0d93679bc2c19339f680c5e5affd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Paris?= Date: Thu, 7 May 2020 08:35:39 +0200 Subject: [PATCH 080/136] Address deprecations from persistence (#7953) A backwards-compatibility layer has been added to persistence to help consumers move to the new namespacing. It is based on class aliases, which means the type declaration changes should not be a BC-break: types are the same. See https://github.com/doctrine/persistence/pull/71 This means: - using the new namespaces - adding autoload calls for new types to types that may be extended and use persistence types in type declarations of non-constructor methods, so that signature compatibility is recognized by old versions of php. More details on this at https://dev.to/greg0ire/how-to-deprecate-a-type-in-php-48cf --- UPGRADE.md | 16 +++++----- composer.json | 2 +- composer.lock | 30 ++++++++++--------- ...nting-the-notify-changetracking-policy.rst | 4 +-- .../en/reference/change-tracking-policies.rst | 4 +-- docs/en/reference/events.rst | 6 ++-- lib/Doctrine/ORM/AbstractQuery.php | 5 ++-- lib/Doctrine/ORM/Configuration.php | 9 ++++-- .../ORM/Decorator/EntityManagerDecorator.php | 2 +- lib/Doctrine/ORM/EntityManager.php | 10 ++++--- lib/Doctrine/ORM/EntityManagerInterface.php | 2 +- lib/Doctrine/ORM/EntityRepository.php | 6 ++-- lib/Doctrine/ORM/Event/LifecycleEventArgs.php | 2 +- .../ORM/Event/LoadClassMetadataEventArgs.php | 2 +- .../OnClassMetadataNotFoundEventArgs.php | 8 +++-- .../ORM/Mapping/ClassMetadataFactory.php | 13 +++++--- .../ORM/Mapping/ClassMetadataInfo.php | 17 ++++++----- .../ORM/Mapping/Driver/AnnotationDriver.php | 7 +++-- .../ORM/Mapping/Driver/DatabaseDriver.php | 7 +++-- .../ORM/Mapping/Driver/DriverChain.php | 4 +-- lib/Doctrine/ORM/Mapping/Driver/PHPDriver.php | 4 +-- .../Mapping/Driver/SimplifiedXmlDriver.php | 2 +- .../Mapping/Driver/SimplifiedYamlDriver.php | 2 +- .../ORM/Mapping/Driver/StaticPHPDriver.php | 4 +-- lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php | 9 ++++-- .../ORM/Mapping/Driver/YamlDriver.php | 7 +++-- .../Reflection/ReflectionPropertiesGetter.php | 2 +- lib/Doctrine/ORM/ORMException.php | 8 ++++- .../Entity/CachedPersisterContext.php | 3 +- lib/Doctrine/ORM/Proxy/ProxyFactory.php | 11 +++---- .../Repository/DefaultRepositoryFactory.php | 5 ++-- .../ORM/Repository/RepositoryFactory.php | 5 ++-- .../Command/MappingDescribeCommand.php | 2 +- .../ORM/Tools/DebugUnitOfWorkListener.php | 2 +- .../DisconnectedClassMetadataFactory.php | 4 +-- lib/Doctrine/ORM/UnitOfWork.php | 12 ++++---- .../HierarchyDiscriminatorResolver.php | 5 +++- .../ORM/Utility/IdentifierFlattener.php | 2 +- .../Hydration/SimpleHydrationBench.php | 2 +- ...leInheritanceHydrationPerformanceBench.php | 2 +- .../EventListener/CacheMetadataListener.php | 4 +-- .../Tests/Mocks/MetadataDriverMock.php | 4 +-- .../Doctrine/Tests/ORM/ConfigurationTest.php | 2 +- .../Doctrine/Tests/ORM/EntityManagerTest.php | 4 +-- .../OnClassMetadataNotFoundEventArgsTest.php | 8 ++--- .../ORM/Functional/EntityListenersTest.php | 2 +- .../ORM/Functional/EntityRepositoryTest.php | 2 +- .../Functional/ManyToOneOrphanRemovalTest.php | 2 +- .../Tests/ORM/Functional/NotifyPolicyTest.php | 4 +-- .../ORM/Functional/ReferenceProxyTest.php | 2 +- .../ORM/Functional/Ticket/DDC1690Test.php | 4 +-- .../ORM/Functional/Ticket/DDC2230Test.php | 4 +-- .../ORM/Functional/Ticket/DDC2231Test.php | 6 ++-- .../ORM/Functional/Ticket/DDC2359Test.php | 2 +- .../ORM/Functional/Ticket/DDC6303Test.php | 3 +- .../ORM/Functional/Ticket/DDC933Test.php | 3 +- .../ORM/Functional/Ticket/GH7079Test.php | 2 +- .../ORM/Hydration/ResultSetMappingTest.php | 7 +++-- .../Internal/HydrationCompleteHandlerTest.php | 2 +- .../ORM/Mapping/AbstractMappingDriverTest.php | 2 +- .../ORM/Mapping/AnnotationDriverTest.php | 2 +- .../ORM/Mapping/AnsiQuoteStrategyTest.php | 2 +- .../Mapping/BasicInheritanceMappingTest.php | 2 +- .../ORM/Mapping/ClassMetadataBuilderTest.php | 2 +- .../ORM/Mapping/ClassMetadataFactoryTest.php | 6 ++-- .../Tests/ORM/Mapping/ClassMetadataTest.php | 4 +-- .../ORM/Mapping/PHPMappingDriverTest.php | 2 +- .../Tests/ORM/Mapping/QuoteStrategyTest.php | 2 +- .../ReflectionPropertiesGetterTest.php | 4 +-- .../Mapping/StaticPHPMappingDriverTest.php | 2 +- .../Mapping/Symfony/AbstractDriverTest.php | 3 +- .../ORM/Mapping/XmlMappingDriverTest.php | 6 ++-- .../ORM/Mapping/YamlMappingDriverTest.php | 2 +- .../ORM/ORMInvalidArgumentExceptionTest.php | 2 -- .../Tests/ORM/Proxy/ProxyFactoryTest.php | 2 +- .../GenerateRepositoriesCommandTest.php | 2 +- .../Tools/Console/Command/InfoCommandTest.php | 2 +- .../Tests/ORM/Tools/EntityGeneratorTest.php | 2 +- .../AbstractClassMetadataExporterTest.php | 2 +- tests/Doctrine/Tests/ORM/UnitOfWorkTest.php | 6 ++-- .../Doctrine/Tests/OrmFunctionalTestCase.php | 2 +- 81 files changed, 207 insertions(+), 170 deletions(-) diff --git a/UPGRADE.md b/UPGRADE.md index 732adf8dd7..c4a719f739 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -47,7 +47,7 @@ Whole Doctrine\ORM\Tools\Export namespace with all its members have been depreca ## Deprecated `Doctrine\ORM\Proxy\Proxy` marker interface Proxy objects in Doctrine ORM 3.0 will no longer implement `Doctrine\ORM\Proxy\Proxy` nor -`Doctrine\Common\Persistence\Proxy`: instead, they implement +`Doctrine\Persistence\Proxy`: instead, they implement `ProxyManager\Proxy\GhostObjectInterface`. These related classes have been deprecated: @@ -439,17 +439,17 @@ above you must implement these new methods. ## Metadata Drivers -Metadata drivers have been rewritten to reuse code from Doctrine\Common. Anyone who is using the +Metadata drivers have been rewritten to reuse code from `Doctrine\Persistence`. Anyone who is using the `Doctrine\ORM\Mapping\Driver\Driver` interface should instead refer to -`Doctrine\Common\Persistence\Mapping\Driver\MappingDriver`. Same applies to +`Doctrine\Persistence\Mapping\Driver\MappingDriver`. Same applies to `Doctrine\ORM\Mapping\Driver\AbstractFileDriver`: you should now refer to -`Doctrine\Common\Persistence\Mapping\Driver\FileDriver`. +`Doctrine\Persistence\Mapping\Driver\FileDriver`. Also, following mapping drivers have been deprecated, please use their replacements in Doctrine\Common as listed: - * `Doctrine\ORM\Mapping\Driver\DriverChain` => `Doctrine\Common\Persistence\Mapping\Driver\MappingDriverChain` - * `Doctrine\ORM\Mapping\Driver\PHPDriver` => `Doctrine\Common\Persistence\Mapping\Driver\PHPDriver` - * `Doctrine\ORM\Mapping\Driver\StaticPHPDriver` => `Doctrine\Common\Persistence\Mapping\Driver\StaticPHPDriver` + * `Doctrine\ORM\Mapping\Driver\DriverChain` => `Doctrine\Persistence\Mapping\Driver\MappingDriverChain` + * `Doctrine\ORM\Mapping\Driver\PHPDriver` => `Doctrine\Persistence\Mapping\Driver\PHPDriver` + * `Doctrine\ORM\Mapping\Driver\StaticPHPDriver` => `Doctrine\Persistence\Mapping\Driver\StaticPHPDriver` # Upgrade to 2.2 @@ -538,7 +538,7 @@ Previously EntityManager#find(null) returned null. It now throws an exception. ## Interface for EntityRepository -The EntityRepository now has an interface Doctrine\Common\Persistence\ObjectRepository. This means that your classes that override EntityRepository and extend find(), findOneBy() or findBy() must be adjusted to follow this interface. +The EntityRepository now has an interface Doctrine\Persistence\ObjectRepository. This means that your classes that override EntityRepository and extend find(), findOneBy() or findBy() must be adjusted to follow this interface. ## AnnotationReader changes diff --git a/composer.json b/composer.json index ed05a26760..67dd564181 100644 --- a/composer.json +++ b/composer.json @@ -25,7 +25,7 @@ "doctrine/dbal": "^2.9.3", "doctrine/event-manager": "^1.1", "doctrine/instantiator": "^1.3", - "doctrine/persistence": "^1.2", + "doctrine/persistence": "^1.3.3", "ocramius/package-versions": "^1.2", "symfony/console": "^3.0|^4.0|^5.0" }, diff --git a/composer.lock b/composer.lock index b8517dec91..3e0bb024d7 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": "22be7b4b42da2931c1033f8818a0caa9", + "content-hash": "3ecc0039f7919112197e4fb876a5184d", "packages": [ { "name": "doctrine/annotations", @@ -650,16 +650,16 @@ }, { "name": "doctrine/persistence", - "version": "1.2.0", + "version": "1.3.5", "source": { "type": "git", "url": "https://github.com/doctrine/persistence.git", - "reference": "43526ae63312942e5316100bb3ed589ba1aba491" + "reference": "be70c016fdcd44a428405ee062ebcdd01a6867cd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/persistence/zipball/43526ae63312942e5316100bb3ed589ba1aba491", - "reference": "43526ae63312942e5316100bb3ed589ba1aba491", + "url": "https://api.github.com/repos/doctrine/persistence/zipball/be70c016fdcd44a428405ee062ebcdd01a6867cd", + "reference": "be70c016fdcd44a428405ee062ebcdd01a6867cd", "shasum": "" }, "require": { @@ -674,19 +674,20 @@ "doctrine/common": "<2.10@dev" }, "require-dev": { - "doctrine/coding-standard": "^5.0", - "phpstan/phpstan": "^0.8", + "doctrine/coding-standard": "^6.0", + "phpstan/phpstan": "^0.11", "phpunit/phpunit": "^7.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2.x-dev" + "dev-master": "1.3.x-dev" } }, "autoload": { "psr-4": { - "Doctrine\\Common\\": "lib/Doctrine/Common" + "Doctrine\\Common\\": "lib/Doctrine/Common", + "Doctrine\\Persistence\\": "lib/Doctrine/Persistence" } }, "notification-url": "https://packagist.org/downloads/", @@ -728,7 +729,7 @@ "orm", "persistence" ], - "time": "2019-04-23T12:39:21+00:00" + "time": "2020-01-14T18:44:12+00:00" }, { "name": "doctrine/reflection", @@ -2722,8 +2723,8 @@ "authors": [ { "name": "Arne Blankerts", - "role": "Developer", - "email": "arne@blankerts.de" + "email": "arne@blankerts.de", + "role": "Developer" } ], "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", @@ -2784,10 +2785,11 @@ "minimum-stability": "stable", "stability-flags": [], "prefer-stable": false, - "prefer-lowest": true, + "prefer-lowest": false, "platform": { "php": "^7.1", "ext-pdo": "*" }, - "platform-dev": [] + "platform-dev": [], + "plugin-api-version": "1.1.0" } diff --git a/docs/en/cookbook/implementing-the-notify-changetracking-policy.rst b/docs/en/cookbook/implementing-the-notify-changetracking-policy.rst index 44035ccf71..c0c6674578 100644 --- a/docs/en/cookbook/implementing-the-notify-changetracking-policy.rst +++ b/docs/en/cookbook/implementing-the-notify-changetracking-policy.rst @@ -22,8 +22,8 @@ implement the ``NotifyPropertyChanged`` interface from the .. code-block:: php _attributes['defaultQueryHints'][$name] = $value; } } + +interface_exists(MappingDriver::class); diff --git a/lib/Doctrine/ORM/Decorator/EntityManagerDecorator.php b/lib/Doctrine/ORM/Decorator/EntityManagerDecorator.php index 69cc6f5073..4dd9cad6ab 100644 --- a/lib/Doctrine/ORM/Decorator/EntityManagerDecorator.php +++ b/lib/Doctrine/ORM/Decorator/EntityManagerDecorator.php @@ -21,7 +21,7 @@ use Doctrine\ORM\Query\ResultSetMapping; use Doctrine\ORM\EntityManagerInterface; -use Doctrine\Common\Persistence\ObjectManagerDecorator; +use Doctrine\Persistence\ObjectManagerDecorator; /** * Base class for EntityManager decorators diff --git a/lib/Doctrine/ORM/EntityManager.php b/lib/Doctrine/ORM/EntityManager.php index 0752f0e897..40aab33fcb 100644 --- a/lib/Doctrine/ORM/EntityManager.php +++ b/lib/Doctrine/ORM/EntityManager.php @@ -28,6 +28,8 @@ use Doctrine\ORM\Proxy\ProxyFactory; use Doctrine\ORM\Query\FilterCollection; use Doctrine\Common\Util\ClassUtils; +use Doctrine\Persistence\Mapping\MappingException; +use Doctrine\Persistence\ObjectRepository; use Throwable; use const E_USER_DEPRECATED; use function trigger_error; @@ -546,9 +548,9 @@ public function getPartialReference($entityName, $identifier) * * @return void * - * @throws ORMInvalidArgumentException if a non-null non-string value is given - * @throws \Doctrine\Common\Persistence\Mapping\MappingException if a $entityName is given, but that entity is not - * found in the mappings + * @throws ORMInvalidArgumentException If a non-null non-string value is given. + * @throws MappingException If a $entityName is given, but that entity is not + * found in the mappings. */ public function clear($entityName = null) { @@ -729,7 +731,7 @@ public function lock($entity, $lockMode, $lockVersion = null) * * @param string $entityName The name of the entity. * - * @return \Doctrine\Common\Persistence\ObjectRepository|\Doctrine\ORM\EntityRepository The repository class. + * @return ObjectRepository|EntityRepository The repository class. */ public function getRepository($entityName) { diff --git a/lib/Doctrine/ORM/EntityManagerInterface.php b/lib/Doctrine/ORM/EntityManagerInterface.php index c96aa6720f..ca2f3227cb 100644 --- a/lib/Doctrine/ORM/EntityManagerInterface.php +++ b/lib/Doctrine/ORM/EntityManagerInterface.php @@ -19,8 +19,8 @@ namespace Doctrine\ORM; -use Doctrine\Common\Persistence\ObjectManager; use Doctrine\ORM\Query\ResultSetMapping; +use Doctrine\Persistence\ObjectManager; /** * EntityManager interface diff --git a/lib/Doctrine/ORM/EntityRepository.php b/lib/Doctrine/ORM/EntityRepository.php index 8a7c814333..4276361183 100644 --- a/lib/Doctrine/ORM/EntityRepository.php +++ b/lib/Doctrine/ORM/EntityRepository.php @@ -19,11 +19,11 @@ namespace Doctrine\ORM; +use Doctrine\Common\Collections\Criteria; +use Doctrine\Common\Collections\Selectable; use Doctrine\Common\Inflector\Inflector; use Doctrine\ORM\Query\ResultSetMappingBuilder; -use Doctrine\Common\Persistence\ObjectRepository; -use Doctrine\Common\Collections\Selectable; -use Doctrine\Common\Collections\Criteria; +use Doctrine\Persistence\ObjectRepository; /** * An EntityRepository serves as a repository for entities with generic as well as diff --git a/lib/Doctrine/ORM/Event/LifecycleEventArgs.php b/lib/Doctrine/ORM/Event/LifecycleEventArgs.php index c7eb80bf61..4b48122112 100644 --- a/lib/Doctrine/ORM/Event/LifecycleEventArgs.php +++ b/lib/Doctrine/ORM/Event/LifecycleEventArgs.php @@ -19,7 +19,7 @@ namespace Doctrine\ORM\Event; -use Doctrine\Common\Persistence\Event\LifecycleEventArgs as BaseLifecycleEventArgs; +use Doctrine\Persistence\Event\LifecycleEventArgs as BaseLifecycleEventArgs; /** * Lifecycle Events are triggered by the UnitOfWork during lifecycle transitions diff --git a/lib/Doctrine/ORM/Event/LoadClassMetadataEventArgs.php b/lib/Doctrine/ORM/Event/LoadClassMetadataEventArgs.php index 5df698d697..4380245cab 100644 --- a/lib/Doctrine/ORM/Event/LoadClassMetadataEventArgs.php +++ b/lib/Doctrine/ORM/Event/LoadClassMetadataEventArgs.php @@ -19,7 +19,7 @@ namespace Doctrine\ORM\Event; -use Doctrine\Common\Persistence\Event\LoadClassMetadataEventArgs as BaseLoadClassMetadataEventArgs; +use Doctrine\Persistence\Event\LoadClassMetadataEventArgs as BaseLoadClassMetadataEventArgs; /** * Class that holds event arguments for a loadMetadata event. diff --git a/lib/Doctrine/ORM/Event/OnClassMetadataNotFoundEventArgs.php b/lib/Doctrine/ORM/Event/OnClassMetadataNotFoundEventArgs.php index a044a7e321..1e50b4a24a 100644 --- a/lib/Doctrine/ORM/Event/OnClassMetadataNotFoundEventArgs.php +++ b/lib/Doctrine/ORM/Event/OnClassMetadataNotFoundEventArgs.php @@ -19,9 +19,10 @@ namespace Doctrine\ORM\Event; -use Doctrine\Common\Persistence\Event\ManagerEventArgs; -use Doctrine\Common\Persistence\Mapping\ClassMetadata; -use Doctrine\Common\Persistence\ObjectManager; +use Doctrine\Persistence\Event\ManagerEventArgs; +use Doctrine\Persistence\Mapping\ClassMetadata; +use Doctrine\Persistence\ObjectManager; +use function interface_exists; /** * Class that holds event arguments for a `onClassMetadataNotFound` event. @@ -84,3 +85,4 @@ public function getClassName() } } +interface_exists(ClassMetadata::class); diff --git a/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php b/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php index e1142e41bf..e75ae1f823 100644 --- a/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php +++ b/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php @@ -19,9 +19,6 @@ namespace Doctrine\ORM\Mapping; -use Doctrine\Common\Persistence\Mapping\AbstractClassMetadataFactory; -use Doctrine\Common\Persistence\Mapping\ClassMetadata as ClassMetadataInterface; -use Doctrine\Common\Persistence\Mapping\ReflectionService; use Doctrine\DBAL\Platforms; use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\Event\LoadClassMetadataEventArgs; @@ -30,8 +27,13 @@ use Doctrine\ORM\Id\BigIntegerIdentityGenerator; use Doctrine\ORM\Id\IdentityGenerator; use Doctrine\ORM\ORMException; +use Doctrine\Persistence\Mapping\AbstractClassMetadataFactory; +use Doctrine\Persistence\Mapping\ClassMetadata as ClassMetadataInterface; +use Doctrine\Persistence\Mapping\Driver\MappingDriver; +use Doctrine\Persistence\Mapping\ReflectionService; use ReflectionException; use function assert; +use function interface_exists; /** * The ClassMetadataFactory is used to create ClassMetadata objects that contain all the @@ -57,7 +59,7 @@ class ClassMetadataFactory extends AbstractClassMetadataFactory private $targetPlatform; /** - * @var \Doctrine\Common\Persistence\Mapping\Driver\MappingDriver + * @var MappingDriver */ private $driver; @@ -794,3 +796,6 @@ private function getTargetPlatform() return $this->targetPlatform; } } + +interface_exists(ClassMetadataInterface::class); +interface_exists(ReflectionService::class); diff --git a/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php b/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php index 8584a78490..94987d5fb8 100644 --- a/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php +++ b/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php @@ -20,14 +20,15 @@ namespace Doctrine\ORM\Mapping; use BadMethodCallException; -use Doctrine\Instantiator\Instantiator; -use InvalidArgumentException; -use RuntimeException; use Doctrine\DBAL\Types\Type; use Doctrine\DBAL\Platforms\AbstractPlatform; -use ReflectionClass; -use Doctrine\Common\Persistence\Mapping\ClassMetadata; +use Doctrine\Instantiator\Instantiator; use Doctrine\ORM\Cache\CacheException; +use Doctrine\Persistence\Mapping\ClassMetadata; +use Doctrine\Persistence\Mapping\ReflectionService; +use InvalidArgumentException; +use ReflectionClass; +use RuntimeException; /** * A ClassMetadata instance holds all the object-relational mapping metadata @@ -914,7 +915,7 @@ public function newInstance() /** * Restores some state that can not be serialized/unserialized. * - * @param \Doctrine\Common\Persistence\Mapping\ReflectionService $reflService + * @param ReflectionService $reflService * * @return void */ @@ -975,7 +976,7 @@ public function wakeupReflection($reflService) * Initializes a new ClassMetadata instance that will hold the object-relational mapping * metadata of the class with the given name. * - * @param \Doctrine\Common\Persistence\Mapping\ReflectionService $reflService The reflection service. + * @param ReflectionService $reflService The reflection service. * * @return void */ @@ -1037,7 +1038,7 @@ public function validateAssociations() /** * Validates lifecycle callbacks. * - * @param \Doctrine\Common\Persistence\Mapping\ReflectionService $reflService + * @param ReflectionService $reflService * * @return void * diff --git a/lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php b/lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php index 28cf958a31..afa7ad614d 100644 --- a/lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php +++ b/lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php @@ -20,12 +20,13 @@ namespace Doctrine\ORM\Mapping\Driver; use Doctrine\Common\Annotations\AnnotationReader; -use Doctrine\Common\Persistence\Mapping\ClassMetadata; -use Doctrine\Common\Persistence\Mapping\Driver\AnnotationDriver as AbstractAnnotationDriver; use Doctrine\ORM\Events; use Doctrine\ORM\Mapping; use Doctrine\ORM\Mapping\Builder\EntityListenerBuilder; use Doctrine\ORM\Mapping\MappingException; +use Doctrine\Persistence\Mapping\ClassMetadata; +use Doctrine\Persistence\Mapping\Driver\AnnotationDriver as AbstractAnnotationDriver; +use function interface_exists; /** * The AnnotationDriver reads the mapping metadata from docblock annotations. @@ -674,3 +675,5 @@ static public function create($paths = [], AnnotationReader $reader = null) return new self($reader, $paths); } } + +interface_exists(ClassMetadata::class); diff --git a/lib/Doctrine/ORM/Mapping/Driver/DatabaseDriver.php b/lib/Doctrine/ORM/Mapping/Driver/DatabaseDriver.php index 83798e16e2..54eac1ed96 100644 --- a/lib/Doctrine/ORM/Mapping/Driver/DatabaseDriver.php +++ b/lib/Doctrine/ORM/Mapping/Driver/DatabaseDriver.php @@ -20,8 +20,6 @@ namespace Doctrine\ORM\Mapping\Driver; use Doctrine\Common\Inflector\Inflector; -use Doctrine\Common\Persistence\Mapping\Driver\MappingDriver; -use Doctrine\Common\Persistence\Mapping\ClassMetadata; use Doctrine\DBAL\Schema\AbstractSchemaManager; use Doctrine\DBAL\Schema\SchemaException; use Doctrine\DBAL\Schema\Table; @@ -29,6 +27,9 @@ use Doctrine\DBAL\Types\Type; use Doctrine\ORM\Mapping\ClassMetadataInfo; use Doctrine\ORM\Mapping\MappingException; +use Doctrine\Persistence\Mapping\ClassMetadata; +use Doctrine\Persistence\Mapping\Driver\MappingDriver; +use function interface_exists; use function preg_replace; /** @@ -555,3 +556,5 @@ private function getFieldNameForColumn($tableName, $columnName, $fk = false) return Inflector::camelize($columnName); } } + +interface_exists(ClassMetadata::class); diff --git a/lib/Doctrine/ORM/Mapping/Driver/DriverChain.php b/lib/Doctrine/ORM/Mapping/Driver/DriverChain.php index f4cd8cd608..ed9c2be728 100644 --- a/lib/Doctrine/ORM/Mapping/Driver/DriverChain.php +++ b/lib/Doctrine/ORM/Mapping/Driver/DriverChain.php @@ -19,12 +19,12 @@ namespace Doctrine\ORM\Mapping\Driver; -use Doctrine\Common\Persistence\Mapping\Driver\MappingDriverChain; +use Doctrine\Persistence\Mapping\Driver\MappingDriverChain; /** * {@inheritDoc} * - * @deprecated this driver will be removed. Use Doctrine\Common\Persistence\Mapping\Driver\MappingDriverChain instead + * @deprecated this driver will be removed. Use Doctrine\Persistence\Mapping\Driver\MappingDriverChain instead */ class DriverChain extends MappingDriverChain { diff --git a/lib/Doctrine/ORM/Mapping/Driver/PHPDriver.php b/lib/Doctrine/ORM/Mapping/Driver/PHPDriver.php index 28e2dbea22..0280c1a5a5 100644 --- a/lib/Doctrine/ORM/Mapping/Driver/PHPDriver.php +++ b/lib/Doctrine/ORM/Mapping/Driver/PHPDriver.php @@ -19,12 +19,12 @@ namespace Doctrine\ORM\Mapping\Driver; -use Doctrine\Common\Persistence\Mapping\Driver\PHPDriver as CommonPHPDriver; +use Doctrine\Persistence\Mapping\Driver\PHPDriver as CommonPHPDriver; /** * {@inheritDoc} * - * @deprecated this driver will be removed. Use Doctrine\Common\Persistence\Mapping\Driver\PHPDriver instead + * @deprecated this driver will be removed. Use Doctrine\Persistence\Mapping\Driver\PHPDriver instead */ class PHPDriver extends CommonPHPDriver { diff --git a/lib/Doctrine/ORM/Mapping/Driver/SimplifiedXmlDriver.php b/lib/Doctrine/ORM/Mapping/Driver/SimplifiedXmlDriver.php index 9bfd84cae3..6370565e4e 100644 --- a/lib/Doctrine/ORM/Mapping/Driver/SimplifiedXmlDriver.php +++ b/lib/Doctrine/ORM/Mapping/Driver/SimplifiedXmlDriver.php @@ -19,7 +19,7 @@ namespace Doctrine\ORM\Mapping\Driver; -use Doctrine\Common\Persistence\Mapping\Driver\SymfonyFileLocator; +use Doctrine\Persistence\Mapping\Driver\SymfonyFileLocator; /** * XmlDriver that additionally looks for mapping information in a global file. diff --git a/lib/Doctrine/ORM/Mapping/Driver/SimplifiedYamlDriver.php b/lib/Doctrine/ORM/Mapping/Driver/SimplifiedYamlDriver.php index 8f38784f4e..d766d5dabf 100644 --- a/lib/Doctrine/ORM/Mapping/Driver/SimplifiedYamlDriver.php +++ b/lib/Doctrine/ORM/Mapping/Driver/SimplifiedYamlDriver.php @@ -19,7 +19,7 @@ namespace Doctrine\ORM\Mapping\Driver; -use Doctrine\Common\Persistence\Mapping\Driver\SymfonyFileLocator; +use Doctrine\Persistence\Mapping\Driver\SymfonyFileLocator; /** * YamlDriver that additionally looks for mapping information in a global file. diff --git a/lib/Doctrine/ORM/Mapping/Driver/StaticPHPDriver.php b/lib/Doctrine/ORM/Mapping/Driver/StaticPHPDriver.php index d6c6ead853..62079f3fa5 100644 --- a/lib/Doctrine/ORM/Mapping/Driver/StaticPHPDriver.php +++ b/lib/Doctrine/ORM/Mapping/Driver/StaticPHPDriver.php @@ -19,12 +19,12 @@ namespace Doctrine\ORM\Mapping\Driver; -use Doctrine\Common\Persistence\Mapping\Driver\StaticPHPDriver as CommonStaticPHPDriver; +use Doctrine\Persistence\Mapping\Driver\StaticPHPDriver as CommonStaticPHPDriver; /** * {@inheritDoc} * - * @deprecated this driver will be removed. Use Doctrine\Common\Persistence\Mapping\Driver\StaticPHPDriver instead + * @deprecated this driver will be removed. Use Doctrine\Persistence\Mapping\Driver\StaticPHPDriver instead */ class StaticPHPDriver extends CommonStaticPHPDriver { diff --git a/lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php b/lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php index 93b697caef..20066b448e 100644 --- a/lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php +++ b/lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php @@ -20,12 +20,13 @@ namespace Doctrine\ORM\Mapping\Driver; use Doctrine\Common\Collections\Criteria; -use SimpleXMLElement; -use Doctrine\Common\Persistence\Mapping\Driver\FileDriver; use Doctrine\ORM\Mapping\Builder\EntityListenerBuilder; -use Doctrine\Common\Persistence\Mapping\ClassMetadata; use Doctrine\ORM\Mapping\MappingException; use Doctrine\ORM\Mapping\ClassMetadata as Metadata; +use Doctrine\Persistence\Mapping\ClassMetadata; +use Doctrine\Persistence\Mapping\Driver\FileDriver; +use SimpleXMLElement; +use function interface_exists; /** * XmlDriver is a metadata driver that enables mapping through XML files. @@ -879,3 +880,5 @@ protected function evaluateBoolean($element) return ($flag == "true" || $flag == "1"); } } + +interface_exists(ClassMetadata::class); diff --git a/lib/Doctrine/ORM/Mapping/Driver/YamlDriver.php b/lib/Doctrine/ORM/Mapping/Driver/YamlDriver.php index 05339ec4f6..8c70e979c8 100644 --- a/lib/Doctrine/ORM/Mapping/Driver/YamlDriver.php +++ b/lib/Doctrine/ORM/Mapping/Driver/YamlDriver.php @@ -19,12 +19,13 @@ namespace Doctrine\ORM\Mapping\Driver; -use Doctrine\Common\Persistence\Mapping\ClassMetadata; use Doctrine\ORM\Mapping\Builder\EntityListenerBuilder; -use Doctrine\Common\Persistence\Mapping\Driver\FileDriver; use Doctrine\ORM\Mapping\ClassMetadata as Metadata; use Doctrine\ORM\Mapping\MappingException; +use Doctrine\Persistence\Mapping\ClassMetadata; +use Doctrine\Persistence\Mapping\Driver\FileDriver; use Symfony\Component\Yaml\Yaml; +use function interface_exists; use function trigger_error; /** @@ -817,3 +818,5 @@ protected function loadMappingFile($file) return Yaml::parse(file_get_contents($file)); } } + +interface_exists(ClassMetadata::class); diff --git a/lib/Doctrine/ORM/Mapping/Reflection/ReflectionPropertiesGetter.php b/lib/Doctrine/ORM/Mapping/Reflection/ReflectionPropertiesGetter.php index 6ac7f11c3f..dbf36fcea3 100644 --- a/lib/Doctrine/ORM/Mapping/Reflection/ReflectionPropertiesGetter.php +++ b/lib/Doctrine/ORM/Mapping/Reflection/ReflectionPropertiesGetter.php @@ -19,7 +19,7 @@ namespace Doctrine\ORM\Mapping\Reflection; -use Doctrine\Common\Persistence\Mapping\ReflectionService; +use Doctrine\Persistence\Mapping\ReflectionService; use ReflectionClass; use ReflectionProperty; diff --git a/lib/Doctrine/ORM/ORMException.php b/lib/Doctrine/ORM/ORMException.php index 3ce9ce9dc9..2712ed9244 100644 --- a/lib/Doctrine/ORM/ORMException.php +++ b/lib/Doctrine/ORM/ORMException.php @@ -20,7 +20,9 @@ namespace Doctrine\ORM; use Doctrine\Common\Cache\Cache as CacheDriver; +use Doctrine\Persistence\ObjectRepository; use Exception; +use function sprintf; /** * Base exception class for all ORM exceptions. @@ -295,7 +297,11 @@ public static function unknownEntityNamespace($entityNamespaceAlias) */ public static function invalidEntityRepository($className) { - return new self("Invalid repository class '".$className."'. It must be a Doctrine\Common\Persistence\ObjectRepository."); + return new self(sprintf( + "Invalid repository class '%s'. It must be a %s.", + $className, + ObjectRepository::class + )); } /** diff --git a/lib/Doctrine/ORM/Persisters/Entity/CachedPersisterContext.php b/lib/Doctrine/ORM/Persisters/Entity/CachedPersisterContext.php index 132dac7e4d..c4cc2a4a71 100644 --- a/lib/Doctrine/ORM/Persisters/Entity/CachedPersisterContext.php +++ b/lib/Doctrine/ORM/Persisters/Entity/CachedPersisterContext.php @@ -18,8 +18,9 @@ */ namespace Doctrine\ORM\Persisters\Entity; -use Doctrine\Common\Persistence\Mapping\ClassMetadata; + use Doctrine\ORM\Query\ResultSetMapping; +use Doctrine\Persistence\Mapping\ClassMetadata; /** * A swappable persister context to use as a container for the current diff --git a/lib/Doctrine/ORM/Proxy/ProxyFactory.php b/lib/Doctrine/ORM/Proxy/ProxyFactory.php index 31fac18a20..8cdce2f763 100644 --- a/lib/Doctrine/ORM/Proxy/ProxyFactory.php +++ b/lib/Doctrine/ORM/Proxy/ProxyFactory.php @@ -19,7 +19,6 @@ namespace Doctrine\ORM\Proxy; -use Doctrine\Common\Persistence\Mapping\ClassMetadata; use Doctrine\Common\Proxy\AbstractProxyFactory; use Doctrine\Common\Proxy\Proxy as BaseProxy; use Doctrine\Common\Proxy\ProxyDefinition; @@ -29,6 +28,8 @@ use Doctrine\ORM\Persisters\Entity\EntityPersister; use Doctrine\ORM\EntityNotFoundException; use Doctrine\ORM\Utility\IdentifierFlattener; +use Doctrine\Persistence\Mapping\ClassMetadata; +use function interface_exists; /** * This factory is used to create proxy objects for entities at runtime. @@ -118,9 +119,6 @@ protected function createProxyDefinition($className) /** * Creates a closure capable of initializing a proxy * - * @param \Doctrine\Common\Persistence\Mapping\ClassMetadata $classMetadata - * @param \Doctrine\ORM\Persisters\Entity\EntityPersister $entityPersister - * * @return \Closure * * @throws \Doctrine\ORM\EntityNotFoundException @@ -172,9 +170,6 @@ private function createInitializer(ClassMetadata $classMetadata, EntityPersister /** * Creates a closure capable of finalizing state a cloned proxy * - * @param \Doctrine\Common\Persistence\Mapping\ClassMetadata $classMetadata - * @param \Doctrine\ORM\Persisters\Entity\EntityPersister $entityPersister - * * @return \Closure * * @throws \Doctrine\ORM\EntityNotFoundException @@ -211,3 +206,5 @@ private function createCloner(ClassMetadata $classMetadata, EntityPersister $ent }; } } + +interface_exists(ClassMetadata::class); diff --git a/lib/Doctrine/ORM/Repository/DefaultRepositoryFactory.php b/lib/Doctrine/ORM/Repository/DefaultRepositoryFactory.php index 680962413f..9d4da0d3b7 100644 --- a/lib/Doctrine/ORM/Repository/DefaultRepositoryFactory.php +++ b/lib/Doctrine/ORM/Repository/DefaultRepositoryFactory.php @@ -20,6 +20,7 @@ namespace Doctrine\ORM\Repository; use Doctrine\ORM\EntityManagerInterface; +use Doctrine\Persistence\ObjectRepository; /** * This factory is used to create default repository objects for entities at runtime. @@ -32,7 +33,7 @@ final class DefaultRepositoryFactory implements RepositoryFactory /** * The list of EntityRepository instances. * - * @var \Doctrine\Common\Persistence\ObjectRepository[] + * @var ObjectRepository[] */ private $repositoryList = []; @@ -56,7 +57,7 @@ public function getRepository(EntityManagerInterface $entityManager, $entityName * @param \Doctrine\ORM\EntityManagerInterface $entityManager The EntityManager instance. * @param string $entityName The name of the entity. * - * @return \Doctrine\Common\Persistence\ObjectRepository + * @return ObjectRepository */ private function createRepository(EntityManagerInterface $entityManager, $entityName) { diff --git a/lib/Doctrine/ORM/Repository/RepositoryFactory.php b/lib/Doctrine/ORM/Repository/RepositoryFactory.php index f3af43ebe0..29a928dd1f 100644 --- a/lib/Doctrine/ORM/Repository/RepositoryFactory.php +++ b/lib/Doctrine/ORM/Repository/RepositoryFactory.php @@ -20,6 +20,7 @@ namespace Doctrine\ORM\Repository; use Doctrine\ORM\EntityManagerInterface; +use Doctrine\Persistence\ObjectRepository; /** * Interface for entity repository factory. @@ -35,7 +36,7 @@ interface RepositoryFactory * @param \Doctrine\ORM\EntityManagerInterface $entityManager The EntityManager instance. * @param string $entityName The name of the entity. * - * @return \Doctrine\Common\Persistence\ObjectRepository + * @return ObjectRepository */ public function getRepository(EntityManagerInterface $entityManager, $entityName); -} \ No newline at end of file +} diff --git a/lib/Doctrine/ORM/Tools/Console/Command/MappingDescribeCommand.php b/lib/Doctrine/ORM/Tools/Console/Command/MappingDescribeCommand.php index 0e1f505f03..4c71789082 100644 --- a/lib/Doctrine/ORM/Tools/Console/Command/MappingDescribeCommand.php +++ b/lib/Doctrine/ORM/Tools/Console/Command/MappingDescribeCommand.php @@ -19,8 +19,8 @@ namespace Doctrine\ORM\Tools\Console\Command; -use Doctrine\Common\Persistence\Mapping\MappingException; use Doctrine\ORM\EntityManagerInterface; +use Doctrine\Persistence\Mapping\MappingException; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; diff --git a/lib/Doctrine/ORM/Tools/DebugUnitOfWorkListener.php b/lib/Doctrine/ORM/Tools/DebugUnitOfWorkListener.php index 5011382618..94a239f38e 100644 --- a/lib/Doctrine/ORM/Tools/DebugUnitOfWorkListener.php +++ b/lib/Doctrine/ORM/Tools/DebugUnitOfWorkListener.php @@ -19,12 +19,12 @@ namespace Doctrine\ORM\Tools; -use Doctrine\Common\Persistence\Proxy; use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\Event\OnFlushEventArgs; use Doctrine\ORM\Mapping\ClassMetadata; use Doctrine\ORM\PersistentCollection; use Doctrine\ORM\UnitOfWork; +use Doctrine\Persistence\Proxy; /** * Use this logger to dump the identity map during the onFlush event. This is useful for debugging diff --git a/lib/Doctrine/ORM/Tools/DisconnectedClassMetadataFactory.php b/lib/Doctrine/ORM/Tools/DisconnectedClassMetadataFactory.php index 7a3ec6f893..67af4e2ac0 100644 --- a/lib/Doctrine/ORM/Tools/DisconnectedClassMetadataFactory.php +++ b/lib/Doctrine/ORM/Tools/DisconnectedClassMetadataFactory.php @@ -19,8 +19,8 @@ namespace Doctrine\ORM\Tools; -use Doctrine\Common\Persistence\Mapping\StaticReflectionService; use Doctrine\ORM\Mapping\ClassMetadataFactory; +use Doctrine\Persistence\Mapping\StaticReflectionService; /** * The DisconnectedClassMetadataFactory is used to create ClassMetadataInfo objects @@ -39,7 +39,7 @@ class DisconnectedClassMetadataFactory extends ClassMetadataFactory { /** - * @return \Doctrine\Common\Persistence\Mapping\StaticReflectionService + * @return StaticReflectionService */ public function getReflectionService() { diff --git a/lib/Doctrine/ORM/UnitOfWork.php b/lib/Doctrine/ORM/UnitOfWork.php index f7b32b3809..77b42cca28 100644 --- a/lib/Doctrine/ORM/UnitOfWork.php +++ b/lib/Doctrine/ORM/UnitOfWork.php @@ -21,10 +21,6 @@ use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\Collection; -use Doctrine\Common\NotifyPropertyChanged; -use Doctrine\Common\Persistence\Mapping\RuntimeReflectionService; -use Doctrine\Common\Persistence\ObjectManagerAware; -use Doctrine\Common\PropertyChangedListener; use Doctrine\DBAL\LockMode; use Doctrine\ORM\Cache\Persister\CachedPersister; use Doctrine\ORM\Event\LifecycleEventArgs; @@ -43,6 +39,10 @@ use Doctrine\ORM\Persisters\Entity\SingleTablePersister; use Doctrine\ORM\Proxy\Proxy; use Doctrine\ORM\Utility\IdentifierFlattener; +use Doctrine\Persistence\Mapping\RuntimeReflectionService; +use Doctrine\Persistence\NotifyPropertyChanged; +use Doctrine\Persistence\ObjectManagerAware; +use Doctrine\Persistence\PropertyChangedListener; use InvalidArgumentException; use Throwable; use UnexpectedValueException; @@ -2588,13 +2588,13 @@ public function isCollectionScheduledForDeletion(PersistentCollection $coll) /** * @param ClassMetadata $class * - * @return \Doctrine\Common\Persistence\ObjectManagerAware|object + * @return ObjectManagerAware|object */ private function newInstance($class) { $entity = $class->newInstance(); - if ($entity instanceof \Doctrine\Common\Persistence\ObjectManagerAware) { + if ($entity instanceof ObjectManagerAware) { $entity->injectObjectManager($this->em, $class); } diff --git a/lib/Doctrine/ORM/Utility/HierarchyDiscriminatorResolver.php b/lib/Doctrine/ORM/Utility/HierarchyDiscriminatorResolver.php index 9b08b7f17d..3474770c2e 100644 --- a/lib/Doctrine/ORM/Utility/HierarchyDiscriminatorResolver.php +++ b/lib/Doctrine/ORM/Utility/HierarchyDiscriminatorResolver.php @@ -2,8 +2,9 @@ namespace Doctrine\ORM\Utility; -use Doctrine\Common\Persistence\Mapping\ClassMetadata; +use Doctrine\Persistence\Mapping\ClassMetadata; use Doctrine\ORM\EntityManagerInterface; +use function interface_exists; /** * @internal This class exists only to avoid code duplication, do not reuse it externally @@ -39,3 +40,5 @@ public static function resolveDiscriminatorsForClass( return $discriminators; } } + +interface_exists(ClassMetadata::class); diff --git a/lib/Doctrine/ORM/Utility/IdentifierFlattener.php b/lib/Doctrine/ORM/Utility/IdentifierFlattener.php index a283a68349..992e8540e6 100644 --- a/lib/Doctrine/ORM/Utility/IdentifierFlattener.php +++ b/lib/Doctrine/ORM/Utility/IdentifierFlattener.php @@ -21,7 +21,7 @@ use Doctrine\ORM\UnitOfWork; use Doctrine\ORM\Mapping\ClassMetadata; -use Doctrine\Common\Persistence\Mapping\ClassMetadataFactory; +use Doctrine\Persistence\Mapping\ClassMetadataFactory; /** * The IdentifierFlattener utility now houses some of the identifier manipulation logic from unit of work, so that it diff --git a/tests/Doctrine/Performance/Hydration/SimpleHydrationBench.php b/tests/Doctrine/Performance/Hydration/SimpleHydrationBench.php index a3fd637d67..4c7700835d 100644 --- a/tests/Doctrine/Performance/Hydration/SimpleHydrationBench.php +++ b/tests/Doctrine/Performance/Hydration/SimpleHydrationBench.php @@ -2,9 +2,9 @@ namespace Doctrine\Performance\Hydration; -use Doctrine\Common\Persistence\ObjectRepository; use Doctrine\ORM\EntityManagerInterface; use Doctrine\Performance\EntityManagerFactory; +use Doctrine\Persistence\ObjectRepository; use Doctrine\Tests\Models\CMS; /** diff --git a/tests/Doctrine/Performance/Hydration/SingleTableInheritanceHydrationPerformanceBench.php b/tests/Doctrine/Performance/Hydration/SingleTableInheritanceHydrationPerformanceBench.php index ec6c17c3ee..b143dcddea 100644 --- a/tests/Doctrine/Performance/Hydration/SingleTableInheritanceHydrationPerformanceBench.php +++ b/tests/Doctrine/Performance/Hydration/SingleTableInheritanceHydrationPerformanceBench.php @@ -2,8 +2,8 @@ namespace Doctrine\Performance\Hydration; -use Doctrine\Common\Persistence\ObjectRepository; use Doctrine\Performance\EntityManagerFactory; +use Doctrine\Persistence\ObjectRepository; use Doctrine\Tests\Models\Company; use PhpBench\Benchmark\Metadata\Annotations\BeforeMethods; diff --git a/tests/Doctrine/Tests/EventListener/CacheMetadataListener.php b/tests/Doctrine/Tests/EventListener/CacheMetadataListener.php index e8cc6b23ae..ba6cad56a6 100644 --- a/tests/Doctrine/Tests/EventListener/CacheMetadataListener.php +++ b/tests/Doctrine/Tests/EventListener/CacheMetadataListener.php @@ -2,9 +2,9 @@ namespace Doctrine\Tests\EventListener; -use Doctrine\Common\Persistence\Event\LoadClassMetadataEventArgs; use Doctrine\ORM\EntityManager; use Doctrine\ORM\Mapping\ClassMetadata; +use Doctrine\Persistence\Event\LoadClassMetadataEventArgs; class CacheMetadataListener { @@ -20,7 +20,7 @@ class CacheMetadataListener protected $enabledItems = []; /** - * @param \Doctrine\Common\Persistence\Event\LoadClassMetadataEventArgs $event + * @param LoadClassMetadataEventArgs $event */ public function loadClassMetadata(LoadClassMetadataEventArgs $event) { diff --git a/tests/Doctrine/Tests/Mocks/MetadataDriverMock.php b/tests/Doctrine/Tests/Mocks/MetadataDriverMock.php index f14c256b19..4b947c3b30 100644 --- a/tests/Doctrine/Tests/Mocks/MetadataDriverMock.php +++ b/tests/Doctrine/Tests/Mocks/MetadataDriverMock.php @@ -2,8 +2,8 @@ namespace Doctrine\Tests\Mocks; -use Doctrine\Common\Persistence\Mapping\Driver\MappingDriver; -use Doctrine\Common\Persistence\Mapping\ClassMetadata; +use Doctrine\Persistence\Mapping\ClassMetadata; +use Doctrine\Persistence\Mapping\Driver\MappingDriver; /** * Mock class for MappingDriver. diff --git a/tests/Doctrine/Tests/ORM/ConfigurationTest.php b/tests/Doctrine/Tests/ORM/ConfigurationTest.php index 92a2eeaea7..d2e839a780 100644 --- a/tests/Doctrine/Tests/ORM/ConfigurationTest.php +++ b/tests/Doctrine/Tests/ORM/ConfigurationTest.php @@ -3,7 +3,6 @@ namespace Doctrine\Tests\ORM; use Doctrine\Common\Cache\Cache; -use Doctrine\Common\Persistence\Mapping\Driver\MappingDriver; use Doctrine\Common\Proxy\AbstractProxyFactory; use Doctrine\Common\Cache\ArrayCache; use Doctrine\ORM\Cache\CacheConfiguration; @@ -15,6 +14,7 @@ use Doctrine\ORM\Mapping\QuoteStrategy; use Doctrine\ORM\ORMException; use Doctrine\ORM\Query\ResultSetMapping; +use Doctrine\Persistence\Mapping\Driver\MappingDriver; use Doctrine\Tests\Models\DDC753\DDC753CustomRepository; use ReflectionClass; use PHPUnit\Framework\TestCase; diff --git a/tests/Doctrine/Tests/ORM/EntityManagerTest.php b/tests/Doctrine/Tests/ORM/EntityManagerTest.php index 3eaf47d9f5..4886e78c65 100644 --- a/tests/Doctrine/Tests/ORM/EntityManagerTest.php +++ b/tests/Doctrine/Tests/ORM/EntityManagerTest.php @@ -3,8 +3,6 @@ namespace Doctrine\Tests\ORM; use Doctrine\Common\EventManager; -use Doctrine\Common\Persistence\Mapping\Driver\MappingDriver; -use Doctrine\Common\Persistence\Mapping\MappingException; use Doctrine\DBAL\Connection; use Doctrine\ORM\Configuration; use Doctrine\ORM\EntityManager; @@ -17,6 +15,8 @@ use Doctrine\ORM\Query\ResultSetMapping; use Doctrine\ORM\QueryBuilder; use Doctrine\ORM\UnitOfWork; +use Doctrine\Persistence\Mapping\Driver\MappingDriver; +use Doctrine\Persistence\Mapping\MappingException; use Doctrine\Tests\Models\CMS\CmsUser; use Doctrine\Tests\Models\GeoNames\Country; use Doctrine\Tests\OrmTestCase; diff --git a/tests/Doctrine/Tests/ORM/Event/OnClassMetadataNotFoundEventArgsTest.php b/tests/Doctrine/Tests/ORM/Event/OnClassMetadataNotFoundEventArgsTest.php index e5f62bd26a..8d82a24b82 100644 --- a/tests/Doctrine/Tests/ORM/Event/OnClassMetadataNotFoundEventArgsTest.php +++ b/tests/Doctrine/Tests/ORM/Event/OnClassMetadataNotFoundEventArgsTest.php @@ -2,9 +2,9 @@ namespace Doctrine\Tests\ORM; -use Doctrine\Common\Persistence\Mapping\ClassMetadata; -use Doctrine\Common\Persistence\ObjectManager; use Doctrine\ORM\Event\OnClassMetadataNotFoundEventArgs; +use Doctrine\Persistence\Mapping\ClassMetadata; +use Doctrine\Persistence\ObjectManager; use PHPUnit\Framework\TestCase; /** @@ -16,7 +16,7 @@ class OnClassMetadataNotFoundEventArgsTest extends TestCase { public function testEventArgsMutability() { - /* @var $objectManager \Doctrine\Common\Persistence\ObjectManager */ + /** @var ObjectManager $objectManager */ $objectManager = $this->createMock(ObjectManager::class); $args = new OnClassMetadataNotFoundEventArgs('foo', $objectManager); @@ -26,7 +26,7 @@ public function testEventArgsMutability() $this->assertNull($args->getFoundMetadata()); - /* @var $metadata \Doctrine\Common\Persistence\Mapping\ClassMetadata */ + /** @var ClassMetadata $metadata */ $metadata = $this->createMock(ClassMetadata::class); $args->setFoundMetadata($metadata); diff --git a/tests/Doctrine/Tests/ORM/Functional/EntityListenersTest.php b/tests/Doctrine/Tests/ORM/Functional/EntityListenersTest.php index 98457dd49d..4b066933eb 100644 --- a/tests/Doctrine/Tests/ORM/Functional/EntityListenersTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/EntityListenersTest.php @@ -2,9 +2,9 @@ namespace Doctrine\Tests\ORM\Functional; -use Doctrine\Common\Persistence\Event\LifecycleEventArgs; use Doctrine\ORM\Event\PreFlushEventArgs; use Doctrine\ORM\Event\PreUpdateEventArgs; +use Doctrine\Persistence\Event\LifecycleEventArgs; use Doctrine\Tests\Models\Company\CompanyContractListener; use Doctrine\Tests\Models\Company\CompanyFixContract; use Doctrine\Tests\OrmFunctionalTestCase; diff --git a/tests/Doctrine/Tests/ORM/Functional/EntityRepositoryTest.php b/tests/Doctrine/Tests/ORM/Functional/EntityRepositoryTest.php index b8158c17a0..c928c23aa5 100644 --- a/tests/Doctrine/Tests/ORM/Functional/EntityRepositoryTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/EntityRepositoryTest.php @@ -646,7 +646,7 @@ public function testDefaultRepositoryClassName() /** * @group DDC-753 * @expectedException Doctrine\ORM\ORMException - * @expectedExceptionMessage Invalid repository class 'Doctrine\Tests\Models\DDC753\DDC753InvalidRepository'. It must be a Doctrine\Common\Persistence\ObjectRepository. + * @expectedExceptionMessage Invalid repository class 'Doctrine\Tests\Models\DDC753\DDC753InvalidRepository'. It must be a Doctrine\Persistence\ObjectRepository. */ public function testSetDefaultRepositoryInvalidClassError() { diff --git a/tests/Doctrine/Tests/ORM/Functional/ManyToOneOrphanRemovalTest.php b/tests/Doctrine/Tests/ORM/Functional/ManyToOneOrphanRemovalTest.php index 36039b2b2a..049edd8290 100644 --- a/tests/Doctrine/Tests/ORM/Functional/ManyToOneOrphanRemovalTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/ManyToOneOrphanRemovalTest.php @@ -2,9 +2,9 @@ namespace Doctrine\Tests\ORM\Functional; -use Doctrine\Common\Persistence\Mapping\Driver\MappingDriver; use Doctrine\DBAL\Driver\Connection; use Doctrine\ORM\Mapping\Driver\XmlDriver; +use Doctrine\Persistence\Mapping\Driver\MappingDriver; use Doctrine\Tests\Models\OrnementalOrphanRemoval\PhoneNumber; use Doctrine\Tests\Models\OrnementalOrphanRemoval\Person; use Doctrine\Tests\OrmFunctionalTestCase; diff --git a/tests/Doctrine/Tests/ORM/Functional/NotifyPolicyTest.php b/tests/Doctrine/Tests/ORM/Functional/NotifyPolicyTest.php index 5444af6710..df23914b32 100644 --- a/tests/Doctrine/Tests/ORM/Functional/NotifyPolicyTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/NotifyPolicyTest.php @@ -3,8 +3,8 @@ namespace Doctrine\Tests\ORM\Functional; use Doctrine\Common\Collections\ArrayCollection; -use Doctrine\Common\NotifyPropertyChanged; -use Doctrine\Common\PropertyChangedListener; +use Doctrine\Persistence\NotifyPropertyChanged; +use Doctrine\Persistence\PropertyChangedListener; use Doctrine\Tests\OrmFunctionalTestCase; /** diff --git a/tests/Doctrine/Tests/ORM/Functional/ReferenceProxyTest.php b/tests/Doctrine/Tests/ORM/Functional/ReferenceProxyTest.php index 5e1cb2fb22..d2e0e82725 100644 --- a/tests/Doctrine/Tests/ORM/Functional/ReferenceProxyTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/ReferenceProxyTest.php @@ -2,9 +2,9 @@ namespace Doctrine\Tests\ORM\Functional; -use Doctrine\Common\Persistence\Proxy; use Doctrine\Common\Util\ClassUtils; use Doctrine\ORM\Proxy\ProxyFactory; +use Doctrine\Persistence\Proxy; use Doctrine\Tests\Models\Company\CompanyAuction; use Doctrine\Tests\Models\ECommerce\ECommerceProduct; use Doctrine\Tests\Models\ECommerce\ECommerceShipping; diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1690Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1690Test.php index 47e79ed7ae..dc5feb9833 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1690Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1690Test.php @@ -2,9 +2,9 @@ namespace Doctrine\Tests\ORM\Functional\Ticket; -use Doctrine\Common\NotifyPropertyChanged; -use Doctrine\Common\PropertyChangedListener; use Doctrine\ORM\Proxy\Proxy; +use Doctrine\Persistence\NotifyPropertyChanged; +use Doctrine\Persistence\PropertyChangedListener; class DDC1690Test extends \Doctrine\Tests\OrmFunctionalTestCase { diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2230Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2230Test.php index d68fd8a52e..3fd6ea49d9 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2230Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2230Test.php @@ -2,10 +2,10 @@ namespace Doctrine\Tests\ORM\Functional\Ticket; -use Doctrine\Common\NotifyPropertyChanged; -use Doctrine\Common\PropertyChangedListener; use Doctrine\Common\Proxy\Proxy; use Doctrine\ORM\Tools\ToolsException; +use Doctrine\Persistence\NotifyPropertyChanged; +use Doctrine\Persistence\PropertyChangedListener; use Doctrine\Tests\OrmFunctionalTestCase; use Doctrine\Tests\VerifyDeprecations; diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2231Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2231Test.php index 6bfd8d823d..dcca1360e1 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2231Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2231Test.php @@ -2,10 +2,10 @@ namespace Doctrine\Tests\ORM\Functional\Ticket; -use Doctrine\Common\Persistence\Mapping\ClassMetadata; -use Doctrine\Common\Persistence\ObjectManager; -use Doctrine\Common\Persistence\ObjectManagerAware; use Doctrine\ORM\Proxy\Proxy; +use Doctrine\Persistence\Mapping\ClassMetadata; +use Doctrine\Persistence\ObjectManager; +use Doctrine\Persistence\ObjectManagerAware; /** * @group DDC-2231 diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2359Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2359Test.php index 21a932ed36..ad906fd912 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2359Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2359Test.php @@ -2,12 +2,12 @@ namespace Doctrine\Tests\ORM\Functional\Ticket; use Doctrine\Common\EventManager; -use Doctrine\Common\Persistence\Mapping\Driver\MappingDriver; use Doctrine\DBAL\Connection; use Doctrine\ORM\Configuration; use Doctrine\ORM\EntityManager; use Doctrine\ORM\Mapping\ClassMetadata; use Doctrine\ORM\Mapping\ClassMetadataFactory; +use Doctrine\Persistence\Mapping\Driver\MappingDriver; use PHPUnit\Framework\TestCase; /** diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC6303Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC6303Test.php index 732808b5f0..22c898eeb0 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC6303Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC6303Test.php @@ -4,6 +4,7 @@ namespace Doctrine\Tests\ORM\Functional\Ticket; use Doctrine\ORM\Tools\ToolsException; +use Doctrine\Persistence\Mapping\MappingException; use Doctrine\Tests\OrmFunctionalTestCase; /** @@ -49,7 +50,7 @@ public function testEmptyValuesInJoinedInheritance() : void /** * @param DDC6303BaseClass[] $persistedEntities indexed by identifier * - * @throws \Doctrine\Common\Persistence\Mapping\MappingException + * @throws MappingException * @throws \Doctrine\ORM\ORMException * @throws \Doctrine\ORM\OptimisticLockException */ diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC933Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC933Test.php index f6216a1623..9fda6ed03b 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC933Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC933Test.php @@ -3,6 +3,7 @@ namespace Doctrine\Tests\ORM\Functional\Ticket; use Doctrine\DBAL\LockMode; +use Doctrine\Persistence\Mapping\MappingException; use Doctrine\Tests\Models\Company\CompanyManager; use Doctrine\Tests\OrmFunctionalTestCase; use Doctrine\Tests\TestUtil; @@ -48,7 +49,7 @@ public function testLockCTIClass() * * @return void * - * @throws \Doctrine\Common\Persistence\Mapping\MappingException + * @throws MappingException * @throws \Doctrine\ORM\ORMException * @throws \Doctrine\ORM\OptimisticLockException * @throws \Doctrine\ORM\TransactionRequiredException diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/GH7079Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/GH7079Test.php index 5df5dfcb06..a59dd67bbf 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/GH7079Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/GH7079Test.php @@ -4,10 +4,10 @@ namespace Doctrine\Tests\ORM\Functional\Ticket; -use Doctrine\Common\Persistence\Mapping\RuntimeReflectionService; use Doctrine\DBAL\Platforms\AbstractPlatform; use Doctrine\ORM\Mapping\ClassMetadata; use Doctrine\ORM\Mapping\DefaultQuoteStrategy; +use Doctrine\Persistence\Mapping\RuntimeReflectionService; use Doctrine\Tests\OrmFunctionalTestCase; /** diff --git a/tests/Doctrine/Tests/ORM/Hydration/ResultSetMappingTest.php b/tests/Doctrine/Tests/ORM/Hydration/ResultSetMappingTest.php index 3ec87b237d..e341a35131 100644 --- a/tests/Doctrine/Tests/ORM/Hydration/ResultSetMappingTest.php +++ b/tests/Doctrine/Tests/ORM/Hydration/ResultSetMappingTest.php @@ -4,6 +4,7 @@ use Doctrine\ORM\Mapping\ClassMetadata; use Doctrine\ORM\Query\ResultSetMapping; +use Doctrine\Persistence\Mapping\RuntimeReflectionService; use Doctrine\Tests\Models\CMS\CmsEmail; use Doctrine\Tests\Models\CMS\CmsPhonenumber; use Doctrine\Tests\Models\CMS\CmsUser; @@ -102,7 +103,7 @@ public function testFluentInterface() public function testAddNamedNativeQueryResultSetMapping() { $cm = new ClassMetadata(CmsUser::class); - $cm->initializeReflection(new \Doctrine\Common\Persistence\Mapping\RuntimeReflectionService); + $cm->initializeReflection(new RuntimeReflectionService()); $cm->mapOneToOne( [ @@ -194,7 +195,7 @@ public function testAddNamedNativeQueryResultSetMapping() public function testAddNamedNativeQueryResultSetMappingWithoutFields() { $cm = new ClassMetadata(CmsUser::class); - $cm->initializeReflection(new \Doctrine\Common\Persistence\Mapping\RuntimeReflectionService); + $cm->initializeReflection(new RuntimeReflectionService()); $cm->addNamedNativeQuery( [ @@ -244,7 +245,7 @@ public function testAddNamedNativeQueryResultClass() { $cm = new ClassMetadata(CmsUser::class); - $cm->initializeReflection(new \Doctrine\Common\Persistence\Mapping\RuntimeReflectionService); + $cm->initializeReflection(new RuntimeReflectionService()); $cm->addNamedNativeQuery( [ diff --git a/tests/Doctrine/Tests/ORM/Internal/HydrationCompleteHandlerTest.php b/tests/Doctrine/Tests/ORM/Internal/HydrationCompleteHandlerTest.php index e4e9bcdf7d..bd8046a99a 100644 --- a/tests/Doctrine/Tests/ORM/Internal/HydrationCompleteHandlerTest.php +++ b/tests/Doctrine/Tests/ORM/Internal/HydrationCompleteHandlerTest.php @@ -19,12 +19,12 @@ namespace Doctrine\Tests\ORM\Internal; -use Doctrine\Common\Persistence\Event\LifecycleEventArgs; use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\Event\ListenersInvoker; use Doctrine\ORM\Events; use Doctrine\ORM\Internal\HydrationCompleteHandler; use Doctrine\ORM\Mapping\ClassMetadata; +use Doctrine\Persistence\Event\LifecycleEventArgs; use PHPUnit\Framework\TestCase; use stdClass; diff --git a/tests/Doctrine/Tests/ORM/Mapping/AbstractMappingDriverTest.php b/tests/Doctrine/Tests/ORM/Mapping/AbstractMappingDriverTest.php index e13d7aa7e5..502ed479e2 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/AbstractMappingDriverTest.php +++ b/tests/Doctrine/Tests/ORM/Mapping/AbstractMappingDriverTest.php @@ -2,7 +2,6 @@ namespace Doctrine\Tests\ORM\Mapping; -use Doctrine\Common\Persistence\Mapping\RuntimeReflectionService; use Doctrine\ORM\EntityManager; use Doctrine\ORM\Events; use Doctrine\ORM\Mapping\ClassMetadata; @@ -13,6 +12,7 @@ use Doctrine\ORM\Mapping\Id; use Doctrine\ORM\Mapping\MappingException; use Doctrine\ORM\Mapping\UnderscoreNamingStrategy; +use Doctrine\Persistence\Mapping\RuntimeReflectionService; use Doctrine\Tests\Models\Cache\City; use Doctrine\Tests\Models\CMS\CmsAddress; use Doctrine\Tests\Models\CMS\CmsAddressListener; diff --git a/tests/Doctrine/Tests/ORM/Mapping/AnnotationDriverTest.php b/tests/Doctrine/Tests/ORM/Mapping/AnnotationDriverTest.php index b30ed703bc..1083143762 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/AnnotationDriverTest.php +++ b/tests/Doctrine/Tests/ORM/Mapping/AnnotationDriverTest.php @@ -4,12 +4,12 @@ use Doctrine\Common\Annotations\AnnotationException; use Doctrine\Common\Annotations\AnnotationReader; -use Doctrine\Common\Persistence\Mapping\RuntimeReflectionService; use Doctrine\ORM\Mapping; use Doctrine\ORM\Mapping\ClassMetadata; use Doctrine\ORM\Mapping\ClassMetadataFactory; use Doctrine\ORM\Mapping\Driver\AnnotationDriver; use Doctrine\ORM\Mapping\MappingException; +use Doctrine\Persistence\Mapping\RuntimeReflectionService; use Doctrine\Tests\Models\CMS\CmsUser; use Doctrine\Tests\Models\DDC1872\DDC1872ExampleEntityWithoutOverride; use Doctrine\Tests\Models\DDC1872\DDC1872ExampleEntityWithOverride; diff --git a/tests/Doctrine/Tests/ORM/Mapping/AnsiQuoteStrategyTest.php b/tests/Doctrine/Tests/ORM/Mapping/AnsiQuoteStrategyTest.php index a0b422c0f7..f447a56195 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/AnsiQuoteStrategyTest.php +++ b/tests/Doctrine/Tests/ORM/Mapping/AnsiQuoteStrategyTest.php @@ -2,9 +2,9 @@ namespace Doctrine\Tests\ORM\Mapping; -use Doctrine\Common\Persistence\Mapping\RuntimeReflectionService; use Doctrine\ORM\Mapping\AnsiQuoteStrategy; use Doctrine\ORM\Mapping\ClassMetadata; +use Doctrine\Persistence\Mapping\RuntimeReflectionService; use Doctrine\Tests\Models\CMS\CmsAddress; use Doctrine\Tests\Models\CMS\CmsUser; use Doctrine\Tests\Models\DDC117\DDC117Article; diff --git a/tests/Doctrine/Tests/ORM/Mapping/BasicInheritanceMappingTest.php b/tests/Doctrine/Tests/ORM/Mapping/BasicInheritanceMappingTest.php index 292954506a..cc95a21b64 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/BasicInheritanceMappingTest.php +++ b/tests/Doctrine/Tests/ORM/Mapping/BasicInheritanceMappingTest.php @@ -2,12 +2,12 @@ namespace Doctrine\Tests\ORM\Mapping; -use Doctrine\Common\Persistence\Mapping\RuntimeReflectionService; use Doctrine\ORM\EntityRepository; use Doctrine\ORM\Id\SequenceGenerator; use Doctrine\ORM\Mapping\ClassMetadataFactory; use Doctrine\ORM\Mapping\ClassMetadataInfo; use Doctrine\ORM\Mapping\MappingException; +use Doctrine\Persistence\Mapping\RuntimeReflectionService; use Doctrine\Tests\Models\DDC869\DDC869ChequePayment; use Doctrine\Tests\Models\DDC869\DDC869CreditCardPayment; use Doctrine\Tests\Models\DDC869\DDC869Payment; diff --git a/tests/Doctrine/Tests/ORM/Mapping/ClassMetadataBuilderTest.php b/tests/Doctrine/Tests/ORM/Mapping/ClassMetadataBuilderTest.php index 657ad65b47..5b0881de42 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/ClassMetadataBuilderTest.php +++ b/tests/Doctrine/Tests/ORM/Mapping/ClassMetadataBuilderTest.php @@ -2,11 +2,11 @@ namespace Doctrine\Tests\ORM\Mapping; -use Doctrine\Common\Persistence\Mapping\RuntimeReflectionService; use Doctrine\ORM\Mapping\Builder\ClassMetadataBuilder; use Doctrine\ORM\Mapping\Builder\EmbeddedBuilder; use Doctrine\ORM\Mapping\Builder\FieldBuilder; use Doctrine\ORM\Mapping\ClassMetadata; +use Doctrine\Persistence\Mapping\RuntimeReflectionService; use Doctrine\Tests\Models\CMS\CmsGroup; use Doctrine\Tests\Models\CMS\CmsUser; use Doctrine\Tests\Models\ValueObjects\Name; diff --git a/tests/Doctrine/Tests/ORM/Mapping/ClassMetadataFactoryTest.php b/tests/Doctrine/Tests/ORM/Mapping/ClassMetadataFactoryTest.php index 8c73bf1c2d..3564758673 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/ClassMetadataFactoryTest.php +++ b/tests/Doctrine/Tests/ORM/Mapping/ClassMetadataFactoryTest.php @@ -3,8 +3,6 @@ namespace Doctrine\Tests\ORM\Mapping; use Doctrine\Common\EventManager; -use Doctrine\Common\Persistence\Mapping\Driver\MappingDriver; -use Doctrine\Common\Persistence\Mapping\RuntimeReflectionService; use Doctrine\DBAL\Connection; use Doctrine\ORM\Configuration; use Doctrine\ORM\EntityManager; @@ -16,6 +14,8 @@ use Doctrine\ORM\Mapping\ClassMetadataFactory; use Doctrine\ORM\Mapping\MappingException; use Doctrine\ORM\ORMException; +use Doctrine\Persistence\Mapping\Driver\MappingDriver; +use Doctrine\Persistence\Mapping\RuntimeReflectionService; use Doctrine\Tests\Mocks\ConnectionMock; use Doctrine\Tests\Mocks\DriverMock; use Doctrine\Tests\Mocks\EntityManagerMock; @@ -372,7 +372,7 @@ public function testQuoteMetadata() public function testFallbackLoadingCausesEventTriggeringThatCanModifyFetchedMetadata() { $test = $this; - /* @var $metadata \Doctrine\Common\Persistence\Mapping\ClassMetadata */ + /** @var ClassMetadata $metadata */ $metadata = $this->createMock(ClassMetadata::class); $cmf = new ClassMetadataFactory(); $mockDriver = new MetadataDriverMock(); diff --git a/tests/Doctrine/Tests/ORM/Mapping/ClassMetadataTest.php b/tests/Doctrine/Tests/ORM/Mapping/ClassMetadataTest.php index a7be70be84..b497655096 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/ClassMetadataTest.php +++ b/tests/Doctrine/Tests/ORM/Mapping/ClassMetadataTest.php @@ -2,13 +2,13 @@ namespace Doctrine\Tests\ORM\Mapping; -use Doctrine\Common\Persistence\Mapping\RuntimeReflectionService; -use Doctrine\Common\Persistence\Mapping\StaticReflectionService; use Doctrine\ORM\Events; use Doctrine\ORM\Mapping\ClassMetadata; use Doctrine\ORM\Mapping\DefaultNamingStrategy; use Doctrine\ORM\Mapping\MappingException; use Doctrine\ORM\Mapping\UnderscoreNamingStrategy; +use Doctrine\Persistence\Mapping\RuntimeReflectionService; +use Doctrine\Persistence\Mapping\StaticReflectionService; use Doctrine\Tests\Models\CMS; use Doctrine\Tests\Models\Company\CompanyContract; use Doctrine\Tests\Models\CustomType\CustomTypeParent; diff --git a/tests/Doctrine/Tests/ORM/Mapping/PHPMappingDriverTest.php b/tests/Doctrine/Tests/ORM/Mapping/PHPMappingDriverTest.php index 04493dbc42..fbd22a1a5c 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/PHPMappingDriverTest.php +++ b/tests/Doctrine/Tests/ORM/Mapping/PHPMappingDriverTest.php @@ -2,8 +2,8 @@ namespace Doctrine\Tests\ORM\Mapping; -use Doctrine\Common\Persistence\Mapping\Driver\PHPDriver; use Doctrine\ORM\Mapping\ClassMetadata; +use Doctrine\Persistence\Mapping\Driver\PHPDriver; use Doctrine\Tests\Models\DDC889\DDC889Class; use Doctrine\Tests\ORM\Mapping; diff --git a/tests/Doctrine/Tests/ORM/Mapping/QuoteStrategyTest.php b/tests/Doctrine/Tests/ORM/Mapping/QuoteStrategyTest.php index 2af97169c8..c264e98e7b 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/QuoteStrategyTest.php +++ b/tests/Doctrine/Tests/ORM/Mapping/QuoteStrategyTest.php @@ -2,10 +2,10 @@ namespace Doctrine\Tests\ORM\Mapping; -use Doctrine\Common\Persistence\Mapping\RuntimeReflectionService; use Doctrine\ORM\Mapping\ClassMetadata; use Doctrine\ORM\Mapping\DefaultQuoteStrategy; use Doctrine\ORM\Mapping\QuoteStrategy; +use Doctrine\Persistence\Mapping\RuntimeReflectionService; use Doctrine\Tests\Models\CMS\CmsAddress; use Doctrine\Tests\Models\CMS\CmsUser; use Doctrine\Tests\Models\DDC117\DDC117Article; diff --git a/tests/Doctrine/Tests/ORM/Mapping/Reflection/ReflectionPropertiesGetterTest.php b/tests/Doctrine/Tests/ORM/Mapping/Reflection/ReflectionPropertiesGetterTest.php index 29906d59b9..86c4393513 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/Reflection/ReflectionPropertiesGetterTest.php +++ b/tests/Doctrine/Tests/ORM/Mapping/Reflection/ReflectionPropertiesGetterTest.php @@ -2,9 +2,9 @@ namespace Doctrine\Tests\ORM\Mapping\Reflection; -use Doctrine\Common\Persistence\Mapping\ReflectionService; -use Doctrine\Common\Persistence\Mapping\RuntimeReflectionService; use Doctrine\ORM\Mapping\Reflection\ReflectionPropertiesGetter; +use Doctrine\Persistence\Mapping\ReflectionService; +use Doctrine\Persistence\Mapping\RuntimeReflectionService; use Doctrine\Tests\Models\Reflection\ClassWithMixedProperties; use Doctrine\Tests\Models\Reflection\ParentClass; use PHPUnit\Framework\TestCase; diff --git a/tests/Doctrine/Tests/ORM/Mapping/StaticPHPMappingDriverTest.php b/tests/Doctrine/Tests/ORM/Mapping/StaticPHPMappingDriverTest.php index 3bc5a5d5d2..bdce6343d1 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/StaticPHPMappingDriverTest.php +++ b/tests/Doctrine/Tests/ORM/Mapping/StaticPHPMappingDriverTest.php @@ -2,8 +2,8 @@ namespace Doctrine\Tests\ORM\Mapping; -use Doctrine\Common\Persistence\Mapping\Driver\StaticPHPDriver; use Doctrine\ORM\Mapping\ClassMetadata; +use Doctrine\Persistence\Mapping\Driver\StaticPHPDriver; use Doctrine\Tests\Models\DDC889\DDC889Class; class StaticPHPMappingDriverTest extends AbstractMappingDriverTest diff --git a/tests/Doctrine/Tests/ORM/Mapping/Symfony/AbstractDriverTest.php b/tests/Doctrine/Tests/ORM/Mapping/Symfony/AbstractDriverTest.php index 85b3b2138d..c905929a7e 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/Symfony/AbstractDriverTest.php +++ b/tests/Doctrine/Tests/ORM/Mapping/Symfony/AbstractDriverTest.php @@ -1,7 +1,8 @@ Date: Mon, 11 May 2020 23:06:46 +0200 Subject: [PATCH 081/136] Static analysis with Psalm (#8116) * Remove useless ternaries If these expressions are truish inside the condition, they will still be truish inside the if. * Describe properties more accurately These are not objects, they are strings holding class names for classes that implement TreeWalker. * Remove duplicate key Comparison::IS and Comparison::EQ are the same. I chose to remove IS because it does not seem to exist anymore on master * Remove unwanted . before = operator This worked, but makes no sense. * Setup static analysis with Psalm * Move PHPStan to Github actions --- .github/workflows/ci.yml | 70 ++ .travis.yml | 10 - composer.json | 7 +- composer.lock | 741 +++++++++++++++++- .../Entity/BasicEntityPersister.php | 1 - lib/Doctrine/ORM/Query/Parser.php | 2 +- .../ORM/Query/TreeWalkerChainIterator.php | 2 +- lib/Doctrine/ORM/Tools/EntityGenerator.php | 6 +- .../ORM/Tools/Export/Driver/XmlExporter.php | 2 +- phpstan.neon | 3 + psalm.xml | 15 + 11 files changed, 840 insertions(+), 19 deletions(-) create mode 100644 .github/workflows/ci.yml create mode 100644 psalm.xml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000000..9ff8c27b2c --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,70 @@ +name: CI + +on: + pull_request: + +jobs: + static-analysis-phpstan: + name: "Static Analysis with PHPStan" + runs-on: "ubuntu-latest" + + strategy: + matrix: + php-version: + - "7.4" + + steps: + - name: "Checkout code" + uses: "actions/checkout@v2" + + - name: "Install PHP" + uses: "shivammathur/setup-php@v2" + with: + coverage: "none" + php-version: "${{ matrix.php-version }}" + tools: cs2pr + + - name: "Cache dependencies installed with composer" + uses: "actions/cache@v1" + with: + path: "~/.composer/cache" + key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}" + restore-keys: "php-${{ matrix.php-version }}-composer-locked-" + + - name: "Install dependencies with composer" + run: "composer install --no-progress --no-suggest --no-interaction --prefer-dist" + + - name: "Run a static analysis with phpstan/phpstan" + run: "php vendor/bin/phpstan analyse --error-format=checkstyle | cs2pr" + + static-analysis-psalm: + name: "Static Analysis with Psalm" + runs-on: "ubuntu-latest" + + strategy: + matrix: + php-version: + - "7.4" + + steps: + - name: "Checkout code" + uses: "actions/checkout@v2" + + - name: "Install PHP" + uses: "shivammathur/setup-php@v2" + with: + coverage: "none" + php-version: "${{ matrix.php-version }}" + + - name: "Cache dependencies installed with composer" + uses: "actions/cache@v1" + with: + path: "~/.composer/cache" + key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}" + restore-keys: "php-${{ matrix.php-version }}-composer-locked-" + + - name: "Install dependencies with composer" + run: "composer install --no-interaction --no-progress --no-suggest" + + - name: "Run a static analysis with vimeo/psalm" + run: "vendor/bin/psalm --show-info=false --stats --output-format=github --threads=$(nproc)" diff --git a/.travis.yml b/.travis.yml index 8b0564efb2..c32ef79d21 100644 --- a/.travis.yml +++ b/.travis.yml @@ -84,16 +84,6 @@ jobs: - wget https://scrutinizer-ci.com/ocular.phar - php ocular.phar code-coverage:upload --format=php-clover build/logs/clover.xml - - stage: Code Quality - env: DB=none STATIC_ANALYSIS - php: 7.4 - install: travis_retry composer install --prefer-dist - before_script: - - echo "extension=memcached.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini - - echo "extension=redis.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini - - travis_retry composer require --dev --prefer-dist --prefer-stable phpstan/phpstan:^0.9 - script: vendor/bin/phpstan analyse -l 1 -c phpstan.neon lib - - stage: Code Quality env: DB=none BENCHMARK before_script: wget https://phpbench.github.io/phpbench/phpbench.phar https://phpbench.github.io/phpbench/phpbench.phar.pubkey diff --git a/composer.json b/composer.json index 67dd564181..3d02838f10 100644 --- a/composer.json +++ b/composer.json @@ -13,6 +13,9 @@ {"name": "Marco Pivetta", "email": "ocramius@gmail.com"} ], "config": { + "platform": { + "php": "7.1.3" + }, "sort-packages": true }, "require": { @@ -31,8 +34,10 @@ }, "require-dev": { "doctrine/coding-standard": "^5.0", + "phpstan/phpstan": "^0.12.18", "phpunit/phpunit": "^7.5", - "symfony/yaml": "^3.4|^4.0|^5.0" + "symfony/yaml": "^3.4|^4.0|^5.0", + "vimeo/psalm": "^3.11" }, "suggest": { "symfony/yaml": "If you want to use YAML Metadata Mapping Driver" diff --git a/composer.lock b/composer.lock index 3e0bb024d7..d602f167e6 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": "3ecc0039f7919112197e4fb876a5184d", + "content-hash": "41b259f8d2ab145c98151104fc3e1aa8", "packages": [ { "name": "doctrine/annotations", @@ -1091,6 +1091,260 @@ } ], "packages-dev": [ + { + "name": "amphp/amp", + "version": "v2.4.4", + "source": { + "type": "git", + "url": "https://github.com/amphp/amp.git", + "reference": "1e58d53e4af390efc7813e36cd215bd82cba4b06" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/amphp/amp/zipball/1e58d53e4af390efc7813e36cd215bd82cba4b06", + "reference": "1e58d53e4af390efc7813e36cd215bd82cba4b06", + "shasum": "" + }, + "require": { + "php": ">=7" + }, + "require-dev": { + "amphp/php-cs-fixer-config": "dev-master", + "amphp/phpunit-util": "^1", + "ext-json": "*", + "jetbrains/phpstorm-stubs": "^2019.3", + "phpunit/phpunit": "^6.0.9 | ^7", + "react/promise": "^2", + "vimeo/psalm": "^3.11@dev" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "autoload": { + "psr-4": { + "Amp\\": "lib" + }, + "files": [ + "lib/functions.php", + "lib/Internal/functions.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Daniel Lowrey", + "email": "rdlowrey@php.net" + }, + { + "name": "Aaron Piotrowski", + "email": "aaron@trowski.com" + }, + { + "name": "Bob Weinand", + "email": "bobwei9@hotmail.com" + }, + { + "name": "Niklas Keller", + "email": "me@kelunik.com" + } + ], + "description": "A non-blocking concurrency framework for PHP applications.", + "homepage": "http://amphp.org/amp", + "keywords": [ + "async", + "asynchronous", + "awaitable", + "concurrency", + "event", + "event-loop", + "future", + "non-blocking", + "promise" + ], + "time": "2020-04-30T04:54:50+00:00" + }, + { + "name": "amphp/byte-stream", + "version": "v1.7.3", + "source": { + "type": "git", + "url": "https://github.com/amphp/byte-stream.git", + "reference": "b867505edb79dda8f253ca3c3a2bbadae4b16592" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/amphp/byte-stream/zipball/b867505edb79dda8f253ca3c3a2bbadae4b16592", + "reference": "b867505edb79dda8f253ca3c3a2bbadae4b16592", + "shasum": "" + }, + "require": { + "amphp/amp": "^2" + }, + "require-dev": { + "amphp/php-cs-fixer-config": "dev-master", + "amphp/phpunit-util": "^1", + "friendsofphp/php-cs-fixer": "^2.3", + "jetbrains/phpstorm-stubs": "^2019.3", + "phpunit/phpunit": "^6 || ^7 || ^8", + "vimeo/psalm": "^3.9@dev" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Amp\\ByteStream\\": "lib" + }, + "files": [ + "lib/functions.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Aaron Piotrowski", + "email": "aaron@trowski.com" + }, + { + "name": "Niklas Keller", + "email": "me@kelunik.com" + } + ], + "description": "A stream abstraction to make working with non-blocking I/O simple.", + "homepage": "http://amphp.org/byte-stream", + "keywords": [ + "amp", + "amphp", + "async", + "io", + "non-blocking", + "stream" + ], + "time": "2020-04-04T16:56:54+00:00" + }, + { + "name": "composer/semver", + "version": "1.5.1", + "source": { + "type": "git", + "url": "https://github.com/composer/semver.git", + "reference": "c6bea70230ef4dd483e6bbcab6005f682ed3a8de" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/semver/zipball/c6bea70230ef4dd483e6bbcab6005f682ed3a8de", + "reference": "c6bea70230ef4dd483e6bbcab6005f682ed3a8de", + "shasum": "" + }, + "require": { + "php": "^5.3.2 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.5 || ^5.0.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\Semver\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nils Adermann", + "email": "naderman@naderman.de", + "homepage": "http://www.naderman.de" + }, + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + }, + { + "name": "Rob Bast", + "email": "rob.bast@gmail.com", + "homepage": "http://robbast.nl" + } + ], + "description": "Semver library that offers utilities, version constraint parsing and validation.", + "keywords": [ + "semantic", + "semver", + "validation", + "versioning" + ], + "time": "2020-01-13T12:06:48+00:00" + }, + { + "name": "composer/xdebug-handler", + "version": "1.4.1", + "source": { + "type": "git", + "url": "https://github.com/composer/xdebug-handler.git", + "reference": "1ab9842d69e64fb3a01be6b656501032d1b78cb7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/1ab9842d69e64fb3a01be6b656501032d1b78cb7", + "reference": "1ab9842d69e64fb3a01be6b656501032d1b78cb7", + "shasum": "" + }, + "require": { + "php": "^5.3.2 || ^7.0 || ^8.0", + "psr/log": "^1.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || 6.5 - 8" + }, + "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" + ], + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + } + ], + "time": "2020-03-01T12:26:26+00:00" + }, { "name": "dealerdirect/phpcodesniffer-composer-installer", "version": "v0.5.0", @@ -1218,6 +1472,94 @@ ], "time": "2019-01-31T13:22:30+00:00" }, + { + "name": "felixfbecker/advanced-json-rpc", + "version": "v3.1.1", + "source": { + "type": "git", + "url": "https://github.com/felixfbecker/php-advanced-json-rpc.git", + "reference": "0ed363f8de17d284d479ec813c9ad3f6834b5c40" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/felixfbecker/php-advanced-json-rpc/zipball/0ed363f8de17d284d479ec813c9ad3f6834b5c40", + "reference": "0ed363f8de17d284d479ec813c9ad3f6834b5c40", + "shasum": "" + }, + "require": { + "netresearch/jsonmapper": "^1.0 || ^2.0", + "php": ">=7.0", + "phpdocumentor/reflection-docblock": "^4.0.0 || ^5.0.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "AdvancedJsonRpc\\": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "ISC" + ], + "authors": [ + { + "name": "Felix Becker", + "email": "felix.b@outlook.com" + } + ], + "description": "A more advanced JSONRPC implementation", + "time": "2020-03-11T15:21:41+00:00" + }, + { + "name": "felixfbecker/language-server-protocol", + "version": "v1.4.0", + "source": { + "type": "git", + "url": "https://github.com/felixfbecker/php-language-server-protocol.git", + "reference": "378801f6139bb74ac215d81cca1272af61df9a9f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/felixfbecker/php-language-server-protocol/zipball/378801f6139bb74ac215d81cca1272af61df9a9f", + "reference": "378801f6139bb74ac215d81cca1272af61df9a9f", + "shasum": "" + }, + "require": { + "php": "^7.0" + }, + "require-dev": { + "phpstan/phpstan": "*", + "phpunit/phpunit": "^6.3", + "squizlabs/php_codesniffer": "^3.1" + }, + "type": "library", + "autoload": { + "psr-4": { + "LanguageServerProtocol\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "ISC" + ], + "authors": [ + { + "name": "Felix Becker", + "email": "felix.b@outlook.com" + } + ], + "description": "PHP classes for the Language Server Protocol", + "keywords": [ + "language", + "microsoft", + "php", + "server" + ], + "time": "2019-06-23T21:03:50+00:00" + }, { "name": "myclabs/deep-copy", "version": "1.9.3", @@ -1266,6 +1608,153 @@ ], "time": "2019-08-09T12:45:53+00:00" }, + { + "name": "netresearch/jsonmapper", + "version": "v2.1.0", + "source": { + "type": "git", + "url": "https://github.com/cweiske/jsonmapper.git", + "reference": "e0f1e33a71587aca81be5cffbb9746510e1fe04e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/cweiske/jsonmapper/zipball/e0f1e33a71587aca81be5cffbb9746510e1fe04e", + "reference": "e0f1e33a71587aca81be5cffbb9746510e1fe04e", + "shasum": "" + }, + "require": { + "ext-json": "*", + "ext-pcre": "*", + "ext-reflection": "*", + "ext-spl": "*", + "php": ">=5.6" + }, + "require-dev": { + "phpunit/phpunit": "~4.8.35 || ~5.7 || ~6.4 || ~7.0", + "squizlabs/php_codesniffer": "~3.5" + }, + "type": "library", + "autoload": { + "psr-0": { + "JsonMapper": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "OSL-3.0" + ], + "authors": [ + { + "name": "Christian Weiske", + "email": "cweiske@cweiske.de", + "homepage": "http://github.com/cweiske/jsonmapper/", + "role": "Developer" + } + ], + "description": "Map nested JSON structures onto PHP classes", + "time": "2020-04-16T18:48:43+00:00" + }, + { + "name": "nikic/php-parser", + "version": "v4.4.0", + "source": { + "type": "git", + "url": "https://github.com/nikic/PHP-Parser.git", + "reference": "bd43ec7152eaaab3bd8c6d0aa95ceeb1df8ee120" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/bd43ec7152eaaab3bd8c6d0aa95ceeb1df8ee120", + "reference": "bd43ec7152eaaab3bd8c6d0aa95ceeb1df8ee120", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": ">=7.0" + }, + "require-dev": { + "ircmaxell/php-yacc": "0.0.5", + "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0" + }, + "bin": [ + "bin/php-parse" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.3-dev" + } + }, + "autoload": { + "psr-4": { + "PhpParser\\": "lib/PhpParser" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Nikita Popov" + } + ], + "description": "A PHP parser written in PHP", + "keywords": [ + "parser", + "php" + ], + "time": "2020-04-10T16:34:50+00:00" + }, + { + "name": "openlss/lib-array2xml", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/nullivex/lib-array2xml.git", + "reference": "a91f18a8dfc69ffabe5f9b068bc39bb202c81d90" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nullivex/lib-array2xml/zipball/a91f18a8dfc69ffabe5f9b068bc39bb202c81d90", + "reference": "a91f18a8dfc69ffabe5f9b068bc39bb202c81d90", + "shasum": "" + }, + "require": { + "php": ">=5.3.2" + }, + "type": "library", + "autoload": { + "psr-0": { + "LSS": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Bryan Tong", + "email": "bryan@nullivex.com", + "homepage": "https://www.nullivex.com" + }, + { + "name": "Tony Butler", + "email": "spudz76@gmail.com", + "homepage": "https://www.nullivex.com" + } + ], + "description": "Array2XML conversion library credit to lalit.org", + "homepage": "https://www.nullivex.com", + "keywords": [ + "array", + "array conversion", + "xml", + "xml conversion" + ], + "time": "2019-03-29T20:06:56+00:00" + }, { "name": "phar-io/manifest", "version": "1.0.3", @@ -1581,6 +2070,62 @@ ], "time": "2019-10-03T11:07:50+00:00" }, + { + "name": "phpstan/phpstan", + "version": "0.12.24", + "source": { + "type": "git", + "url": "https://github.com/phpstan/phpstan.git", + "reference": "823a120fea50b68742b2be2285818202ecce511e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/823a120fea50b68742b2be2285818202ecce511e", + "reference": "823a120fea50b68742b2be2285818202ecce511e", + "shasum": "" + }, + "require": { + "php": "^7.1" + }, + "conflict": { + "phpstan/phpstan-shim": "*" + }, + "bin": [ + "phpstan", + "phpstan.phar" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "0.12-dev" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "PHPStan - PHP Static Analysis Tool", + "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-05-10T14:25:55+00:00" + }, { "name": "phpunit/php-code-coverage", "version": "6.1.4", @@ -2730,6 +3275,104 @@ "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", "time": "2019-06-13T22:48:21+00:00" }, + { + "name": "vimeo/psalm", + "version": "3.11.2", + "source": { + "type": "git", + "url": "https://github.com/vimeo/psalm.git", + "reference": "d470903722cfcbc1cd04744c5491d3e6d13ec3d9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/vimeo/psalm/zipball/d470903722cfcbc1cd04744c5491d3e6d13ec3d9", + "reference": "d470903722cfcbc1cd04744c5491d3e6d13ec3d9", + "shasum": "" + }, + "require": { + "amphp/amp": "^2.1", + "amphp/byte-stream": "^1.5", + "composer/semver": "^1.4", + "composer/xdebug-handler": "^1.1", + "ext-dom": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-simplexml": "*", + "ext-tokenizer": "*", + "felixfbecker/advanced-json-rpc": "^3.0.3", + "felixfbecker/language-server-protocol": "^1.4", + "netresearch/jsonmapper": "^1.0 || ^2.0", + "nikic/php-parser": "^4.3", + "ocramius/package-versions": "^1.2", + "openlss/lib-array2xml": "^1.0", + "php": "^7.1.3|^8", + "sebastian/diff": "^3.0 || ^4.0", + "symfony/console": "^3.4.17 || ^4.1.6 || ^5.0", + "webmozart/glob": "^4.1", + "webmozart/path-util": "^2.3" + }, + "provide": { + "psalm/psalm": "self.version" + }, + "require-dev": { + "amphp/amp": "^2.4.2", + "bamarni/composer-bin-plugin": "^1.2", + "brianium/paratest": "^4.0.0", + "ext-curl": "*", + "php-coveralls/php-coveralls": "^2.2", + "phpmyadmin/sql-parser": "5.1.0", + "phpspec/prophecy": ">=1.9.0", + "phpunit/phpunit": "^7.5.16 || ^8.5 || ^9.0", + "psalm/plugin-phpunit": "^0.10", + "slevomat/coding-standard": "^5.0", + "squizlabs/php_codesniffer": "^3.5", + "symfony/process": "^4.3" + }, + "suggest": { + "ext-igbinary": "^2.0.5" + }, + "bin": [ + "psalm", + "psalm-language-server", + "psalm-plugin", + "psalm-refactor", + "psalter" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev", + "dev-2.x": "2.x-dev", + "dev-1.x": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psalm\\Plugin\\": "src/Psalm/Plugin", + "Psalm\\": "src/Psalm" + }, + "files": [ + "src/functions.php", + "src/spl_object_id.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Matthew Brown" + } + ], + "description": "A static analysis tool for finding errors in PHP applications", + "keywords": [ + "code", + "inspection", + "php" + ], + "time": "2020-04-13T12:47:11+00:00" + }, { "name": "webmozart/assert", "version": "1.5.0", @@ -2779,6 +3422,99 @@ "validate" ], "time": "2019-08-24T08:43:50+00:00" + }, + { + "name": "webmozart/glob", + "version": "4.1.0", + "source": { + "type": "git", + "url": "https://github.com/webmozart/glob.git", + "reference": "3cbf63d4973cf9d780b93d2da8eec7e4a9e63bbe" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozart/glob/zipball/3cbf63d4973cf9d780b93d2da8eec7e4a9e63bbe", + "reference": "3cbf63d4973cf9d780b93d2da8eec7e4a9e63bbe", + "shasum": "" + }, + "require": { + "php": "^5.3.3|^7.0", + "webmozart/path-util": "^2.2" + }, + "require-dev": { + "phpunit/phpunit": "^4.6", + "sebastian/version": "^1.0.1", + "symfony/filesystem": "^2.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.1-dev" + } + }, + "autoload": { + "psr-4": { + "Webmozart\\Glob\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "A PHP implementation of Ant's glob.", + "time": "2015-12-29T11:14:33+00:00" + }, + { + "name": "webmozart/path-util", + "version": "2.3.0", + "source": { + "type": "git", + "url": "https://github.com/webmozart/path-util.git", + "reference": "d939f7edc24c9a1bb9c0dee5cb05d8e859490725" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozart/path-util/zipball/d939f7edc24c9a1bb9c0dee5cb05d8e859490725", + "reference": "d939f7edc24c9a1bb9c0dee5cb05d8e859490725", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "webmozart/assert": "~1.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.6", + "sebastian/version": "^1.0.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3-dev" + } + }, + "autoload": { + "psr-4": { + "Webmozart\\PathUtil\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "A robust cross-platform utility for normalizing, comparing and modifying file paths.", + "time": "2015-12-17T08:42:14+00:00" } ], "aliases": [], @@ -2791,5 +3527,8 @@ "ext-pdo": "*" }, "platform-dev": [], + "platform-overrides": { + "php": "7.1.3" + }, "plugin-api-version": "1.1.0" } diff --git a/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php b/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php index ea1f2efee3..caa91f55b6 100644 --- a/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php +++ b/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php @@ -92,7 +92,6 @@ class BasicEntityPersister implements EntityPersister */ static private $comparisonMap = [ Comparison::EQ => '= %s', - Comparison::IS => '= %s', Comparison::NEQ => '!= %s', Comparison::GT => '> %s', Comparison::GTE => '>= %s', diff --git a/lib/Doctrine/ORM/Query/Parser.php b/lib/Doctrine/ORM/Query/Parser.php index 193e85ac20..d017079260 100644 --- a/lib/Doctrine/ORM/Query/Parser.php +++ b/lib/Doctrine/ORM/Query/Parser.php @@ -171,7 +171,7 @@ class Parser /** * The custom last tree walker, if any, that is responsible for producing the output. * - * @var TreeWalker + * @var class-string */ private $customOutputWalker; diff --git a/lib/Doctrine/ORM/Query/TreeWalkerChainIterator.php b/lib/Doctrine/ORM/Query/TreeWalkerChainIterator.php index e72e1d4dc4..a65e0ae0ed 100644 --- a/lib/Doctrine/ORM/Query/TreeWalkerChainIterator.php +++ b/lib/Doctrine/ORM/Query/TreeWalkerChainIterator.php @@ -25,7 +25,7 @@ class TreeWalkerChainIterator implements \Iterator, \ArrayAccess { /** - * @var TreeWalker[] + * @var class-string[] */ private $walkers = []; /** diff --git a/lib/Doctrine/ORM/Tools/EntityGenerator.php b/lib/Doctrine/ORM/Tools/EntityGenerator.php index a6b0792f5c..be8d87803b 100644 --- a/lib/Doctrine/ORM/Tools/EntityGenerator.php +++ b/lib/Doctrine/ORM/Tools/EntityGenerator.php @@ -1166,7 +1166,7 @@ protected function generateDiscriminatorMapAnnotation(ClassMetadataInfo $metadat $inheritanceClassMap = []; foreach ($metadata->discriminatorMap as $type => $class) { - $inheritanceClassMap[] .= '"' . $type . '" = "' . $class . '"'; + $inheritanceClassMap[] = '"' . $type . '" = "' . $class . '"'; } return '@' . $this->annotationsPrefix . 'DiscriminatorMap({' . implode(', ', $inheritanceClassMap) . '})'; @@ -1468,7 +1468,7 @@ protected function generateJoinColumnAnnotation(array $joinColumn) } if (isset($joinColumn['unique']) && $joinColumn['unique']) { - $joinColumnAnnot[] = 'unique=' . ($joinColumn['unique'] ? 'true' : 'false'); + $joinColumnAnnot[] = 'unique=true'; } if (isset($joinColumn['nullable'])) { @@ -1560,7 +1560,7 @@ protected function generateAssociationMappingPropertyDocBlock(array $association } if (isset($associationMapping['orphanRemoval']) && $associationMapping['orphanRemoval']) { - $typeOptions[] = 'orphanRemoval=' . ($associationMapping['orphanRemoval'] ? 'true' : 'false'); + $typeOptions[] = 'orphanRemoval=true'; } if (isset($associationMapping['fetch']) && $associationMapping['fetch'] !== ClassMetadataInfo::FETCH_LAZY) { diff --git a/lib/Doctrine/ORM/Tools/Export/Driver/XmlExporter.php b/lib/Doctrine/ORM/Tools/Export/Driver/XmlExporter.php index 6503649379..ec0f7ef9fd 100644 --- a/lib/Doctrine/ORM/Tools/Export/Driver/XmlExporter.php +++ b/lib/Doctrine/ORM/Tools/Export/Driver/XmlExporter.php @@ -203,7 +203,7 @@ public function exportClassMetadata(ClassMetadataInfo $metadata) } if (isset($field['unique']) && $field['unique']) { - $fieldXml->addAttribute('unique', $field['unique'] ? 'true' : 'false'); + $fieldXml->addAttribute('unique', 'true'); } if (isset($field['options'])) { diff --git a/phpstan.neon b/phpstan.neon index 4046aa1655..b11b708340 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -1,4 +1,7 @@ parameters: + level: 1 + paths: + - %currentWorkingDirectory%/lib earlyTerminatingMethodCalls: Doctrine\ORM\Query\Parser: - syntaxError diff --git a/psalm.xml b/psalm.xml new file mode 100644 index 0000000000..f36f7d1117 --- /dev/null +++ b/psalm.xml @@ -0,0 +1,15 @@ + + + + + + + + + From 4d172e259134000560cf9e377598eef19f17ccb3 Mon Sep 17 00:00:00 2001 From: Benjamin Eberlei Date: Tue, 12 May 2020 20:10:26 +0200 Subject: [PATCH 082/136] Revert changes to embeddable mapping in 2.7 (#8138) * Revert "Fix inherited embeddables and nesting after AnnotationDriver change #8006 (#8036)" This reverts commit a9b6b720175fae69e90247e6b7a0e34d7da2f1cc. * Revert "Make Embeddable not transient" This reverts commit 58677c29b4bc97273da950f6312e43ff540a7407. * Housekeeping: CS fixes --- docs/en/tutorials/embeddables.rst | 4 +- .../ORM/Mapping/ClassMetadataFactory.php | 10 +- .../ORM/Mapping/Driver/AnnotationDriver.php | 3 - .../ORM/Functional/Ticket/GH8031Test.php | 163 ------------------ .../Tests/ORM/Functional/ValueObjectsTest.php | 5 - 5 files changed, 7 insertions(+), 178 deletions(-) delete mode 100644 tests/Doctrine/Tests/ORM/Functional/Ticket/GH8031Test.php diff --git a/docs/en/tutorials/embeddables.rst b/docs/en/tutorials/embeddables.rst index c49bdfc65a..483e58d9da 100644 --- a/docs/en/tutorials/embeddables.rst +++ b/docs/en/tutorials/embeddables.rst @@ -8,9 +8,7 @@ or address are the primary use case for this feature. .. note:: - Embeddables can not contain references to entities. They can however compose - other embeddables in addition to holding properties with basic ``@Column`` - mapping. + Embeddables can only contain properties with basic ``@Column`` mapping. For the purposes of this tutorial, we will assume that you have a ``User`` class in your application and you would like to store an address in diff --git a/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php b/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php index e75ae1f823..d36ea30846 100644 --- a/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php +++ b/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php @@ -404,7 +404,7 @@ private function getShortName($className) private function addInheritedFields(ClassMetadata $subClass, ClassMetadata $parentClass) { foreach ($parentClass->fieldMappings as $mapping) { - if (! isset($mapping['inherited']) && ! $parentClass->isMappedSuperclass && ! $parentClass->isEmbeddedClass) { + if (! isset($mapping['inherited']) && ! $parentClass->isMappedSuperclass) { $mapping['inherited'] = $parentClass->name; } if (! isset($mapping['declared'])) { @@ -472,6 +472,10 @@ private function addInheritedEmbeddedClasses(ClassMetadata $subClass, ClassMetad private function addNestedEmbeddedClasses(ClassMetadata $subClass, ClassMetadata $parentClass, $prefix) { foreach ($subClass->embeddedClasses as $property => $embeddableClass) { + if (isset($embeddableClass['inherited'])) { + continue; + } + $embeddableMetadata = $this->getMetadataFor($embeddableClass['class']); $parentClass->mapEmbedded( @@ -779,9 +783,7 @@ protected function getDriver() */ protected function isEntity(ClassMetadataInterface $class) { - assert($class instanceof ClassMetadata); - - return $class->isMappedSuperclass === false && $class->isEmbeddedClass === false; + return isset($class->isMappedSuperclass) && $class->isMappedSuperclass === false; } /** diff --git a/lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php b/lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php index afa7ad614d..6e93c6e03f 100644 --- a/lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php +++ b/lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php @@ -45,7 +45,6 @@ class AnnotationDriver extends AbstractAnnotationDriver protected $entityAnnotationClasses = [ Mapping\Entity::class => 1, Mapping\MappedSuperclass::class => 2, - Mapping\Embeddable::class => 3, ]; /** @@ -278,8 +277,6 @@ public function loadMetadataForClass($className, ClassMetadata $metadata) /* @var $property \ReflectionProperty */ foreach ($class->getProperties() as $property) { if ($metadata->isMappedSuperclass && ! $property->isPrivate() - || - $metadata->isEmbeddedClass && $property->getDeclaringClass()->getName() !== $class->getName() || $metadata->isInheritedField($property->name) || diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/GH8031Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/GH8031Test.php deleted file mode 100644 index 7ae17d3f2f..0000000000 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/GH8031Test.php +++ /dev/null @@ -1,163 +0,0 @@ -setUpEntitySchema([ - GH8031Invoice::class, - ]); - } - - public function testEntityIsFetched() - { - $entity = new GH8031Invoice(new GH8031InvoiceCode(1, 2020, new GH8031Nested(10))); - $this->_em->persist($entity); - $this->_em->flush(); - $this->_em->clear(); - - /** @var GH8031Invoice $fetched */ - $fetched = $this->_em->find(GH8031Invoice::class, $entity->getId()); - $this->assertInstanceOf(GH8031Invoice::class, $fetched); - $this->assertSame(1, $fetched->getCode()->getNumber()); - $this->assertSame(2020, $fetched->getCode()->getYear()); - - $this->_em->clear(); - $this->assertCount( - 1, - $this->_em->getRepository(GH8031Invoice::class)->findBy([], ['code.number' => 'ASC']) - ); - } - - public function testEmbeddableWithAssociationNotAllowed() - { - $cm = $this->_em->getClassMetadata(GH8031EmbeddableWithAssociation::class); - - $this->assertArrayHasKey('invoice', $cm->associationMappings); - - $cm = $this->_em->getClassMetadata(GH8031Invoice::class); - - $this->assertCount(0, $cm->associationMappings); - } -} - -/** - * @Embeddable - */ -class GH8031EmbeddableWithAssociation -{ - /** @ManyToOne(targetEntity=GH8031Invoice::class) */ - public $invoice; -} - -/** - * @Embeddable - */ -class GH8031Nested -{ - /** - * @Column(type="integer", name="number", length=6) - * @var int - */ - protected $number; - - public function __construct(int $number) - { - $this->number = $number; - } - - public function getNumber() : int - { - return $this->number; - } -} - -/** - * @Embeddable - */ -class GH8031InvoiceCode extends GH8031AbstractYearSequenceValue -{ -} - -/** - * @Embeddable - */ -abstract class GH8031AbstractYearSequenceValue -{ - /** - * @Column(type="integer", name="number", length=6) - * @var int - */ - protected $number; - - /** - * @Column(type="smallint", name="year", length=4) - * @var int - */ - protected $year; - - /** @Embedded(class=GH8031Nested::class) */ - protected $nested; - - public function __construct(int $number, int $year, GH8031Nested $nested) - { - $this->number = $number; - $this->year = $year; - $this->nested = $nested; - } - - public function getNumber() : int - { - return $this->number; - } - - public function getYear() : int - { - return $this->year; - } -} - -/** - * @Entity - */ -class GH8031Invoice -{ - /** - * @Id - * @GeneratedValue - * @Column(type="integer") - */ - private $id; - - /** - * @Embedded(class=GH8031InvoiceCode::class) - * @var GH8031InvoiceCode - */ - private $code; - - /** @Embedded(class=GH8031EmbeddableWithAssociation::class) */ - private $embeddedAssoc; - - public function __construct(GH8031InvoiceCode $code) - { - $this->code = $code; - } - - public function getId() - { - return $this->id; - } - - public function getCode() : GH8031InvoiceCode - { - return $this->code; - } -} diff --git a/tests/Doctrine/Tests/ORM/Functional/ValueObjectsTest.php b/tests/Doctrine/Tests/ORM/Functional/ValueObjectsTest.php index f78b313e78..7a483ebc78 100644 --- a/tests/Doctrine/Tests/ORM/Functional/ValueObjectsTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/ValueObjectsTest.php @@ -328,11 +328,6 @@ public function getInfiniteEmbeddableNestingData() ['DDCNestingEmbeddable1', 'DDCNestingEmbeddable4'], ]; } - - public function testEmbeddableIsNotTransient() - { - $this->assertFalse($this->_em->getMetadataFactory()->isTransient(DDC93Address::class)); - } } From 6780a963f78dc4ebfaface5590798f40863cb5e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Paris?= Date: Sat, 16 May 2020 14:01:10 +0200 Subject: [PATCH 083/136] Migrate git-phpcs to Github actions (#8146) --- .github/workflows/ci.yml | 39 +++++++++++++++++++++++++++++++++++++++ .travis.yml | 15 --------------- 2 files changed, 39 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9ff8c27b2c..4641a0319a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -68,3 +68,42 @@ jobs: - name: "Run a static analysis with vimeo/psalm" run: "vendor/bin/psalm --show-info=false --stats --output-format=github --threads=$(nproc)" + + coding-standards: + name: "Coding Standards" + runs-on: "ubuntu-latest" + + strategy: + matrix: + php-version: + - "7.4" + + steps: + - name: "Checkout" + uses: "actions/checkout@v2" + + - name: "Install PHP" + uses: "shivammathur/setup-php@v2" + with: + coverage: "none" + php-version: "${{ matrix.php-version }}" + tools: "cs2pr" + + - name: "Cache dependencies installed with composer" + uses: "actions/cache@v1" + with: + path: "~/.composer/cache" + key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}" + restore-keys: "php-${{ matrix.php-version }}-composer-locked-" + + - name: "Install dependencies with composer" + run: "composer install --no-interaction --no-progress --no-suggest" + + - name: "Install git-phpcs" + run: "wget https://github.com/diff-sniffer/git/releases/download/0.3.2/git-phpcs.phar" + + - name: "Fetch head branch" + run: "git remote set-branches --add origin $GITHUB_BASE_REF && git fetch origin $GITHUB_BASE_REF" + + - name: "Run git-phpcs" + run: "php git-phpcs.phar origin/$GITHUB_BASE_REF...$GITHUB_SHA --report=checkstyle|cs2pr" diff --git a/.travis.yml b/.travis.yml index c32ef79d21..7c0b00b6e5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -97,21 +97,6 @@ jobs: script: - ./vendor/bin/phpcs - - stage: Code Quality - if: type = pull_request - env: DB=none PULL_REQUEST_CODING_STANDARDS - php: 7.1 - install: travis_retry composer install --prefer-dist - script: - - | - if [ $TRAVIS_BRANCH != "master" ]; then - git remote set-branches --add origin $TRAVIS_BRANCH; - git fetch origin $TRAVIS_BRANCH; - fi - - git merge-base origin/$TRAVIS_BRANCH $TRAVIS_PULL_REQUEST_SHA || git fetch origin +refs/pull/$TRAVIS_PULL_REQUEST/merge --unshallow - - wget https://github.com/diff-sniffer/git/releases/download/0.2.0/git-phpcs.phar - - php git-phpcs.phar origin/$TRAVIS_BRANCH...$TRAVIS_PULL_REQUEST_SHA - allow_failures: - stage: Code Quality env: DB=none CODING_STANDARDS From de2e2a1d74b81f468443777b2ee1dab7a5076667 Mon Sep 17 00:00:00 2001 From: orklah Date: Mon, 18 May 2020 21:48:28 +0200 Subject: [PATCH 084/136] Add psalm types (#7989) --- lib/Doctrine/ORM/Configuration.php | 20 ++++++++++++++++++- .../ORM/Mapping/ClassMetadataInfo.php | 7 ++++++- .../Mapping/DefaultEntityListenerResolver.php | 2 ++ .../ORM/Mapping/EntityListenerResolver.php | 4 ++++ lib/Doctrine/ORM/Query/FilterCollection.php | 3 +++ lib/Doctrine/ORM/Query/Parser.php | 6 ++++++ lib/Doctrine/ORM/Query/SqlWalker.php | 8 ++++++-- .../ORM/Tools/Console/MetadataFilter.php | 8 +++++--- lib/Doctrine/ORM/Tools/EntityGenerator.php | 2 +- lib/Doctrine/ORM/UnitOfWork.php | 2 +- 10 files changed, 53 insertions(+), 9 deletions(-) diff --git a/lib/Doctrine/ORM/Configuration.php b/lib/Doctrine/ORM/Configuration.php index a7676f3522..0236b19625 100644 --- a/lib/Doctrine/ORM/Configuration.php +++ b/lib/Doctrine/ORM/Configuration.php @@ -442,6 +442,7 @@ public function addCustomStringFunction($name, $className) * @param string $name * * @return string|null + * @psalm-return ?class-string */ public function getCustomStringFunction($name) { @@ -494,6 +495,7 @@ public function addCustomNumericFunction($name, $className) * @param string $name * * @return string|null + * @psalm-return ?class-string */ public function getCustomNumericFunction($name) { @@ -534,6 +536,8 @@ public function setCustomNumericFunctions(array $functions) * @param string|callable $className Class name or a callable that returns the function. * * @return void + * + * @psalm-param class-string|callable $className */ public function addCustomDatetimeFunction($name, $className) { @@ -546,6 +550,8 @@ public function addCustomDatetimeFunction($name, $className) * @param string $name * * @return string|null + * + * @psalm-return ?class-string $name */ public function getCustomDatetimeFunction($name) { @@ -567,6 +573,8 @@ public function getCustomDatetimeFunction($name) * @param array $functions The map of custom DQL date/time functions. * * @return void + * + * @psalm-param array $functions */ public function setCustomDatetimeFunctions(array $functions) { @@ -597,6 +605,8 @@ public function setCustomHydrationModes($modes) * @param string $modeName The hydration mode name. * * @return string|null The hydrator class name. + * + * @psalm-return ?class-string */ public function getCustomHydrationMode($modeName) { @@ -624,6 +634,8 @@ public function addCustomHydrationMode($modeName, $hydrator) * @param string $cmfName * * @return void + * + * @psalm-param class-string $cmfName */ public function setClassMetadataFactoryName($cmfName) { @@ -632,6 +644,8 @@ public function setClassMetadataFactoryName($cmfName) /** * @return string + * + * @psalm-return class-string */ public function getClassMetadataFactoryName() { @@ -658,8 +672,10 @@ public function addFilter($name, $className) * * @param string $name The name of the filter. * - * @return string The class name of the filter, or null if it is not + * @return string|null The class name of the filter, or null if it is not * defined. + * + * @psalm-return ?class-string */ public function getFilterClassName($name) { @@ -696,6 +712,8 @@ public function setDefaultRepositoryClassName($className) * @since 2.2 * * @return string + * + * @psalm-return class-string */ public function getDefaultRepositoryClassName() { diff --git a/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php b/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php index 94987d5fb8..b78e2d980c 100644 --- a/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php +++ b/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php @@ -252,7 +252,8 @@ class ClassMetadataInfo implements ClassMetadata * The name of the custom repository class used for the entity class. * (Optional). * - * @var string + * @var string|null + * @psalm-var ?class-string */ public $customRepositoryClassName; @@ -2626,6 +2627,8 @@ protected function _storeAssociationMapping(array $assocMapping) * @param string $repositoryClassName The class name of the custom mapper. * * @return void + * + * @psalm-param class-string $repositoryClassName */ public function setCustomRepositoryClass($repositoryClassName) { @@ -3254,6 +3257,8 @@ public function getAssociationsByTargetClass($targetClass) * @param string|null $className * * @return string|null null if the input value is null + * + * @psalm-param ?class-string $className */ public function fullyQualifiedClassName($className) { diff --git a/lib/Doctrine/ORM/Mapping/DefaultEntityListenerResolver.php b/lib/Doctrine/ORM/Mapping/DefaultEntityListenerResolver.php index a8ee2dc783..ee3e37a32a 100644 --- a/lib/Doctrine/ORM/Mapping/DefaultEntityListenerResolver.php +++ b/lib/Doctrine/ORM/Mapping/DefaultEntityListenerResolver.php @@ -30,6 +30,8 @@ class DefaultEntityListenerResolver implements EntityListenerResolver { /** * @var array Map to store entity listener instances. + * + * @psalm-var array */ private $instances = []; diff --git a/lib/Doctrine/ORM/Mapping/EntityListenerResolver.php b/lib/Doctrine/ORM/Mapping/EntityListenerResolver.php index b0c62c8c3a..d3a41af994 100644 --- a/lib/Doctrine/ORM/Mapping/EntityListenerResolver.php +++ b/lib/Doctrine/ORM/Mapping/EntityListenerResolver.php @@ -34,6 +34,8 @@ interface EntityListenerResolver * @param string $className The fully-qualified class name * * @return void + * + * @psalm-param class-string $className */ function clear($className = null); @@ -43,6 +45,8 @@ function clear($className = null); * @param string $className The fully-qualified class name * * @return object An entity listener + * + * @psalm-param class-string $className */ function resolve($className); diff --git a/lib/Doctrine/ORM/Query/FilterCollection.php b/lib/Doctrine/ORM/Query/FilterCollection.php index ca7f1ac328..c5f627e839 100644 --- a/lib/Doctrine/ORM/Query/FilterCollection.php +++ b/lib/Doctrine/ORM/Query/FilterCollection.php @@ -20,6 +20,7 @@ namespace Doctrine\ORM\Query; use Doctrine\ORM\EntityManagerInterface; +use function assert; /** * Collection class for all the query filters. @@ -110,6 +111,8 @@ public function enable($name) if ( ! $this->isEnabled($name)) { $filterClass = $this->config->getFilterClassName($name); + assert($filterClass !== null); + $this->enabledFilters[$name] = new $filterClass($this->em); // Keep the enabled filters sorted for the hash diff --git a/lib/Doctrine/ORM/Query/Parser.php b/lib/Doctrine/ORM/Query/Parser.php index d017079260..c3de92a124 100644 --- a/lib/Doctrine/ORM/Query/Parser.php +++ b/lib/Doctrine/ORM/Query/Parser.php @@ -42,6 +42,8 @@ class Parser * READ-ONLY: Maps BUILT-IN string function names to AST class names. * * @var array + * + * @psalm-var class-string */ private static $_STRING_FUNCTIONS = [ 'concat' => Functions\ConcatFunction::class, @@ -56,6 +58,8 @@ class Parser * READ-ONLY: Maps BUILT-IN numeric function names to AST class names. * * @var array + * + * @psalm-var class-string */ private static $_NUMERIC_FUNCTIONS = [ 'length' => Functions\LengthFunction::class, @@ -80,6 +84,8 @@ class Parser * READ-ONLY: Maps BUILT-IN datetime function names to AST class names. * * @var array + * + * @psalm-var class-string */ private static $_DATETIME_FUNCTIONS = [ 'current_date' => Functions\CurrentDateFunction::class, diff --git a/lib/Doctrine/ORM/Query/SqlWalker.php b/lib/Doctrine/ORM/Query/SqlWalker.php index 0749fb715d..b25df75910 100644 --- a/lib/Doctrine/ORM/Query/SqlWalker.php +++ b/lib/Doctrine/ORM/Query/SqlWalker.php @@ -142,6 +142,8 @@ class SqlWalker implements TreeWalker * Map of all components/classes that appear in the DQL query. * * @var array + * + * @psalm-var array */ private $queryComponents; @@ -199,7 +201,7 @@ public function __construct($query, $parserResult, array $queryComponents) /** * Gets the Query instance used by the walker. * - * @return Query. + * @return Query */ public function getQuery() { @@ -232,6 +234,8 @@ public function getEntityManager() * @param string $dqlAlias The DQL alias. * * @return array + * + * @psalm-return array{metadata: ClassMetadata} */ public function getQueryComponent($dqlAlias) { @@ -1522,7 +1526,7 @@ public function walkSimpleSelectClause($simpleSelectClause) /** * @param \Doctrine\ORM\Query\AST\ParenthesisExpression $parenthesisExpression * - * @return string. + * @return string */ public function walkParenthesisExpression(AST\ParenthesisExpression $parenthesisExpression) { diff --git a/lib/Doctrine/ORM/Tools/Console/MetadataFilter.php b/lib/Doctrine/ORM/Tools/Console/MetadataFilter.php index 88357e35c9..f0c5669a31 100644 --- a/lib/Doctrine/ORM/Tools/Console/MetadataFilter.php +++ b/lib/Doctrine/ORM/Tools/Console/MetadataFilter.php @@ -19,6 +19,8 @@ namespace Doctrine\ORM\Tools\Console; +use Doctrine\Common\Persistence\Mapping\ClassMetadata; + /** * Used by CLI Tools to restrict entity-based commands to given patterns. * @@ -40,10 +42,10 @@ class MetadataFilter extends \FilterIterator implements \Countable /** * Filter Metadatas by one or more filter options. * - * @param array $metadatas - * @param array|string $filter + * @param ClassMetadata[] $metadatas + * @param string[]|string $filter * - * @return array + * @return ClassMetadata[] */ static public function filter(array $metadatas, $filter) { diff --git a/lib/Doctrine/ORM/Tools/EntityGenerator.php b/lib/Doctrine/ORM/Tools/EntityGenerator.php index be8d87803b..fcc9d6fc25 100644 --- a/lib/Doctrine/ORM/Tools/EntityGenerator.php +++ b/lib/Doctrine/ORM/Tools/EntityGenerator.php @@ -149,7 +149,7 @@ class EntityGenerator /** * Whether or not to make generated embeddables immutable. * - * @var boolean. + * @var bool */ protected $embeddablesImmutable = false; diff --git a/lib/Doctrine/ORM/UnitOfWork.php b/lib/Doctrine/ORM/UnitOfWork.php index 77b42cca28..3383a44b0c 100644 --- a/lib/Doctrine/ORM/UnitOfWork.php +++ b/lib/Doctrine/ORM/UnitOfWork.php @@ -1893,7 +1893,7 @@ public function merge($entity) * @param object $entity * @param array $visited * @param object|null $prevManagedCopy - * @param array|null $assoc + * @param string[] $assoc * * @return object The managed copy of the entity. * From 825ceb6b7ad807a6ac37af0668e40025471d668e Mon Sep 17 00:00:00 2001 From: Robert Basic Date: Fri, 22 May 2020 22:45:24 +0200 Subject: [PATCH 085/136] Fix inline code example (#8153) * Fix inline code example * Remove extra backslash --- docs/en/reference/working-with-objects.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/reference/working-with-objects.rst b/docs/en/reference/working-with-objects.rst index cb6336e747..2218befe4d 100644 --- a/docs/en/reference/working-with-objects.rst +++ b/docs/en/reference/working-with-objects.rst @@ -315,7 +315,7 @@ in multiple ways with very different performance impacts. 1. If an association is marked as ``CASCADE=REMOVE`` Doctrine 2 will fetch this association. If its a Single association it will pass this entity to - ´EntityManager#remove()``. If the association is a collection, Doctrine will loop over all its elements and pass them to``EntityManager#remove()\`. + ``EntityManager#remove()``. If the association is a collection, Doctrine will loop over all its elements and pass them to``EntityManager#remove()``. In both cases the cascade remove semantics are applied recursively. For large object graphs this removal strategy can be very costly. 2. Using a DQL ``DELETE`` statement allows you to delete multiple From d95e03ba660d50d785a9925f41927fef0ee553cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Paris?= Date: Tue, 26 May 2020 18:03:49 +0200 Subject: [PATCH 086/136] Allow doctrine/common 3 and doctrine/persistence 2 (#8158) --- composer.json | 6 +- composer.lock | 582 ++++++++++-------- .../ORM/Tools/Console/MetadataFilter.php | 2 +- lib/Doctrine/ORM/Tools/EntityGenerator.php | 4 +- tests/Doctrine/Tests/OrmTestCase.php | 38 +- tools/sandbox/doctrine.php | 4 +- 6 files changed, 348 insertions(+), 288 deletions(-) diff --git a/composer.json b/composer.json index 3d02838f10..787210c8a6 100644 --- a/composer.json +++ b/composer.json @@ -24,11 +24,13 @@ "doctrine/annotations": "^1.8", "doctrine/cache": "^1.9.1", "doctrine/collections": "^1.5", - "doctrine/common": "^2.11", + "doctrine/common": "^2.11 || ^3.0", "doctrine/dbal": "^2.9.3", "doctrine/event-manager": "^1.1", + "doctrine/inflector": "^1.0", "doctrine/instantiator": "^1.3", - "doctrine/persistence": "^1.3.3", + "doctrine/lexer": "^1.0", + "doctrine/persistence": "^1.3.3 || ^2.0", "ocramius/package-versions": "^1.2", "symfony/console": "^3.0|^4.0|^5.0" }, diff --git a/composer.lock b/composer.lock index d602f167e6..267db0ba83 100644 --- a/composer.lock +++ b/composer.lock @@ -1,28 +1,29 @@ { "_readme": [ "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "41b259f8d2ab145c98151104fc3e1aa8", + "content-hash": "2b7c09043b3b7d625abd8ee130abb16b", "packages": [ { "name": "doctrine/annotations", - "version": "v1.8.0", + "version": "1.10.3", "source": { "type": "git", "url": "https://github.com/doctrine/annotations.git", - "reference": "904dca4eb10715b92569fbcd79e201d5c349b6bc" + "reference": "5db60a4969eba0e0c197a19c077780aadbc43c5d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/annotations/zipball/904dca4eb10715b92569fbcd79e201d5c349b6bc", - "reference": "904dca4eb10715b92569fbcd79e201d5c349b6bc", + "url": "https://api.github.com/repos/doctrine/annotations/zipball/5db60a4969eba0e0c197a19c077780aadbc43c5d", + "reference": "5db60a4969eba0e0c197a19c077780aadbc43c5d", "shasum": "" }, "require": { "doctrine/lexer": "1.*", - "php": "^7.1" + "ext-tokenizer": "*", + "php": "^7.1 || ^8.0" }, "require-dev": { "doctrine/cache": "1.*", @@ -31,7 +32,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.7.x-dev" + "dev-master": "1.9.x-dev" } }, "autoload": { @@ -72,20 +73,20 @@ "docblock", "parser" ], - "time": "2019-10-01T18:55:10+00:00" + "time": "2020-05-25T17:24:27+00:00" }, { "name": "doctrine/cache", - "version": "1.9.1", + "version": "1.10.0", "source": { "type": "git", "url": "https://github.com/doctrine/cache.git", - "reference": "89a5c76c39c292f7798f964ab3c836c3f8192a55" + "reference": "382e7f4db9a12dc6c19431743a2b096041bcdd62" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/cache/zipball/89a5c76c39c292f7798f964ab3c836c3f8192a55", - "reference": "89a5c76c39c292f7798f964ab3c836c3f8192a55", + "url": "https://api.github.com/repos/doctrine/cache/zipball/382e7f4db9a12dc6c19431743a2b096041bcdd62", + "reference": "382e7f4db9a12dc6c19431743a2b096041bcdd62", "shasum": "" }, "require": { @@ -152,41 +153,37 @@ "memcached", "php", "redis", - "riak", "xcache" ], - "time": "2019-11-15T14:31:57+00:00" + "time": "2019-11-29T15:36:20+00:00" }, { "name": "doctrine/collections", - "version": "v1.5.0", + "version": "1.6.5", "source": { "type": "git", "url": "https://github.com/doctrine/collections.git", - "reference": "a01ee38fcd999f34d9bfbcee59dbda5105449cbf" + "reference": "fc0206348e17e530d09463fef07ba8968406cd6d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/collections/zipball/a01ee38fcd999f34d9bfbcee59dbda5105449cbf", - "reference": "a01ee38fcd999f34d9bfbcee59dbda5105449cbf", + "url": "https://api.github.com/repos/doctrine/collections/zipball/fc0206348e17e530d09463fef07ba8968406cd6d", + "reference": "fc0206348e17e530d09463fef07ba8968406cd6d", "shasum": "" }, "require": { - "php": "^7.1" + "php": "^7.1.3 || ^8.0" }, "require-dev": { - "doctrine/coding-standard": "~0.1@dev", - "phpunit/phpunit": "^5.7" + "doctrine/coding-standard": "^6.0", + "phpstan/phpstan-shim": "^0.9.2", + "phpunit/phpunit": "^7.0", + "vimeo/psalm": "^3.8.1" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.3.x-dev" - } - }, "autoload": { - "psr-0": { - "Doctrine\\Common\\Collections\\": "lib/" + "psr-4": { + "Doctrine\\Common\\Collections\\": "lib/Doctrine/Common/Collections" } }, "notification-url": "https://packagist.org/downloads/", @@ -194,6 +191,10 @@ "MIT" ], "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, { "name": "Roman Borschel", "email": "roman@code-factory.org" @@ -202,10 +203,6 @@ "name": "Benjamin Eberlei", "email": "kontakt@beberlei.de" }, - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, { "name": "Jonathan Wage", "email": "jonwage@gmail.com" @@ -215,39 +212,33 @@ "email": "schmittjoh@gmail.com" } ], - "description": "Collections Abstraction library", - "homepage": "http://www.doctrine-project.org", + "description": "PHP Doctrine Collections library that adds additional functionality on top of PHP arrays.", + "homepage": "https://www.doctrine-project.org/projects/collections.html", "keywords": [ "array", "collections", - "iterator" + "iterators", + "php" ], - "time": "2017-07-22T10:37:32+00:00" + "time": "2020-05-25T19:24:35+00:00" }, { "name": "doctrine/common", - "version": "v2.11.0", + "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/doctrine/common.git", - "reference": "b8ca1dcf6b0dc8a2af7a09baac8d0c48345df4ff" + "reference": "05ab20457d332cc0eef880b17cdbbffcd6af526f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/common/zipball/b8ca1dcf6b0dc8a2af7a09baac8d0c48345df4ff", - "reference": "b8ca1dcf6b0dc8a2af7a09baac8d0c48345df4ff", + "url": "https://api.github.com/repos/doctrine/common/zipball/05ab20457d332cc0eef880b17cdbbffcd6af526f", + "reference": "05ab20457d332cc0eef880b17cdbbffcd6af526f", "shasum": "" }, "require": { - "doctrine/annotations": "^1.0", - "doctrine/cache": "^1.0", - "doctrine/collections": "^1.0", - "doctrine/event-manager": "^1.0", - "doctrine/inflector": "^1.0", - "doctrine/lexer": "^1.0", - "doctrine/persistence": "^1.1", - "doctrine/reflection": "^1.0", - "php": "^7.1" + "doctrine/persistence": "^2.0", + "php": "^7.1 || ^8.0" }, "require-dev": { "doctrine/coding-standard": "^1.0", @@ -260,7 +251,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.11.x-dev" + "dev-master": "3.0.x-dev" } }, "autoload": { @@ -305,7 +296,7 @@ "doctrine", "php" ], - "time": "2019-09-10T10:10:14+00:00" + "time": "2020-05-25T20:38:25+00:00" }, { "name": "doctrine/dbal", @@ -650,16 +641,16 @@ }, { "name": "doctrine/persistence", - "version": "1.3.5", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/doctrine/persistence.git", - "reference": "be70c016fdcd44a428405ee062ebcdd01a6867cd" + "reference": "1dee036f22cd5dc0bc12132f1d1c38415907be55" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/persistence/zipball/be70c016fdcd44a428405ee062ebcdd01a6867cd", - "reference": "be70c016fdcd44a428405ee062ebcdd01a6867cd", + "url": "https://api.github.com/repos/doctrine/persistence/zipball/1dee036f22cd5dc0bc12132f1d1c38415907be55", + "reference": "1dee036f22cd5dc0bc12132f1d1c38415907be55", "shasum": "" }, "require": { @@ -667,7 +658,7 @@ "doctrine/cache": "^1.0", "doctrine/collections": "^1.0", "doctrine/event-manager": "^1.0", - "doctrine/reflection": "^1.0", + "doctrine/reflection": "^1.2", "php": "^7.1" }, "conflict": { @@ -676,12 +667,13 @@ "require-dev": { "doctrine/coding-standard": "^6.0", "phpstan/phpstan": "^0.11", - "phpunit/phpunit": "^7.0" + "phpunit/phpunit": "^7.0", + "vimeo/psalm": "^3.11" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3.x-dev" + "dev-master": "2.x-dev" } }, "autoload": { @@ -729,20 +721,20 @@ "orm", "persistence" ], - "time": "2020-01-14T18:44:12+00:00" + "time": "2020-05-12T19:32:44+00:00" }, { "name": "doctrine/reflection", - "version": "v1.0.0", + "version": "1.2.1", "source": { "type": "git", "url": "https://github.com/doctrine/reflection.git", - "reference": "02538d3f95e88eb397a5f86274deb2c6175c2ab6" + "reference": "55e71912dfcd824b2fdd16f2d9afe15684cfce79" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/reflection/zipball/02538d3f95e88eb397a5f86274deb2c6175c2ab6", - "reference": "02538d3f95e88eb397a5f86274deb2c6175c2ab6", + "url": "https://api.github.com/repos/doctrine/reflection/zipball/55e71912dfcd824b2fdd16f2d9afe15684cfce79", + "reference": "55e71912dfcd824b2fdd16f2d9afe15684cfce79", "shasum": "" }, "require": { @@ -750,18 +742,20 @@ "ext-tokenizer": "*", "php": "^7.1" }, + "conflict": { + "doctrine/common": "<2.9" + }, "require-dev": { - "doctrine/coding-standard": "^4.0", - "doctrine/common": "^2.8", - "phpstan/phpstan": "^0.9.2", - "phpstan/phpstan-phpunit": "^0.9.4", - "phpunit/phpunit": "^7.0", - "squizlabs/php_codesniffer": "^3.0" + "doctrine/coding-standard": "^5.0", + "doctrine/common": "^2.10", + "phpstan/phpstan": "^0.11.0", + "phpstan/phpstan-phpunit": "^0.11.0", + "phpunit/phpunit": "^7.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.2.x-dev" } }, "autoload": { @@ -774,6 +768,10 @@ "MIT" ], "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, { "name": "Roman Borschel", "email": "roman@code-factory.org" @@ -782,10 +780,6 @@ "name": "Benjamin Eberlei", "email": "kontakt@beberlei.de" }, - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, { "name": "Jonathan Wage", "email": "jonwage@gmail.com" @@ -799,36 +793,38 @@ "email": "ocramius@gmail.com" } ], - "description": "Doctrine Reflection component", + "description": "The Doctrine Reflection project is a simple library used by the various Doctrine projects which adds some additional functionality on top of the reflection functionality that comes with PHP. It allows you to get the reflection information about classes, methods and properties statically.", "homepage": "https://www.doctrine-project.org/projects/reflection.html", "keywords": [ - "reflection" + "reflection", + "static" ], - "time": "2018-06-14T14:45:07+00:00" + "time": "2020-03-27T11:06:43+00:00" }, { "name": "ocramius/package-versions", - "version": "1.2.0", + "version": "1.4.2", "source": { "type": "git", "url": "https://github.com/Ocramius/PackageVersions.git", - "reference": "ad8a245decad4897cc6b432743913dad0d69753c" + "reference": "44af6f3a2e2e04f2af46bcb302ad9600cba41c7d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Ocramius/PackageVersions/zipball/ad8a245decad4897cc6b432743913dad0d69753c", - "reference": "ad8a245decad4897cc6b432743913dad0d69753c", + "url": "https://api.github.com/repos/Ocramius/PackageVersions/zipball/44af6f3a2e2e04f2af46bcb302ad9600cba41c7d", + "reference": "44af6f3a2e2e04f2af46bcb302ad9600cba41c7d", "shasum": "" }, "require": { - "composer-plugin-api": "^1.0", - "php": "~7.0" + "composer-plugin-api": "^1.0.0", + "php": "^7.1.0" }, "require-dev": { - "composer/composer": "^1.3", + "composer/composer": "^1.6.3", + "doctrine/coding-standard": "^5.0.1", "ext-zip": "*", - "humbug/humbug": "dev-master", - "phpunit/phpunit": "^6.4" + "infection/infection": "^0.7.1", + "phpunit/phpunit": "^7.5.17" }, "type": "composer-plugin", "extra": { @@ -853,20 +849,20 @@ } ], "description": "Composer plugin that provides efficient querying for installed package versions (no runtime IO)", - "time": "2017-11-24T11:07:03+00:00" + "time": "2019-11-15T16:17:10+00:00" }, { - "name": "psr/log", - "version": "1.1.2", + "name": "psr/container", + "version": "1.0.0", "source": { "type": "git", - "url": "https://github.com/php-fig/log.git", - "reference": "446d54b4cb6bf489fc9d75f55843658e6f25d801" + "url": "https://github.com/php-fig/container.git", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/446d54b4cb6bf489fc9d75f55843658e6f25d801", - "reference": "446d54b4cb6bf489fc9d75f55843658e6f25d801", + "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f", "shasum": "" }, "require": { @@ -875,12 +871,12 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1.x-dev" + "dev-master": "1.0.x-dev" } }, "autoload": { "psr-4": { - "Psr\\Log\\": "Psr/Log/" + "Psr\\Container\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -893,36 +889,41 @@ "homepage": "http://www.php-fig.org/" } ], - "description": "Common interface for logging libraries", - "homepage": "https://github.com/php-fig/log", + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", "keywords": [ - "log", - "psr", - "psr-3" + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" ], - "time": "2019-11-01T11:05:21+00:00" + "time": "2017-02-14T16:28:37+00:00" }, { "name": "symfony/console", - "version": "v3.4.35", + "version": "v4.4.8", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "17b154f932c5874cdbda6d05796b6490eec9f9f7" + "reference": "10bb3ee3c97308869d53b3e3d03f6ac23ff985f7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/17b154f932c5874cdbda6d05796b6490eec9f9f7", - "reference": "17b154f932c5874cdbda6d05796b6490eec9f9f7", + "url": "https://api.github.com/repos/symfony/console/zipball/10bb3ee3c97308869d53b3e3d03f6ac23ff985f7", + "reference": "10bb3ee3c97308869d53b3e3d03f6ac23ff985f7", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8", - "symfony/debug": "~2.8|~3.0|~4.0", - "symfony/polyfill-mbstring": "~1.0" + "php": "^7.1.3", + "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php73": "^1.8", + "symfony/service-contracts": "^1.1|^2" }, "conflict": { "symfony/dependency-injection": "<3.4", + "symfony/event-dispatcher": "<4.3|>=5", + "symfony/lock": "<4.4", "symfony/process": "<3.3" }, "provide": { @@ -930,11 +931,12 @@ }, "require-dev": { "psr/log": "~1.0", - "symfony/config": "~3.3|~4.0", - "symfony/dependency-injection": "~3.4|~4.0", - "symfony/event-dispatcher": "~2.8|~3.0|~4.0", - "symfony/lock": "~3.4|~4.0", - "symfony/process": "~3.3|~4.0" + "symfony/config": "^3.4|^4.0|^5.0", + "symfony/dependency-injection": "^3.4|^4.0|^5.0", + "symfony/event-dispatcher": "^4.3", + "symfony/lock": "^4.4|^5.0", + "symfony/process": "^3.4|^4.0|^5.0", + "symfony/var-dumper": "^4.3|^5.0" }, "suggest": { "psr/log": "For using the console logger", @@ -945,7 +947,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.4-dev" + "dev-master": "4.4-dev" } }, "autoload": { @@ -972,44 +974,40 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2019-11-13T07:12:39+00:00" + "time": "2020-03-30T11:41:10+00:00" }, { - "name": "symfony/debug", - "version": "v3.4.35", + "name": "symfony/polyfill-mbstring", + "version": "v1.17.0", "source": { "type": "git", - "url": "https://github.com/symfony/debug.git", - "reference": "f72e33fdb1170b326e72c3157f0cd456351dd086" + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "fa79b11539418b02fc5e1897267673ba2c19419c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/f72e33fdb1170b326e72c3157f0cd456351dd086", - "reference": "f72e33fdb1170b326e72c3157f0cd456351dd086", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/fa79b11539418b02fc5e1897267673ba2c19419c", + "reference": "fa79b11539418b02fc5e1897267673ba2c19419c", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8", - "psr/log": "~1.0" - }, - "conflict": { - "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2" + "php": ">=5.3.3" }, - "require-dev": { - "symfony/http-kernel": "~2.8|~3.0|~4.0" + "suggest": { + "ext-mbstring": "For best performance" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.4-dev" + "dev-master": "1.17-dev" } }, "autoload": { "psr-4": { - "Symfony\\Component\\Debug\\": "" + "Symfony\\Polyfill\\Mbstring\\": "" }, - "exclude-from-classmap": [ - "/Tests/" + "files": [ + "bootstrap.php" ] }, "notification-url": "https://packagist.org/downloads/", @@ -1018,50 +1016,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 Debug Component", + "description": "Symfony polyfill for the Mbstring extension", "homepage": "https://symfony.com", - "time": "2019-10-24T15:33:53+00:00" + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "time": "2020-05-12T16:47:27+00:00" }, { - "name": "symfony/polyfill-mbstring", - "version": "v1.12.0", + "name": "symfony/polyfill-php73", + "version": "v1.17.0", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "b42a2f66e8f1b15ccf25652c3424265923eb4f17" + "url": "https://github.com/symfony/polyfill-php73.git", + "reference": "a760d8964ff79ab9bf057613a5808284ec852ccc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/b42a2f66e8f1b15ccf25652c3424265923eb4f17", - "reference": "b42a2f66e8f1b15ccf25652c3424265923eb4f17", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/a760d8964ff79ab9bf057613a5808284ec852ccc", + "reference": "a760d8964ff79ab9bf057613a5808284ec852ccc", "shasum": "" }, "require": { "php": ">=5.3.3" }, - "suggest": { - "ext-mbstring": "For best performance" - }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.12-dev" + "dev-master": "1.17-dev" } }, "autoload": { "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" + "Symfony\\Polyfill\\Php73\\": "" }, "files": [ "bootstrap.php" + ], + "classmap": [ + "Resources/stubs" ] }, "notification-url": "https://packagist.org/downloads/", @@ -1078,16 +1083,73 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill for the Mbstring extension", + "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", "homepage": "https://symfony.com", "keywords": [ "compatibility", - "mbstring", "polyfill", "portable", "shim" ], - "time": "2019-08-06T08:03:45+00:00" + "time": "2020-05-12T16:47:27+00:00" + }, + { + "name": "symfony/service-contracts", + "version": "v1.1.8", + "source": { + "type": "git", + "url": "https://github.com/symfony/service-contracts.git", + "reference": "ffc7f5692092df31515df2a5ecf3b7302b3ddacf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/ffc7f5692092df31515df2a5ecf3b7302b3ddacf", + "reference": "ffc7f5692092df31515df2a5ecf3b7302b3ddacf", + "shasum": "" + }, + "require": { + "php": "^7.1.3", + "psr/container": "^1.0" + }, + "suggest": { + "symfony/service-implementation": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\Service\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to writing services", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "time": "2019-10-14T12:27:06+00:00" } ], "packages-dev": [ @@ -1337,12 +1399,6 @@ "Xdebug", "performance" ], - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" - } - ], "time": "2020-03-01T12:26:26+00:00" }, { @@ -1562,16 +1618,16 @@ }, { "name": "myclabs/deep-copy", - "version": "1.9.3", + "version": "1.9.5", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "007c053ae6f31bba39dfa19a7726f56e9763bbea" + "reference": "b2c28789e80a97badd14145fda39b545d83ca3ef" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/007c053ae6f31bba39dfa19a7726f56e9763bbea", - "reference": "007c053ae6f31bba39dfa19a7726f56e9763bbea", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/b2c28789e80a97badd14145fda39b545d83ca3ef", + "reference": "b2c28789e80a97badd14145fda39b545d83ca3ef", "shasum": "" }, "require": { @@ -1606,7 +1662,7 @@ "object", "object graph" ], - "time": "2019-08-09T12:45:53+00:00" + "time": "2020-01-17T21:11:47+00:00" }, { "name": "netresearch/jsonmapper", @@ -1859,24 +1915,21 @@ }, { "name": "phpdocumentor/reflection-common", - "version": "2.0.0", + "version": "2.1.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionCommon.git", - "reference": "63a995caa1ca9e5590304cd845c15ad6d482a62a" + "reference": "6568f4687e5b41b054365f9ae03fcb1ed5f2069b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/63a995caa1ca9e5590304cd845c15ad6d482a62a", - "reference": "63a995caa1ca9e5590304cd845c15ad6d482a62a", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/6568f4687e5b41b054365f9ae03fcb1ed5f2069b", + "reference": "6568f4687e5b41b054365f9ae03fcb1ed5f2069b", "shasum": "" }, "require": { "php": ">=7.1" }, - "require-dev": { - "phpunit/phpunit": "~6" - }, "type": "library", "extra": { "branch-alias": { @@ -1907,20 +1960,20 @@ "reflection", "static analysis" ], - "time": "2018-08-07T13:53:10+00:00" + "time": "2020-04-27T09:25:28+00:00" }, { "name": "phpdocumentor/reflection-docblock", - "version": "4.3.2", + "version": "4.3.4", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "b83ff7cfcfee7827e1e78b637a5904fe6a96698e" + "reference": "da3fd972d6bafd628114f7e7e036f45944b62e9c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/b83ff7cfcfee7827e1e78b637a5904fe6a96698e", - "reference": "b83ff7cfcfee7827e1e78b637a5904fe6a96698e", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/da3fd972d6bafd628114f7e7e036f45944b62e9c", + "reference": "da3fd972d6bafd628114f7e7e036f45944b62e9c", "shasum": "" }, "require": { @@ -1932,6 +1985,7 @@ "require-dev": { "doctrine/instantiator": "^1.0.5", "mockery/mockery": "^1.0", + "phpdocumentor/type-resolver": "0.4.*", "phpunit/phpunit": "^6.4" }, "type": "library", @@ -1958,7 +2012,7 @@ } ], "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "time": "2019-09-12T14:27:41+00:00" + "time": "2019-12-28T18:55:12+00:00" }, { "name": "phpdocumentor/type-resolver", @@ -2009,33 +2063,33 @@ }, { "name": "phpspec/prophecy", - "version": "1.9.0", + "version": "v1.10.3", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "f6811d96d97bdf400077a0cc100ae56aa32b9203" + "reference": "451c3cd1418cf640de218914901e51b064abb093" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/f6811d96d97bdf400077a0cc100ae56aa32b9203", - "reference": "f6811d96d97bdf400077a0cc100ae56aa32b9203", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/451c3cd1418cf640de218914901e51b064abb093", + "reference": "451c3cd1418cf640de218914901e51b064abb093", "shasum": "" }, "require": { "doctrine/instantiator": "^1.0.2", "php": "^5.3|^7.0", "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0|^5.0", - "sebastian/comparator": "^1.1|^2.0|^3.0", - "sebastian/recursion-context": "^1.0|^2.0|^3.0" + "sebastian/comparator": "^1.2.3|^2.0|^3.0|^4.0", + "sebastian/recursion-context": "^1.0|^2.0|^3.0|^4.0" }, "require-dev": { - "phpspec/phpspec": "^2.5|^3.2", + "phpspec/phpspec": "^2.5 || ^3.2", "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.8.x-dev" + "dev-master": "1.10.x-dev" } }, "autoload": { @@ -2068,20 +2122,20 @@ "spy", "stub" ], - "time": "2019-10-03T11:07:50+00:00" + "time": "2020-03-05T15:02:03+00:00" }, { "name": "phpstan/phpstan", - "version": "0.12.24", + "version": "0.12.25", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "823a120fea50b68742b2be2285818202ecce511e" + "reference": "9619551d68b2d4c0d681a8df73f3c847c798ee64" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/823a120fea50b68742b2be2285818202ecce511e", - "reference": "823a120fea50b68742b2be2285818202ecce511e", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/9619551d68b2d4c0d681a8df73f3c847c798ee64", + "reference": "9619551d68b2d4c0d681a8df73f3c847c798ee64", "shasum": "" }, "require": { @@ -2110,21 +2164,7 @@ "MIT" ], "description": "PHPStan - PHP Static Analysis Tool", - "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-05-10T14:25:55+00:00" + "time": "2020-05-10T20:36:16+00:00" }, { "name": "phpunit/php-code-coverage", @@ -2380,16 +2420,16 @@ }, { "name": "phpunit/phpunit", - "version": "7.5.17", + "version": "7.5.20", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "4c92a15296e58191a4cd74cff3b34fc8e374174a" + "reference": "9467db479d1b0487c99733bb1e7944d32deded2c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/4c92a15296e58191a4cd74cff3b34fc8e374174a", - "reference": "4c92a15296e58191a4cd74cff3b34fc8e374174a", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/9467db479d1b0487c99733bb1e7944d32deded2c", + "reference": "9467db479d1b0487c99733bb1e7944d32deded2c", "shasum": "" }, "require": { @@ -2460,7 +2500,54 @@ "testing", "xunit" ], - "time": "2019-10-28T10:37:36+00:00" + "time": "2020-01-08T08:45:45+00:00" + }, + { + "name": "psr/log", + "version": "1.1.3", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/0f73288fd15629204f9d42b7055f72dacbe811fc", + "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "Psr/Log/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "time": "2020-03-23T09:12:05+00:00" }, { "name": "sebastian/code-unit-reverse-lookup", @@ -2629,16 +2716,16 @@ }, { "name": "sebastian/environment", - "version": "4.2.2", + "version": "4.2.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "f2a2c8e1c97c11ace607a7a667d73d47c19fe404" + "reference": "464c90d7bdf5ad4e8a6aea15c091fec0603d4368" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/f2a2c8e1c97c11ace607a7a667d73d47c19fe404", - "reference": "f2a2c8e1c97c11ace607a7a667d73d47c19fe404", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/464c90d7bdf5ad4e8a6aea15c091fec0603d4368", + "reference": "464c90d7bdf5ad4e8a6aea15c091fec0603d4368", "shasum": "" }, "require": { @@ -2678,7 +2765,7 @@ "environment", "hhvm" ], - "time": "2019-05-05T09:05:15+00:00" + "time": "2019-11-20T08:46:58+00:00" }, { "name": "sebastian/exporter", @@ -3069,16 +3156,16 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "3.5.2", + "version": "3.5.5", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "65b12cdeaaa6cd276d4c3033a95b9b88b12701e7" + "reference": "73e2e7f57d958e7228fce50dc0c61f58f017f9f6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/65b12cdeaaa6cd276d4c3033a95b9b88b12701e7", - "reference": "65b12cdeaaa6cd276d4c3033a95b9b88b12701e7", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/73e2e7f57d958e7228fce50dc0c61f58f017f9f6", + "reference": "73e2e7f57d958e7228fce50dc0c61f58f017f9f6", "shasum": "" }, "require": { @@ -3116,20 +3203,20 @@ "phpcs", "standards" ], - "time": "2019-10-28T04:36:32+00:00" + "time": "2020-04-17T01:09:41+00:00" }, { "name": "symfony/polyfill-ctype", - "version": "v1.12.0", + "version": "v1.17.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "550ebaac289296ce228a706d0867afc34687e3f4" + "reference": "e94c8b1bbe2bc77507a1056cdb06451c75b427f9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/550ebaac289296ce228a706d0867afc34687e3f4", - "reference": "550ebaac289296ce228a706d0867afc34687e3f4", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/e94c8b1bbe2bc77507a1056cdb06451c75b427f9", + "reference": "e94c8b1bbe2bc77507a1056cdb06451c75b427f9", "shasum": "" }, "require": { @@ -3141,7 +3228,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.12-dev" + "dev-master": "1.17-dev" } }, "autoload": { @@ -3174,31 +3261,31 @@ "polyfill", "portable" ], - "time": "2019-08-06T08:03:45+00:00" + "time": "2020-05-12T16:14:59+00:00" }, { "name": "symfony/yaml", - "version": "v3.4.35", + "version": "v4.4.8", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "dab657db15207879217fc81df4f875947bf68804" + "reference": "b385dce1c0e9f839b384af90188638819433e252" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/dab657db15207879217fc81df4f875947bf68804", - "reference": "dab657db15207879217fc81df4f875947bf68804", + "url": "https://api.github.com/repos/symfony/yaml/zipball/b385dce1c0e9f839b384af90188638819433e252", + "reference": "b385dce1c0e9f839b384af90188638819433e252", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8", + "php": "^7.1.3", "symfony/polyfill-ctype": "~1.8" }, "conflict": { "symfony/console": "<3.4" }, "require-dev": { - "symfony/console": "~3.4|~4.0" + "symfony/console": "^3.4|^4.0|^5.0" }, "suggest": { "symfony/console": "For validating YAML files using the lint command" @@ -3206,7 +3293,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.4-dev" + "dev-master": "4.4-dev" } }, "autoload": { @@ -3233,7 +3320,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2019-10-24T15:33:53+00:00" + "time": "2020-04-28T17:55:16+00:00" }, { "name": "theseer/tokenizer", @@ -3277,16 +3364,16 @@ }, { "name": "vimeo/psalm", - "version": "3.11.2", + "version": "3.11.4", "source": { "type": "git", "url": "https://github.com/vimeo/psalm.git", - "reference": "d470903722cfcbc1cd04744c5491d3e6d13ec3d9" + "reference": "58e1d8e68e5098bf4fbfdfb420c38d563f882549" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vimeo/psalm/zipball/d470903722cfcbc1cd04744c5491d3e6d13ec3d9", - "reference": "d470903722cfcbc1cd04744c5491d3e6d13ec3d9", + "url": "https://api.github.com/repos/vimeo/psalm/zipball/58e1d8e68e5098bf4fbfdfb420c38d563f882549", + "reference": "58e1d8e68e5098bf4fbfdfb420c38d563f882549", "shasum": "" }, "require": { @@ -3371,35 +3458,33 @@ "inspection", "php" ], - "time": "2020-04-13T12:47:11+00:00" + "time": "2020-05-11T13:39:25+00:00" }, { "name": "webmozart/assert", - "version": "1.5.0", + "version": "1.8.0", "source": { "type": "git", "url": "https://github.com/webmozart/assert.git", - "reference": "88e6d84706d09a236046d686bbea96f07b3a34f4" + "reference": "ab2cb0b3b559010b75981b1bdce728da3ee90ad6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozart/assert/zipball/88e6d84706d09a236046d686bbea96f07b3a34f4", - "reference": "88e6d84706d09a236046d686bbea96f07b3a34f4", + "url": "https://api.github.com/repos/webmozart/assert/zipball/ab2cb0b3b559010b75981b1bdce728da3ee90ad6", + "reference": "ab2cb0b3b559010b75981b1bdce728da3ee90ad6", "shasum": "" }, "require": { "php": "^5.3.3 || ^7.0", "symfony/polyfill-ctype": "^1.8" }, + "conflict": { + "vimeo/psalm": "<3.9.1" + }, "require-dev": { "phpunit/phpunit": "^4.8.36 || ^7.5.13" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.3-dev" - } - }, "autoload": { "psr-4": { "Webmozart\\Assert\\": "src/" @@ -3421,7 +3506,7 @@ "check", "validate" ], - "time": "2019-08-24T08:43:50+00:00" + "time": "2020-04-18T12:12:48+00:00" }, { "name": "webmozart/glob", @@ -3529,6 +3614,5 @@ "platform-dev": [], "platform-overrides": { "php": "7.1.3" - }, - "plugin-api-version": "1.1.0" + } } diff --git a/lib/Doctrine/ORM/Tools/Console/MetadataFilter.php b/lib/Doctrine/ORM/Tools/Console/MetadataFilter.php index f0c5669a31..b03f599162 100644 --- a/lib/Doctrine/ORM/Tools/Console/MetadataFilter.php +++ b/lib/Doctrine/ORM/Tools/Console/MetadataFilter.php @@ -19,7 +19,7 @@ namespace Doctrine\ORM\Tools\Console; -use Doctrine\Common\Persistence\Mapping\ClassMetadata; +use Doctrine\Persistence\Mapping\ClassMetadata; /** * Used by CLI Tools to restrict entity-based commands to given patterns. diff --git a/lib/Doctrine/ORM/Tools/EntityGenerator.php b/lib/Doctrine/ORM/Tools/EntityGenerator.php index fcc9d6fc25..6dbbe60613 100644 --- a/lib/Doctrine/ORM/Tools/EntityGenerator.php +++ b/lib/Doctrine/ORM/Tools/EntityGenerator.php @@ -342,9 +342,7 @@ public function __construct() { @trigger_error(self::class . ' is deprecated and will be removed in Doctrine ORM 3.0', E_USER_DEPRECATED); - if (version_compare(\Doctrine\Common\Version::VERSION, '2.2.0-DEV', '>=')) { - $this->annotationsPrefix = 'ORM\\'; - } + $this->annotationsPrefix = 'ORM\\'; } /** diff --git a/tests/Doctrine/Tests/OrmTestCase.php b/tests/Doctrine/Tests/OrmTestCase.php index 6fdbe14711..1de2b2ac62 100644 --- a/tests/Doctrine/Tests/OrmTestCase.php +++ b/tests/Doctrine/Tests/OrmTestCase.php @@ -4,7 +4,6 @@ use Doctrine\Common\Annotations; use Doctrine\Common\Cache\ArrayCache; -use Doctrine\Common\Version; use Doctrine\DBAL\DriverManager; use Doctrine\ORM\Cache\CacheConfiguration; use Doctrine\ORM\Cache\DefaultCacheFactory; @@ -65,37 +64,12 @@ abstract class OrmTestCase extends DoctrineTestCase */ protected function createAnnotationDriver($paths = [], $alias = null) { - if (version_compare(Version::VERSION, '3.0.0', '>=')) { - $reader = new Annotations\CachedReader(new Annotations\AnnotationReader(), new ArrayCache()); - } else if (version_compare(Version::VERSION, '2.2.0-DEV', '>=')) { - // Register the ORM Annotations in the AnnotationRegistry - $reader = new Annotations\SimpleAnnotationReader(); - - $reader->addNamespace('Doctrine\ORM\Mapping'); - - $reader = new Annotations\CachedReader($reader, new ArrayCache()); - } else if (version_compare(Version::VERSION, '2.1.0-BETA3-DEV', '>=')) { - $reader = new Annotations\AnnotationReader(); - - $reader->setIgnoreNotImportedAnnotations(true); - $reader->setEnableParsePhpImports(false); - - if ($alias) { - $reader->setAnnotationNamespaceAlias('Doctrine\ORM\Mapping\\', $alias); - } else { - $reader->setDefaultAnnotationNamespace('Doctrine\ORM\Mapping\\'); - } - - $reader = new Annotations\CachedReader(new Annotations\IndexedReader($reader), new ArrayCache()); - } else { - $reader = new Annotations\AnnotationReader(); - - if ($alias) { - $reader->setAnnotationNamespaceAlias('Doctrine\ORM\Mapping\\', $alias); - } else { - $reader->setDefaultAnnotationNamespace('Doctrine\ORM\Mapping\\'); - } - } + // Register the ORM Annotations in the AnnotationRegistry + $reader = new Annotations\SimpleAnnotationReader(); + + $reader->addNamespace('Doctrine\ORM\Mapping'); + + $reader = new Annotations\CachedReader($reader, new ArrayCache()); Annotations\AnnotationRegistry::registerFile(__DIR__ . "/../../../lib/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php"); diff --git a/tools/sandbox/doctrine.php b/tools/sandbox/doctrine.php index 04c99e327b..8b4af6fe13 100644 --- a/tools/sandbox/doctrine.php +++ b/tools/sandbox/doctrine.php @@ -1,8 +1,10 @@ setCatchExceptions(true); $cli->setHelperSet(new Symfony\Component\Console\Helper\HelperSet( From 93867f8d77e3a1b0c330753e627a2b8ec9b74c6f Mon Sep 17 00:00:00 2001 From: Alexander Berl Date: Mon, 8 Jun 2020 23:06:53 +0200 Subject: [PATCH 087/136] TASK: Replace "Blacklist" example with "Banlist" (#8174) --- docs/en/reference/dql-doctrine-query-language.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/reference/dql-doctrine-query-language.rst b/docs/en/reference/dql-doctrine-query-language.rst index ffb5b7957b..200611835d 100644 --- a/docs/en/reference/dql-doctrine-query-language.rst +++ b/docs/en/reference/dql-doctrine-query-language.rst @@ -491,7 +491,7 @@ Joins between entities without associations were not possible until version .. code-block:: php createQuery('SELECT u FROM User u JOIN Blacklist b WITH u.email = b.email'); + $query = $em->createQuery('SELECT u FROM User u JOIN Banlist b WITH u.email = b.email'); .. note:: The differences between WHERE, WITH and HAVING clauses may be From 5ced62bf83bf0c38a5af15fc28b6c0344017d37d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Paris?= Date: Wed, 17 Jun 2020 22:06:42 +0200 Subject: [PATCH 088/136] Run benchmark on PHP 7.4 (#8186) phpbench recently dropped compatibilty with PHP 7.1 When this job was introduced, 7.1 was the latest version of PHP we supported, so it makes sense to bump to 7.4 now. See https://github.com/phpbench/phpbench/releases/tag/0.17.0 See e07c90df4488b7b44494695e46c3505f5cf21266 --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 7c0b00b6e5..c8b3b9a7b7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -86,6 +86,7 @@ jobs: - stage: Code Quality env: DB=none BENCHMARK + php: 7.4 before_script: wget https://phpbench.github.io/phpbench/phpbench.phar https://phpbench.github.io/phpbench/phpbench.phar.pubkey script: php phpbench.phar run -l dots --report=default From 765521d257bf18219fd9c720dbd8f1f6d2b5eb2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Paris?= Date: Wed, 17 Jun 2020 22:47:25 +0200 Subject: [PATCH 089/136] Use CodeCov instead of Scrutinizer (#8187) * Document current branch status in the README * Use CodeCov instead of Scrutinizer --- .scrutinizer.yml | 34 ---------------------------------- .travis.yml | 5 ++--- README.md | 18 +++++++++--------- 3 files changed, 11 insertions(+), 46 deletions(-) delete mode 100644 .scrutinizer.yml diff --git a/.scrutinizer.yml b/.scrutinizer.yml deleted file mode 100644 index d05c72cf06..0000000000 --- a/.scrutinizer.yml +++ /dev/null @@ -1,34 +0,0 @@ -build: - nodes: - analysis: - environment: - php: - version: 7.1 - cache: - disabled: false - directories: - - ~/.composer/cache - - project_setup: - override: true - tests: - override: - - php-scrutinizer-run - -before_commands: - - "composer install --no-dev --prefer-source" - -tools: - external_code_coverage: - timeout: 3600 - -filter: - excluded_paths: - - docs - - tools - -build_failure_conditions: - - 'elements.rating(<= C).new.exists' # No new classes/methods with a rating of C or worse allowed - - 'issues.severity(>= MAJOR).new.exists' # New issues of major or higher severity - - 'project.metric_change("scrutinizer.test_coverage", < 0)' # Code Coverage decreased from previous inspection - - 'patches.label("Unused Use Statements").new.exists' # No new unused imports patches allowed diff --git a/.travis.yml b/.travis.yml index c8b3b9a7b7..30bafb39ee 100644 --- a/.travis.yml +++ b/.travis.yml @@ -80,9 +80,8 @@ jobs: - if [[ ! $(php -m | grep -si xdebug) ]]; then echo "xdebug required for coverage"; exit 1; fi script: - ENABLE_SECOND_LEVEL_CACHE=0 ./vendor/bin/phpunit -v -c tests/travis/$DB.travis.xml --coverage-clover ./build/logs/clover.xml - after_script: - - wget https://scrutinizer-ci.com/ocular.phar - - php ocular.phar code-coverage:upload --format=php-clover build/logs/clover.xml + after_success: + - bash <(curl -s https://codecov.io/bash) -f ./build/logs/clover.xml - stage: Code Quality env: DB=none BENCHMARK diff --git a/README.md b/README.md index 7f935fc34c..1e65b5c193 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ -| [Master][Master] | [2.5][2.5] | +| [Master][Master] | [2.7][2.7] | |:----------------:|:----------:| -| [![Build status][Master image]][Master] | [![Build status][2.5 image]][2.5] | -| [![Coverage Status][Master coverage image]][Master coverage] | [![Coverage Status][2.5 coverage image]][2.5 coverage] | +| [![Build status][Master image]][Master] | [![Build status][2.7 image]][2.7] | +| [![Coverage Status][Master coverage image]][Master coverage] | [![Coverage Status][2.7 coverage image]][2.7 coverage] | Doctrine 2 is an object-relational mapper (ORM) for PHP 7.1+ that provides transparent persistence for PHP objects. It sits on top of a powerful database abstraction layer (DBAL). One of its key features @@ -18,9 +18,9 @@ without requiring unnecessary code duplication. [Master image]: https://img.shields.io/travis/doctrine/orm/master.svg?style=flat-square [Master]: https://travis-ci.org/doctrine/orm - [Master coverage image]: https://img.shields.io/scrutinizer/coverage/g/doctrine/orm/master.svg?style=flat-square - [Master coverage]: https://scrutinizer-ci.com/g/doctrine/orm/?branch=master - [2.5 image]: https://img.shields.io/travis/doctrine/orm/2.5.svg?style=flat-square - [2.5]: https://github.com/doctrine/orm/tree/2.5 - [2.5 coverage image]: https://img.shields.io/scrutinizer/coverage/g/doctrine/orm/2.5.svg?style=flat-square - [2.5 coverage]: https://scrutinizer-ci.com/g/doctrine/orm/?branch=2.5 + [Master coverage image]: https://codecov.io/gh/doctrine/orm/branch/master/graph/badge.svg + [Master coverage]: https://codecov.io/gh/doctrine/orm/branch/master + [2.7 image]: https://img.shields.io/travis/doctrine/orm/2.7.svg?style=flat-square + [2.7]: https://github.com/doctrine/orm/tree/2.7 + [2.7 coverage image]: https://codecov.io/gh/doctrine/orm/branch/2.7/graph/badge.svg + [2.7 coverage]: https://codecov.io/gh/doctrine/orm/branch/2.7 From 6a670d7d6dfa075d1faa5a5f85e1202237a33190 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Thu, 18 Jun 2020 23:05:13 +0200 Subject: [PATCH 090/136] Allow using on PHP 7.1 with Composer 2 (#8184) --- composer.json | 2 +- composer.lock | 122 ++++++++++++++++++++++++++++---------------------- 2 files changed, 70 insertions(+), 54 deletions(-) diff --git a/composer.json b/composer.json index 787210c8a6..069d19fb94 100644 --- a/composer.json +++ b/composer.json @@ -21,6 +21,7 @@ "require": { "php": "^7.1", "ext-pdo": "*", + "composer/package-versions-deprecated": "^1.8", "doctrine/annotations": "^1.8", "doctrine/cache": "^1.9.1", "doctrine/collections": "^1.5", @@ -31,7 +32,6 @@ "doctrine/instantiator": "^1.3", "doctrine/lexer": "^1.0", "doctrine/persistence": "^1.3.3 || ^2.0", - "ocramius/package-versions": "^1.2", "symfony/console": "^3.0|^4.0|^5.0" }, "require-dev": { diff --git a/composer.lock b/composer.lock index 267db0ba83..5e2c2c2515 100644 --- a/composer.lock +++ b/composer.lock @@ -1,11 +1,76 @@ { "_readme": [ "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "2b7c09043b3b7d625abd8ee130abb16b", + "content-hash": "8f74f1ed98af4508fc136e982596658b", "packages": [ + { + "name": "composer/package-versions-deprecated", + "version": "1.8.0", + "source": { + "type": "git", + "url": "https://github.com/composer/package-versions-deprecated.git", + "reference": "98df7f1b293c0550bd5b1ce6b60b59bdda23aa47" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/package-versions-deprecated/zipball/98df7f1b293c0550bd5b1ce6b60b59bdda23aa47", + "reference": "98df7f1b293c0550bd5b1ce6b60b59bdda23aa47", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.1.0 || ^2.0", + "php": "^7" + }, + "replace": { + "ocramius/package-versions": "1.2 - 1.8.99" + }, + "require-dev": { + "composer/composer": "^1.9.3 || ^2.0@dev", + "ext-zip": "^1.13", + "phpunit/phpunit": "^6.5 || ^7" + }, + "type": "composer-plugin", + "extra": { + "class": "PackageVersions\\Installer", + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "PackageVersions\\": "src/PackageVersions" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com" + }, + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be" + } + ], + "description": "Composer plugin that provides efficient querying for installed package versions (no runtime IO)", + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2020-04-23T11:49:37+00:00" + }, { "name": "doctrine/annotations", "version": "1.10.3", @@ -801,56 +866,6 @@ ], "time": "2020-03-27T11:06:43+00:00" }, - { - "name": "ocramius/package-versions", - "version": "1.4.2", - "source": { - "type": "git", - "url": "https://github.com/Ocramius/PackageVersions.git", - "reference": "44af6f3a2e2e04f2af46bcb302ad9600cba41c7d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Ocramius/PackageVersions/zipball/44af6f3a2e2e04f2af46bcb302ad9600cba41c7d", - "reference": "44af6f3a2e2e04f2af46bcb302ad9600cba41c7d", - "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.5.17" - }, - "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-11-15T16:17:10+00:00" - }, { "name": "psr/container", "version": "1.0.0", @@ -3614,5 +3629,6 @@ "platform-dev": [], "platform-overrides": { "php": "7.1.3" - } + }, + "plugin-api-version": "1.1.0" } From a438e9004640686043086c4eaddd98f0d782a256 Mon Sep 17 00:00:00 2001 From: vladyslavstartsev <17382248+vladyslavstartsev@users.noreply.github.com> Date: Fri, 19 Jun 2020 14:48:45 +0300 Subject: [PATCH 091/136] add dev files to .gitattribute (#8190) those files probably are not used by end user of the lib --- .gitattributes | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitattributes b/.gitattributes index c5a870fd09..2ad69e189f 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,5 +1,6 @@ /tests export-ignore /tools export-ignore +/.github export-ignore .gitattributes export-ignore .gitignore export-ignore .gitmodules export-ignore @@ -11,3 +12,6 @@ CONTRIBUTING.md export-ignore phpunit.xml.dist export-ignore run-all.sh export-ignore phpcs.xml.dist export-ignore +phpbench.json export-ignore +phpstan.neon export-ignore +psalm.xml export-ignore From 2a2a0b2980a866f320252b1e50f10668f271557f Mon Sep 17 00:00:00 2001 From: Mohamed Ettaki Talbi Date: Thu, 2 Jul 2020 08:36:18 +0200 Subject: [PATCH 092/136] Remove unwanted period (#8198) --- docs/en/tutorials/extra-lazy-associations.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/tutorials/extra-lazy-associations.rst b/docs/en/tutorials/extra-lazy-associations.rst index 1146290428..24a46a379c 100644 --- a/docs/en/tutorials/extra-lazy-associations.rst +++ b/docs/en/tutorials/extra-lazy-associations.rst @@ -3,7 +3,7 @@ Extra Lazy Associations .. versionadded:: 2.1 -In many cases associations between entities can get pretty large. Even in a simple scenario like a blog. +In many cases associations between entities can get pretty large. Even in a simple scenario like a blog where posts can be commented, you always have to assume that a post draws hundreds of comments. In Doctrine 2.0 if you accessed an association it would always get loaded completely into memory. This can lead to pretty serious performance problems, if your associations contain several hundreds or thousands From 64c3f6873420eb67e5ad451d4d51d1668bdccabf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gildas=20Qu=C3=A9m=C3=A9ner?= Date: Sun, 5 Jul 2020 19:48:38 +0200 Subject: [PATCH 093/136] Prohibits class typo in the discriminator map (#8122) * Prevents incorrect table aliases to be generated When a defined subclass has a case typo, the query builder will be lost and will generate exotic table alias. This commit fixes the issue at the root by prohibiting case typo in discriminator map. See https://github.com/doctrine/orm/pull/8112 for the consequence of such typo. * Controls growing rate of the abstract test class * Fixes incorrect test case The Cube class must be autoloaded with the correct case, otherwise composer autoloader will complain. * Removes non architecture compliant code See https://github.com/doctrine/orm/pull/8122/files#r423952247 * Ensures discriminator map is case sensitive --- .../ORM/Mapping/ClassMetadataFactory.php | 6 +++ .../CaseSensitiveDiscriminatorMap/Cube.php | 10 +++++ .../CaseSensitiveDiscriminatorMap/Shape.php | 44 +++++++++++++++++++ .../ORM/Mapping/AbstractMappingDriverTest.php | 14 +++++- ...ls.CaseSensitiveDiscriminatorMap.Shape.php | 28 ++++++++++++ ...aseSensitiveDiscriminatorMap.Shape.dcm.xml | 15 +++++++ ...aseSensitiveDiscriminatorMap.Shape.dcm.yml | 14 ++++++ 7 files changed, 130 insertions(+), 1 deletion(-) create mode 100644 tests/Doctrine/Tests/Models/CaseSensitiveDiscriminatorMap/Cube.php create mode 100644 tests/Doctrine/Tests/Models/CaseSensitiveDiscriminatorMap/Shape.php create mode 100644 tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.CaseSensitiveDiscriminatorMap.Shape.php create mode 100644 tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.CaseSensitiveDiscriminatorMap.Shape.dcm.xml create mode 100644 tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.CaseSensitiveDiscriminatorMap.Shape.dcm.yml diff --git a/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php b/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php index d36ea30846..7a7c2bc6d1 100644 --- a/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php +++ b/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php @@ -31,6 +31,7 @@ use Doctrine\Persistence\Mapping\ClassMetadata as ClassMetadataInterface; use Doctrine\Persistence\Mapping\Driver\MappingDriver; use Doctrine\Persistence\Mapping\ReflectionService; +use ReflectionClass; use ReflectionException; use function assert; use function interface_exists; @@ -278,6 +279,11 @@ protected function validateRuntimeMetadata($class, $parent) if ( ! $class->discriminatorColumn) { throw MappingException::missingDiscriminatorColumn($class->name); } + foreach ($class->subClasses as $subClass) { + if ((new ReflectionClass($subClass))->name !== $subClass) { + throw MappingException::invalidClassInDiscriminatorMap($subClass, $class->name); + } + } } } else if ($class->isMappedSuperclass && $class->name == $class->rootEntityName && (count($class->discriminatorMap) || $class->discriminatorColumn)) { // second condition is necessary for mapped superclasses in the middle of an inheritance hierarchy diff --git a/tests/Doctrine/Tests/Models/CaseSensitiveDiscriminatorMap/Cube.php b/tests/Doctrine/Tests/Models/CaseSensitiveDiscriminatorMap/Cube.php new file mode 100644 index 0000000000..0c608f7453 --- /dev/null +++ b/tests/Doctrine/Tests/Models/CaseSensitiveDiscriminatorMap/Cube.php @@ -0,0 +1,10 @@ +setInheritanceType(ClassMetadataInfo::INHERITANCE_TYPE_SINGLE_TABLE); + $metadata->setDiscriminatorColumn([ + 'name' => 'discr', + 'type' => 'string', + 'length' => 32, + ]); + $metadata->setDiscriminatorMap([ + 'cube' => cube::class, + ]); + $metadata->mapField([ + 'fieldName' => 'id', + 'type' => 'string', + 'length' => null, + 'precision' => 0, + 'scale' => 0, + 'nullable' => false, + 'unique' => false, + 'id' => true, + 'columnName' => 'id', + ]); + $metadata->setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_AUTO); + } +} diff --git a/tests/Doctrine/Tests/ORM/Mapping/AbstractMappingDriverTest.php b/tests/Doctrine/Tests/ORM/Mapping/AbstractMappingDriverTest.php index 502ed479e2..eb2388b9e5 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/AbstractMappingDriverTest.php +++ b/tests/Doctrine/Tests/ORM/Mapping/AbstractMappingDriverTest.php @@ -14,6 +14,7 @@ use Doctrine\ORM\Mapping\UnderscoreNamingStrategy; use Doctrine\Persistence\Mapping\RuntimeReflectionService; use Doctrine\Tests\Models\Cache\City; +use Doctrine\Tests\Models\CaseSensitiveDiscriminatorMap; use Doctrine\Tests\Models\CMS\CmsAddress; use Doctrine\Tests\Models\CMS\CmsAddressListener; use Doctrine\Tests\Models\CMS\CmsUser; @@ -37,6 +38,7 @@ use Doctrine\Tests\Models\DDC964\DDC964Admin; use Doctrine\Tests\Models\DDC964\DDC964Guest; use Doctrine\Tests\OrmTestCase; +use function class_exists; abstract class AbstractMappingDriverTest extends OrmTestCase { @@ -1079,6 +1081,17 @@ public function testDiscriminatorColumnDefaultName() $this->assertEquals('dtype', $class->discriminatorColumn['name']); } + public function testInvalidSubClassCase() + { + class_exists(CaseSensitiveDiscriminatorMap\Cube::class); + + $this->expectException(MappingException::class); + $this->expectExceptionMessage('Entity class \'Doctrine\Tests\Models\CaseSensitiveDiscriminatorMap\cube\' used in the discriminator map of class \'Doctrine\Tests\Models\CaseSensitiveDiscriminatorMap\Shape\' does not exist.'); + + $em = $this->_getTestEntityManager(); + $factory = $this->createClassMetadataFactory($em); + $factory->getMetadataFor(CaseSensitiveDiscriminatorMap\Shape::class); + } } /** @@ -1344,7 +1357,6 @@ public static function loadMetadata(ClassMetadataInfo $metadata) } } - /** * @Entity */ diff --git a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.CaseSensitiveDiscriminatorMap.Shape.php b/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.CaseSensitiveDiscriminatorMap.Shape.php new file mode 100644 index 0000000000..5299f8246c --- /dev/null +++ b/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.CaseSensitiveDiscriminatorMap.Shape.php @@ -0,0 +1,28 @@ +setInheritanceType(ClassMetadataInfo::INHERITANCE_TYPE_SINGLE_TABLE); +$metadata->setDiscriminatorColumn([ + 'name' => 'discr', + 'type' => 'string', + 'length' => 32, +]); +$metadata->setDiscriminatorMap([ + 'cube' => cube::class, +]); +$metadata->mapField([ + 'fieldName' => 'id', + 'type' => 'string', + 'length' => null, + 'precision' => 0, + 'scale' => 0, + 'nullable' => false, + 'unique' => false, + 'id' => true, + 'columnName' => 'id', +]); +$metadata->setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_AUTO); diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.CaseSensitiveDiscriminatorMap.Shape.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.CaseSensitiveDiscriminatorMap.Shape.dcm.xml new file mode 100644 index 0000000000..51139c14bc --- /dev/null +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.CaseSensitiveDiscriminatorMap.Shape.dcm.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + diff --git a/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.CaseSensitiveDiscriminatorMap.Shape.dcm.yml b/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.CaseSensitiveDiscriminatorMap.Shape.dcm.yml new file mode 100644 index 0000000000..062f9ddc99 --- /dev/null +++ b/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.CaseSensitiveDiscriminatorMap.Shape.dcm.yml @@ -0,0 +1,14 @@ +Doctrine\Tests\Models\CaseSensitiveDiscriminatorMap\Shape: + type: entity + inheritanceType: SINGLE_TABLE + discriminatorMap: + cube: Doctrine\Tests\Models\CaseSensitiveDiscriminatorMap\cube + discriminatorColumn: + type: string + name: discr + length: 32 + id: + id: + type: integer + generator: + strategy: AUTO From 775d91c2a3de78148d75ec32d1ee3ee87e6187ab Mon Sep 17 00:00:00 2001 From: Benjamin Eberlei Date: Sun, 5 Jul 2020 20:11:01 +0200 Subject: [PATCH 094/136] [GH-8122] Move test from AbstractMappingDriverTest to ClassMetadataFactoryTest case --- .../CaseSensitiveDiscriminatorMap/Cube.php | 10 ----- .../CaseSensitiveDiscriminatorMap/Shape.php | 44 ------------------- .../ORM/Mapping/AbstractMappingDriverTest.php | 12 ----- .../ORM/Mapping/ClassMetadataFactoryTest.php | 30 +++++++++++++ ...ls.CaseSensitiveDiscriminatorMap.Shape.php | 28 ------------ ...aseSensitiveDiscriminatorMap.Shape.dcm.xml | 15 ------- ...aseSensitiveDiscriminatorMap.Shape.dcm.yml | 14 ------ 7 files changed, 30 insertions(+), 123 deletions(-) delete mode 100644 tests/Doctrine/Tests/Models/CaseSensitiveDiscriminatorMap/Cube.php delete mode 100644 tests/Doctrine/Tests/Models/CaseSensitiveDiscriminatorMap/Shape.php delete mode 100644 tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.CaseSensitiveDiscriminatorMap.Shape.php delete mode 100644 tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.CaseSensitiveDiscriminatorMap.Shape.dcm.xml delete mode 100644 tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.CaseSensitiveDiscriminatorMap.Shape.dcm.yml diff --git a/tests/Doctrine/Tests/Models/CaseSensitiveDiscriminatorMap/Cube.php b/tests/Doctrine/Tests/Models/CaseSensitiveDiscriminatorMap/Cube.php deleted file mode 100644 index 0c608f7453..0000000000 --- a/tests/Doctrine/Tests/Models/CaseSensitiveDiscriminatorMap/Cube.php +++ /dev/null @@ -1,10 +0,0 @@ -setInheritanceType(ClassMetadataInfo::INHERITANCE_TYPE_SINGLE_TABLE); - $metadata->setDiscriminatorColumn([ - 'name' => 'discr', - 'type' => 'string', - 'length' => 32, - ]); - $metadata->setDiscriminatorMap([ - 'cube' => cube::class, - ]); - $metadata->mapField([ - 'fieldName' => 'id', - 'type' => 'string', - 'length' => null, - 'precision' => 0, - 'scale' => 0, - 'nullable' => false, - 'unique' => false, - 'id' => true, - 'columnName' => 'id', - ]); - $metadata->setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_AUTO); - } -} diff --git a/tests/Doctrine/Tests/ORM/Mapping/AbstractMappingDriverTest.php b/tests/Doctrine/Tests/ORM/Mapping/AbstractMappingDriverTest.php index eb2388b9e5..f9bbe629e2 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/AbstractMappingDriverTest.php +++ b/tests/Doctrine/Tests/ORM/Mapping/AbstractMappingDriverTest.php @@ -1080,18 +1080,6 @@ public function testDiscriminatorColumnDefaultName() $class = $this->createClassMetadata(SingleTableEntityIncompleteDiscriminatorColumnMapping::class); $this->assertEquals('dtype', $class->discriminatorColumn['name']); } - - public function testInvalidSubClassCase() - { - class_exists(CaseSensitiveDiscriminatorMap\Cube::class); - - $this->expectException(MappingException::class); - $this->expectExceptionMessage('Entity class \'Doctrine\Tests\Models\CaseSensitiveDiscriminatorMap\cube\' used in the discriminator map of class \'Doctrine\Tests\Models\CaseSensitiveDiscriminatorMap\Shape\' does not exist.'); - - $em = $this->_getTestEntityManager(); - $factory = $this->createClassMetadataFactory($em); - $factory->getMetadataFor(CaseSensitiveDiscriminatorMap\Shape::class); - } } /** diff --git a/tests/Doctrine/Tests/ORM/Mapping/ClassMetadataFactoryTest.php b/tests/Doctrine/Tests/ORM/Mapping/ClassMetadataFactoryTest.php index 3564758673..f58010fb5a 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/ClassMetadataFactoryTest.php +++ b/tests/Doctrine/Tests/ORM/Mapping/ClassMetadataFactoryTest.php @@ -453,6 +453,36 @@ public function testInheritsIdGeneratorMappingFromEmbeddable() $this->assertTrue($userMetadata->isIdGeneratorIdentity()); } + + public function testInvalidSubClassCase() + { + $this->expectException(MappingException::class); + $this->expectExceptionMessage('Entity class \'Doctrine\Tests\ORM\Mapping\cube\' used in the discriminator map of class \'Doctrine\Tests\ORM\Mapping\Shape\' does not exist.'); + + $cmf = new ClassMetadataFactory(); + $driver = $this->createAnnotationDriver([__DIR__]); + $em = $this->_createEntityManager($driver); + $cmf->setEntityManager($em); + + $userMetadata = $cmf->getMetadataFor(Shape::class); + } +} + +/** + * @Entity + * @InheritanceType("SINGLE_TABLE") + * @DiscriminatorMap({"cube" = cube::class}) + * @DiscriminatorColumn(name="discr", length=32, type="string") + */ +abstract class Shape +{ + /** @Id @Column(type="string") @GeneratedValue(strategy="AUTO") */ + public $id; +} + +/** @Entity */ +final class Cube extends Shape +{ } /* Test subject class with overridden factory method for mocking purposes */ diff --git a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.CaseSensitiveDiscriminatorMap.Shape.php b/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.CaseSensitiveDiscriminatorMap.Shape.php deleted file mode 100644 index 5299f8246c..0000000000 --- a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.CaseSensitiveDiscriminatorMap.Shape.php +++ /dev/null @@ -1,28 +0,0 @@ -setInheritanceType(ClassMetadataInfo::INHERITANCE_TYPE_SINGLE_TABLE); -$metadata->setDiscriminatorColumn([ - 'name' => 'discr', - 'type' => 'string', - 'length' => 32, -]); -$metadata->setDiscriminatorMap([ - 'cube' => cube::class, -]); -$metadata->mapField([ - 'fieldName' => 'id', - 'type' => 'string', - 'length' => null, - 'precision' => 0, - 'scale' => 0, - 'nullable' => false, - 'unique' => false, - 'id' => true, - 'columnName' => 'id', -]); -$metadata->setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_AUTO); diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.CaseSensitiveDiscriminatorMap.Shape.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.CaseSensitiveDiscriminatorMap.Shape.dcm.xml deleted file mode 100644 index 51139c14bc..0000000000 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.CaseSensitiveDiscriminatorMap.Shape.dcm.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - diff --git a/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.CaseSensitiveDiscriminatorMap.Shape.dcm.yml b/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.CaseSensitiveDiscriminatorMap.Shape.dcm.yml deleted file mode 100644 index 062f9ddc99..0000000000 --- a/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.CaseSensitiveDiscriminatorMap.Shape.dcm.yml +++ /dev/null @@ -1,14 +0,0 @@ -Doctrine\Tests\Models\CaseSensitiveDiscriminatorMap\Shape: - type: entity - inheritanceType: SINGLE_TABLE - discriminatorMap: - cube: Doctrine\Tests\Models\CaseSensitiveDiscriminatorMap\cube - discriminatorColumn: - type: string - name: discr - length: 32 - id: - id: - type: integer - generator: - strategy: AUTO From 6c73a6b7206de7b4ea286e76c0e2c4de8d66e6a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Paris?= Date: Sun, 5 Jul 2020 20:15:39 +0200 Subject: [PATCH 095/136] Infer return type information with Psalter (#8150) These changes are a subset of changes done with vendor/bin/psalm --alter --issues=LessSpecificReturnType --allow-backwards-incompatible-changes=false --- lib/Doctrine/ORM/AbstractQuery.php | 6 +- lib/Doctrine/ORM/Cache/DefaultQueryCache.php | 4 +- lib/Doctrine/ORM/Event/OnClearEventArgs.php | 2 +- lib/Doctrine/ORM/Id/AbstractIdGenerator.php | 2 +- .../Internal/Hydration/AbstractHydrator.php | 15 ++++- .../Mapping/Builder/AssociationBuilder.php | 28 ++++---- .../Mapping/Builder/ClassMetadataBuilder.php | 32 ++++----- .../ORM/Mapping/Builder/FieldBuilder.php | 24 +++---- .../Builder/ManyToManyAssociationBuilder.php | 4 +- .../Builder/OneToManyAssociationBuilder.php | 4 +- .../ORM/Mapping/ClassMetadataInfo.php | 65 +++++++++++++++---- .../ORM/Mapping/Driver/AnnotationDriver.php | 29 ++++++++- .../ORM/Mapping/Driver/DatabaseDriver.php | 23 ++++++- lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php | 45 ++++++++++--- .../ORM/Mapping/Driver/YamlDriver.php | 35 ++++++++-- .../Reflection/ReflectionPropertiesGetter.php | 10 ++- lib/Doctrine/ORM/NativeQuery.php | 4 +- lib/Doctrine/ORM/PersistentCollection.php | 6 +- .../Collection/ManyToManyPersister.php | 22 ++++++- .../Entity/BasicEntityPersister.php | 28 ++++++-- .../ORM/Persisters/SqlValueVisitor.php | 4 +- lib/Doctrine/ORM/Proxy/ProxyFactory.php | 4 ++ lib/Doctrine/ORM/Query.php | 44 +++++++------ .../ORM/Query/AST/Functions/TrimFunction.php | 2 +- lib/Doctrine/ORM/Query/Expr/Base.php | 4 +- lib/Doctrine/ORM/Query/Filter/SQLFilter.php | 4 +- lib/Doctrine/ORM/Query/Parser.php | 4 +- lib/Doctrine/ORM/Query/ParserResult.php | 3 +- lib/Doctrine/ORM/Query/ResultSetMapping.php | 18 ++--- .../ORM/Query/ResultSetMappingBuilder.php | 10 +-- lib/Doctrine/ORM/QueryBuilder.php | 13 +++- .../Command/MappingDescribeCommand.php | 20 ++++-- .../ORM/Tools/ConvertDoctrine1Schema.php | 6 +- lib/Doctrine/ORM/Tools/EntityGenerator.php | 7 +- .../ORM/Tools/EntityRepositoryGenerator.php | 2 +- .../ORM/Tools/Export/Driver/PhpExporter.php | 5 ++ .../Pagination/LimitSubqueryOutputWalker.php | 4 +- lib/Doctrine/ORM/Tools/SchemaTool.php | 8 +-- lib/Doctrine/ORM/Tools/SchemaValidator.php | 4 +- .../HierarchyDiscriminatorResolver.php | 4 ++ psalm.xml | 8 +++ 41 files changed, 403 insertions(+), 163 deletions(-) diff --git a/lib/Doctrine/ORM/AbstractQuery.php b/lib/Doctrine/ORM/AbstractQuery.php index 06c68d0dee..98555ed348 100644 --- a/lib/Doctrine/ORM/AbstractQuery.php +++ b/lib/Doctrine/ORM/AbstractQuery.php @@ -240,7 +240,7 @@ public function getLifetime() * * @param integer $lifetime * - * @return \Doctrine\ORM\AbstractQuery This query instance. + * @return static This query instance. */ public function setLifetime($lifetime) { @@ -260,7 +260,7 @@ public function getCacheMode() /** * @param integer $cacheMode * - * @return \Doctrine\ORM\AbstractQuery This query instance. + * @return static This query instance. */ public function setCacheMode($cacheMode) { @@ -1068,7 +1068,7 @@ private function getTimestampKey() * Will return the configured id if it exists otherwise a hash will be * automatically generated for you. * - * @return array ($key, $hash) + * @return array ($key, $hash) */ protected function getHydrationCacheId() { diff --git a/lib/Doctrine/ORM/Cache/DefaultQueryCache.php b/lib/Doctrine/ORM/Cache/DefaultQueryCache.php index 83cc6128f9..b65e934a20 100644 --- a/lib/Doctrine/ORM/Cache/DefaultQueryCache.php +++ b/lib/Doctrine/ORM/Cache/DefaultQueryCache.php @@ -348,7 +348,9 @@ public function put(QueryCacheKey $key, ResultSetMapping $rsm, $result, array $h * @param array $assoc * @param mixed $assocValue * - * @return array|null + * @return mixed[]|null + * + * @psalm-return array{targetEntity: string, type: mixed, list?: array[], identifier?: array}|null */ private function storeAssociationCache(QueryCacheKey $key, array $assoc, $assocValue) { diff --git a/lib/Doctrine/ORM/Event/OnClearEventArgs.php b/lib/Doctrine/ORM/Event/OnClearEventArgs.php index dd827c7256..8c4dd41b20 100644 --- a/lib/Doctrine/ORM/Event/OnClearEventArgs.php +++ b/lib/Doctrine/ORM/Event/OnClearEventArgs.php @@ -38,7 +38,7 @@ class OnClearEventArgs extends \Doctrine\Common\EventArgs private $em; /** - * @var string + * @var string|null */ private $entityClass; diff --git a/lib/Doctrine/ORM/Id/AbstractIdGenerator.php b/lib/Doctrine/ORM/Id/AbstractIdGenerator.php index 9e2e226251..51887b5be7 100644 --- a/lib/Doctrine/ORM/Id/AbstractIdGenerator.php +++ b/lib/Doctrine/ORM/Id/AbstractIdGenerator.php @@ -40,7 +40,7 @@ abstract public function generate(EntityManager $em, $entity); * By default, this method returns FALSE. Generators that have this requirement * must override this method and return TRUE. * - * @return boolean + * @return bool */ public function isPostInsertGenerator() { diff --git a/lib/Doctrine/ORM/Internal/Hydration/AbstractHydrator.php b/lib/Doctrine/ORM/Internal/Hydration/AbstractHydrator.php index 8a9c0f4d7e..7ae2cb2451 100644 --- a/lib/Doctrine/ORM/Internal/Hydration/AbstractHydrator.php +++ b/lib/Doctrine/ORM/Internal/Hydration/AbstractHydrator.php @@ -260,8 +260,19 @@ abstract protected function hydrateAllData(); * @param array &$id Dql-Alias => ID-Hash. * @param array &$nonemptyComponents Does this DQL-Alias has at least one non NULL value? * - * @return array An array with all the fields (name => value) of the data row, - * grouped by their component alias. + * @return array> An array with all the fields + * (name => value) of the data + * row, grouped by their + * component alias. + * + * @psalm-return array{ + * data: array, + * newObjects?: array, + * scalars?: array + * } */ protected function gatherRowData(array $data, array &$id, array &$nonemptyComponents) { diff --git a/lib/Doctrine/ORM/Mapping/Builder/AssociationBuilder.php b/lib/Doctrine/ORM/Mapping/Builder/AssociationBuilder.php index 7f4fddc96b..ff2f3d281c 100644 --- a/lib/Doctrine/ORM/Mapping/Builder/AssociationBuilder.php +++ b/lib/Doctrine/ORM/Mapping/Builder/AssociationBuilder.php @@ -58,7 +58,7 @@ public function __construct(ClassMetadataBuilder $builder, array $mapping, $type /** * @param string $fieldName * - * @return AssociationBuilder + * @return static */ public function mappedBy($fieldName) { @@ -70,7 +70,7 @@ public function mappedBy($fieldName) /** * @param string $fieldName * - * @return AssociationBuilder + * @return static */ public function inversedBy($fieldName) { @@ -80,7 +80,7 @@ public function inversedBy($fieldName) } /** - * @return AssociationBuilder + * @return static */ public function cascadeAll() { @@ -90,7 +90,7 @@ public function cascadeAll() } /** - * @return AssociationBuilder + * @return static */ public function cascadePersist() { @@ -100,7 +100,7 @@ public function cascadePersist() } /** - * @return AssociationBuilder + * @return static */ public function cascadeRemove() { @@ -110,7 +110,7 @@ public function cascadeRemove() } /** - * @return AssociationBuilder + * @return static */ public function cascadeMerge() { @@ -120,7 +120,7 @@ public function cascadeMerge() } /** - * @return AssociationBuilder + * @return static */ public function cascadeDetach() { @@ -130,7 +130,7 @@ public function cascadeDetach() } /** - * @return AssociationBuilder + * @return static */ public function cascadeRefresh() { @@ -140,7 +140,7 @@ public function cascadeRefresh() } /** - * @return AssociationBuilder + * @return static */ public function fetchExtraLazy() { @@ -150,7 +150,7 @@ public function fetchExtraLazy() } /** - * @return AssociationBuilder + * @return static */ public function fetchEager() { @@ -160,7 +160,7 @@ public function fetchEager() } /** - * @return AssociationBuilder + * @return static */ public function fetchLazy() { @@ -179,7 +179,7 @@ public function fetchLazy() * @param string|null $onDelete * @param string|null $columnDef * - * @return AssociationBuilder + * @return static */ public function addJoinColumn($columnName, $referencedColumnName, $nullable = true, $unique = false, $onDelete = null, $columnDef = null) { @@ -198,7 +198,7 @@ public function addJoinColumn($columnName, $referencedColumnName, $nullable = tr /** * Sets field as primary key. * - * @return self + * @return static */ public function makePrimaryKey() { @@ -210,7 +210,7 @@ public function makePrimaryKey() /** * Removes orphan entities when detached from their parent. * - * @return self + * @return static */ public function orphanRemoval() { diff --git a/lib/Doctrine/ORM/Mapping/Builder/ClassMetadataBuilder.php b/lib/Doctrine/ORM/Mapping/Builder/ClassMetadataBuilder.php index c08b374fee..dc7faf4091 100644 --- a/lib/Doctrine/ORM/Mapping/Builder/ClassMetadataBuilder.php +++ b/lib/Doctrine/ORM/Mapping/Builder/ClassMetadataBuilder.php @@ -57,7 +57,7 @@ public function getClassMetadata() /** * Marks the class as mapped superclass. * - * @return ClassMetadataBuilder + * @return static */ public function setMappedSuperClass() { @@ -70,7 +70,7 @@ public function setMappedSuperClass() /** * Marks the class as embeddable. * - * @return ClassMetadataBuilder + * @return static */ public function setEmbeddable() { @@ -107,7 +107,7 @@ public function addEmbedded($fieldName, $class, $columnPrefix = null) * * @param string $repositoryClassName * - * @return ClassMetadataBuilder + * @return static */ public function setCustomRepositoryClass($repositoryClassName) { @@ -119,7 +119,7 @@ public function setCustomRepositoryClass($repositoryClassName) /** * Marks class read only. * - * @return ClassMetadataBuilder + * @return static */ public function setReadOnly() { @@ -133,7 +133,7 @@ public function setReadOnly() * * @param string $name * - * @return ClassMetadataBuilder + * @return static */ public function setTable($name) { @@ -148,7 +148,7 @@ public function setTable($name) * @param array $columns * @param string $name * - * @return ClassMetadataBuilder + * @return static */ public function addIndex(array $columns, $name) { @@ -167,7 +167,7 @@ public function addIndex(array $columns, $name) * @param array $columns * @param string $name * - * @return ClassMetadataBuilder + * @return static */ public function addUniqueConstraint(array $columns, $name) { @@ -186,7 +186,7 @@ public function addUniqueConstraint(array $columns, $name) * @param string $name * @param string $dqlQuery * - * @return ClassMetadataBuilder + * @return static */ public function addNamedQuery($name, $dqlQuery) { @@ -203,7 +203,7 @@ public function addNamedQuery($name, $dqlQuery) /** * Sets class as root of a joined table inheritance hierarchy. * - * @return ClassMetadataBuilder + * @return static */ public function setJoinedTableInheritance() { @@ -215,7 +215,7 @@ public function setJoinedTableInheritance() /** * Sets class as root of a single table inheritance hierarchy. * - * @return ClassMetadataBuilder + * @return static */ public function setSingleTableInheritance() { @@ -231,7 +231,7 @@ public function setSingleTableInheritance() * @param string $type * @param int $length * - * @return ClassMetadataBuilder + * @return static */ public function setDiscriminatorColumn($name, $type = 'string', $length = 255) { @@ -252,7 +252,7 @@ public function setDiscriminatorColumn($name, $type = 'string', $length = 255) * @param string $name * @param string $class * - * @return ClassMetadataBuilder + * @return static */ public function addDiscriminatorMapClass($name, $class) { @@ -264,7 +264,7 @@ public function addDiscriminatorMapClass($name, $class) /** * Sets deferred explicit change tracking policy. * - * @return ClassMetadataBuilder + * @return static */ public function setChangeTrackingPolicyDeferredExplicit() { @@ -276,7 +276,7 @@ public function setChangeTrackingPolicyDeferredExplicit() /** * Sets notify change tracking policy. * - * @return ClassMetadataBuilder + * @return static */ public function setChangeTrackingPolicyNotify() { @@ -291,7 +291,7 @@ public function setChangeTrackingPolicyNotify() * @param string $methodName * @param string $event * - * @return ClassMetadataBuilder + * @return static */ public function addLifecycleEvent($methodName, $event) { @@ -307,7 +307,7 @@ public function addLifecycleEvent($methodName, $event) * @param string $type * @param array $mapping * - * @return ClassMetadataBuilder + * @return static */ public function addField($name, $type, array $mapping = []) { diff --git a/lib/Doctrine/ORM/Mapping/Builder/FieldBuilder.php b/lib/Doctrine/ORM/Mapping/Builder/FieldBuilder.php index d0128d4a93..68ad14430e 100644 --- a/lib/Doctrine/ORM/Mapping/Builder/FieldBuilder.php +++ b/lib/Doctrine/ORM/Mapping/Builder/FieldBuilder.php @@ -74,7 +74,7 @@ public function __construct(ClassMetadataBuilder $builder, array $mapping) * * @param int $length * - * @return FieldBuilder + * @return static */ public function length($length) { @@ -88,7 +88,7 @@ public function length($length) * * @param bool $flag * - * @return FieldBuilder + * @return static */ public function nullable($flag = true) { @@ -102,7 +102,7 @@ public function nullable($flag = true) * * @param bool $flag * - * @return FieldBuilder + * @return static */ public function unique($flag = true) { @@ -116,7 +116,7 @@ public function unique($flag = true) * * @param string $name * - * @return FieldBuilder + * @return static */ public function columnName($name) { @@ -130,7 +130,7 @@ public function columnName($name) * * @param int $p * - * @return FieldBuilder + * @return static */ public function precision($p) { @@ -144,7 +144,7 @@ public function precision($p) * * @param int $s * - * @return FieldBuilder + * @return static */ public function scale($s) { @@ -167,7 +167,7 @@ public function isPrimaryKey() /** * Sets field as primary key. * - * @return FieldBuilder + * @return static */ public function makePrimaryKey() { @@ -182,7 +182,7 @@ public function makePrimaryKey() * @param string $name * @param mixed $value * - * @return FieldBuilder + * @return static */ public function option($name, $value) { @@ -194,7 +194,7 @@ public function option($name, $value) /** * @param string $strategy * - * @return FieldBuilder + * @return static */ public function generatedValue($strategy = 'AUTO') { @@ -206,7 +206,7 @@ public function generatedValue($strategy = 'AUTO') /** * Sets field versioned. * - * @return FieldBuilder + * @return static */ public function isVersionField() { @@ -222,7 +222,7 @@ public function isVersionField() * @param int $allocationSize * @param int $initialValue * - * @return FieldBuilder + * @return static */ public function setSequenceGenerator($sequenceName, $allocationSize = 1, $initialValue = 1) { @@ -240,7 +240,7 @@ public function setSequenceGenerator($sequenceName, $allocationSize = 1, $initia * * @param string $def * - * @return FieldBuilder + * @return static */ public function columnDefinition($def) { diff --git a/lib/Doctrine/ORM/Mapping/Builder/ManyToManyAssociationBuilder.php b/lib/Doctrine/ORM/Mapping/Builder/ManyToManyAssociationBuilder.php index a71859dfd3..dce8c4562f 100644 --- a/lib/Doctrine/ORM/Mapping/Builder/ManyToManyAssociationBuilder.php +++ b/lib/Doctrine/ORM/Mapping/Builder/ManyToManyAssociationBuilder.php @@ -42,7 +42,7 @@ class ManyToManyAssociationBuilder extends OneToManyAssociationBuilder /** * @param string $name * - * @return ManyToManyAssociationBuilder + * @return static */ public function setJoinTable($name) { @@ -61,7 +61,7 @@ public function setJoinTable($name) * @param string|null $onDelete * @param string|null $columnDef * - * @return ManyToManyAssociationBuilder + * @return static */ public function addInverseJoinColumn($columnName, $referencedColumnName, $nullable = true, $unique = false, $onDelete = null, $columnDef = null) { diff --git a/lib/Doctrine/ORM/Mapping/Builder/OneToManyAssociationBuilder.php b/lib/Doctrine/ORM/Mapping/Builder/OneToManyAssociationBuilder.php index 347dfd04d8..a81f65291c 100644 --- a/lib/Doctrine/ORM/Mapping/Builder/OneToManyAssociationBuilder.php +++ b/lib/Doctrine/ORM/Mapping/Builder/OneToManyAssociationBuilder.php @@ -32,7 +32,7 @@ class OneToManyAssociationBuilder extends AssociationBuilder /** * @param array $fieldNames * - * @return OneToManyAssociationBuilder + * @return static */ public function setOrderBy(array $fieldNames) { @@ -44,7 +44,7 @@ public function setOrderBy(array $fieldNames) /** * @param string $fieldName * - * @return OneToManyAssociationBuilder + * @return static */ public function setIndexBy($fieldName) { diff --git a/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php b/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php index b78e2d980c..b53a211f98 100644 --- a/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php +++ b/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php @@ -28,6 +28,7 @@ use Doctrine\Persistence\Mapping\ReflectionService; use InvalidArgumentException; use ReflectionClass; +use ReflectionProperty; use RuntimeException; /** @@ -641,7 +642,7 @@ class ClassMetadataInfo implements ClassMetadata /** * The ReflectionProperty instances of the mapped class. * - * @var \ReflectionProperty[] + * @var ReflectionProperty[] */ public $reflFields = []; @@ -668,7 +669,7 @@ public function __construct($entityName, NamingStrategy $namingStrategy = null) /** * Gets the ReflectionProperties of the mapped class. * - * @return array An array of ReflectionProperty instances. + * @return ReflectionProperty[] An array of ReflectionProperty instances. */ public function getReflectionProperties() { @@ -680,7 +681,7 @@ public function getReflectionProperties() * * @param string $name * - * @return \ReflectionProperty + * @return ReflectionProperty */ public function getReflectionProperty($name) { @@ -690,7 +691,7 @@ public function getReflectionProperty($name) /** * Gets the ReflectionProperty for the single identifier field. * - * @return \ReflectionProperty + * @return ReflectionProperty * * @throws BadMethodCallException If the class has a composite identifier. */ @@ -806,7 +807,7 @@ public function __toString() * - reflClass (ReflectionClass) * - reflFields (ReflectionProperty array) * - * @return array The names of all the fields that should be serialized. + * @return string[] The names of all the fields that should be serialized. */ public function __sleep() { @@ -1097,7 +1098,10 @@ public function enableAssociationCache($fieldName, array $cache) * @param string $fieldName * @param array $cache * - * @return array + * @return mixed[] + * + * @psalm-param array{usage: mixed, region: mixed} $cache + * @psalm-return array{usage: mixed, region: mixed} */ public function getAssociationCacheDefaults($fieldName, array $cache) { @@ -1446,9 +1450,25 @@ protected function _validateAndCompleteFieldMapping(array &$mapping) * * @param array $mapping The mapping. * - * @return array The updated mapping. + * @return mixed[] The updated mapping. * * @throws MappingException If something is wrong with the mapping. + * + * @psalm-return array{ + * mappedBy: mixed, + * inversedBy: mixed, + * isOwningSide: bool, + * sourceEntity: string, + * targetEntity: string, + * fieldName: mixed, + * fetch: mixed, + * cascade: array, + * isCascadeRemove: bool, + * isCascadePersist: bool, + * isCascadeRefresh: bool, + * isCascadeMerge: bool, + * isCascadeDetach: bool + * } */ protected function _validateAndCompleteAssociationMapping(array $mapping) { @@ -1566,10 +1586,12 @@ protected function _validateAndCompleteAssociationMapping(array $mapping) * * @param array $mapping The mapping to validate & complete. * - * @return array The validated & completed mapping. + * @return mixed[] The validated & completed mapping. * * @throws RuntimeException * @throws MappingException + * + * @psalm-return array{isOwningSide: mixed, orphanRemoval: bool, isCascadeRemove: bool} */ protected function _validateAndCompleteOneToOneMapping(array $mapping) { @@ -1657,10 +1679,27 @@ protected function _validateAndCompleteOneToOneMapping(array $mapping) * * @param array $mapping The mapping to validate and complete. * - * @return array The validated and completed mapping. + * @return mixed[] The validated and completed mapping. * * @throws MappingException * @throws InvalidArgumentException + * + * @psalm-return array{ + * mappedBy: mixed, + * inversedBy: mixed, + * isOwningSide: bool, + * sourceEntity: string, + * targetEntity: string, + * fieldName: mixed, + * fetch: int|mixed, + * cascade: array, + * isCascadeRemove: bool, + * isCascadePersist: bool, + * isCascadeRefresh: bool, + * isCascadeMerge: bool, + * isCascadeDetach: bool, + * orphanRemoval: bool + * } */ protected function _validateAndCompleteOneToManyMapping(array $mapping) { @@ -1684,9 +1723,11 @@ protected function _validateAndCompleteOneToManyMapping(array $mapping) * * @param array $mapping The mapping to validate & complete. * - * @return array The validated & completed mapping. + * @return mixed[] The validated & completed mapping. * * @throws \InvalidArgumentException + * + * @psalm-return array{isOwningSide: mixed, orphanRemoval: bool} */ protected function _validateAndCompleteManyToManyMapping(array $mapping) { @@ -1863,7 +1904,9 @@ public function hasField($fieldName) * * @param array|null $fieldNames * - * @return array + * @return mixed[] + * + * @psalm-return list */ public function getColumnNames(array $fieldNames = null) { diff --git a/lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php b/lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php index 6e93c6e03f..d864bf9ea8 100644 --- a/lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php +++ b/lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php @@ -558,7 +558,7 @@ private function getFetchMode($className, $fetchMode) * * @param \ReflectionMethod $method * - * @return array + * @return callable[] */ private function getMethodCallbacks(\ReflectionMethod $method) { @@ -606,7 +606,17 @@ private function getMethodCallbacks(\ReflectionMethod $method) * Parse the given JoinColumn as array * * @param Mapping\JoinColumn $joinColumn - * @return array + * + * @return mixed[] + * + * @psalm-return array{ + * name: string, + * unique: bool, + * nullable: bool, + * onDelete: mixed, + * columnDefinition: string, + * referencedColumnName: string + * } */ private function joinColumnToArray(Mapping\JoinColumn $joinColumn) { @@ -626,7 +636,20 @@ private function joinColumnToArray(Mapping\JoinColumn $joinColumn) * @param string $fieldName * @param Mapping\Column $column * - * @return array + * @return mixed[] + * + * @psalm-return array{ + * fieldName: string, + * type: mixed, + * scale: int, + * length: int, + * unique: bool, + * nullable: bool, + * precision: int, + * options?: mixed[], + * columnName?: string, + * columnDefinition?: string + * } */ private function columnToArray($fieldName, Mapping\Column $column) { diff --git a/lib/Doctrine/ORM/Mapping/Driver/DatabaseDriver.php b/lib/Doctrine/ORM/Mapping/Driver/DatabaseDriver.php index 54eac1ed96..528085a5ab 100644 --- a/lib/Doctrine/ORM/Mapping/Driver/DatabaseDriver.php +++ b/lib/Doctrine/ORM/Mapping/Driver/DatabaseDriver.php @@ -21,6 +21,7 @@ use Doctrine\Common\Inflector\Inflector; use Doctrine\DBAL\Schema\AbstractSchemaManager; +use Doctrine\DBAL\Schema\ForeignKeyConstraint; use Doctrine\DBAL\Schema\SchemaException; use Doctrine\DBAL\Schema\Table; use Doctrine\DBAL\Schema\Column; @@ -388,6 +389,22 @@ private function buildFieldMappings(ClassMetadataInfo $metadata) * @param \Doctrine\DBAL\Schema\Column $column * * @return array + * + * @psalm-return array{ + * fieldName: string, + * columnName: string, + * type: string, + * nullable: bool, + * options?: array{ + * unsigned?: bool, + * fixed?: bool, + * comment?: string, + * default?: string + * }, + * precision?: int, + * scale?: int, + * length?: int|null + * } */ private function buildFieldMapping($tableName, Column $column) { @@ -488,7 +505,9 @@ private function buildToOneAssociationMappings(ClassMetadataInfo $metadata) * * @param \Doctrine\DBAL\Schema\Table $table * - * @return array + * @return ForeignKeyConstraint[] + * + * @psalm-return array */ private function getTableForeignKeys(Table $table) { @@ -502,7 +521,7 @@ private function getTableForeignKeys(Table $table) * * @param \Doctrine\DBAL\Schema\Table $table * - * @return array + * @return string[] */ private function getTablePrimaryKeys(Table $table) { diff --git a/lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php b/lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php index 20066b448e..2c42500356 100644 --- a/lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php +++ b/lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php @@ -671,7 +671,7 @@ public function loadMetadataForClass($className, ClassMetadata $metadata) * * @param SimpleXMLElement $options The XML element. * - * @return array The options array. + * @return mixed[] The options array. */ private function _parseOptions(SimpleXMLElement $options) { @@ -706,7 +706,16 @@ private function _parseOptions(SimpleXMLElement $options) * * @param SimpleXMLElement $joinColumnElement The XML element. * - * @return array The mapping array. + * @return mixed[] The mapping array. + * + * @psalm-return array{ + * name: string, + * referencedColumnName: string, + * unique?: bool, + * nullable?: bool, + * onDelete?: string, + * columnDefinition?: string + * } */ private function joinColumnToArray(SimpleXMLElement $joinColumnElement) { @@ -735,12 +744,24 @@ private function joinColumnToArray(SimpleXMLElement $joinColumnElement) } /** - * Parses the given field as array. - * - * @param SimpleXMLElement $fieldMapping - * - * @return array - */ + * Parses the given field as array. + * + * @return mixed[] + * + * @psalm-return array{ + * fieldName: string, + * type?: string, + * columnName?: string, + * length?: int, + * precision?: int, + * scale?: int, + * unique?: bool, + * nullable?: bool, + * version?: bool, + * columnDefinition?: string, + * options?: array + * } + */ private function columnToArray(SimpleXMLElement $fieldMapping) { $mapping = [ @@ -795,7 +816,9 @@ private function columnToArray(SimpleXMLElement $fieldMapping) * * @param SimpleXMLElement $cacheMapping * - * @return array + * @return mixed[] + * + * @psalm-return array{usage: mixed, region: string|null} */ private function cacheToArray(SimpleXMLElement $cacheMapping) { @@ -821,7 +844,9 @@ private function cacheToArray(SimpleXMLElement $cacheMapping) * * @param SimpleXMLElement $cascadeElement The cascade element. * - * @return array The list of cascade options. + * @return string[] The list of cascade options. + * + * @psalm-return list */ private function _getCascadeMappings(SimpleXMLElement $cascadeElement) { diff --git a/lib/Doctrine/ORM/Mapping/Driver/YamlDriver.php b/lib/Doctrine/ORM/Mapping/Driver/YamlDriver.php index 8c70e979c8..d54c1a224d 100644 --- a/lib/Doctrine/ORM/Mapping/Driver/YamlDriver.php +++ b/lib/Doctrine/ORM/Mapping/Driver/YamlDriver.php @@ -684,7 +684,17 @@ public function loadMetadataForClass($className, ClassMetadata $metadata) * * @param array $joinColumnElement The array join column element. * - * @return array The mapping array. + * @return mixed[] The mapping array. + * + * @psalm-return array{ + * referencedColumnName?: string, + * name?: string, + * fieldName?: string, + * unique?: bool, + * nullable?: bool, + * onDelete?: mixed, + * columnDefinition?: mixed + * } */ private function joinColumnToArray($joinColumnElement) { @@ -726,7 +736,21 @@ private function joinColumnToArray($joinColumnElement) * @param string $fieldName * @param array $column * - * @return array + * @return mixed[] + * + * @psalm-return array{ + * fieldName: string, + * type?: string, + * columnName?: mixed, + * length?: mixed, + * precision?: mixed, + * scale?: mixed, + * unique?: bool, + * options?: mixed, + * nullable?: mixed, + * version?: mixed, + * columnDefinition?: mixed + * } */ private function columnToArray($fieldName, $column) { @@ -787,9 +811,12 @@ private function columnToArray($fieldName, $column) /** * Parse / Normalize the cache configuration * - * @param array $cacheMapping + * @param mixed[] $cacheMapping + * + * @return mixed[] * - * @return array + * @psalm-param array{usage: mixed, region: null|string} $cacheMapping + * @psalm-return array{usage: mixed, region: null|string} */ private function cacheToArray($cacheMapping) { diff --git a/lib/Doctrine/ORM/Mapping/Reflection/ReflectionPropertiesGetter.php b/lib/Doctrine/ORM/Mapping/Reflection/ReflectionPropertiesGetter.php index dbf36fcea3..00d8796f6b 100644 --- a/lib/Doctrine/ORM/Mapping/Reflection/ReflectionPropertiesGetter.php +++ b/lib/Doctrine/ORM/Mapping/Reflection/ReflectionPropertiesGetter.php @@ -79,8 +79,10 @@ public function getProperties($className) * @param string $className * * @return ReflectionClass[] + * + * @psalm-return list */ - private function getHierarchyClasses($className) + private function getHierarchyClasses($className) : array { $classes = []; $parentClassName = $className; @@ -97,13 +99,17 @@ private function getHierarchyClasses($className) return $classes; } + // phpcs:disable SlevomatCodingStandard.Classes.UnusedPrivateElements.UnusedMethod /** * @param ReflectionClass $reflectionClass * * @return ReflectionProperty[] + * + * @psalm-return array */ - private function getClassProperties(ReflectionClass $reflectionClass) + private function getClassProperties(ReflectionClass $reflectionClass) : array { + // phpcs:enable SlevomatCodingStandard.Classes.UnusedPrivateElements.UnusedMethod $properties = $reflectionClass->getProperties(); return array_filter( diff --git a/lib/Doctrine/ORM/NativeQuery.php b/lib/Doctrine/ORM/NativeQuery.php index ddc5418d67..0d65863df7 100644 --- a/lib/Doctrine/ORM/NativeQuery.php +++ b/lib/Doctrine/ORM/NativeQuery.php @@ -37,9 +37,9 @@ final class NativeQuery extends AbstractQuery * * @param string $sql * - * @return NativeQuery This query instance. + * @return self This query instance. */ - public function setSQL($sql) + public function setSQL($sql) : self { $this->_sql = $sql; diff --git a/lib/Doctrine/ORM/PersistentCollection.php b/lib/Doctrine/ORM/PersistentCollection.php index 6cfb341928..2ab54bfaf6 100644 --- a/lib/Doctrine/ORM/PersistentCollection.php +++ b/lib/Doctrine/ORM/PersistentCollection.php @@ -569,9 +569,11 @@ public function clear() * Internal note: Tried to implement Serializable first but that did not work well * with circular references. This solution seems simpler and works well. * - * @return array + * @return string[] + * + * @psalm-return array{0: string, 1: string} */ - public function __sleep() + public function __sleep() : array { return ['collection', 'initialized']; } diff --git a/lib/Doctrine/ORM/Persisters/Collection/ManyToManyPersister.php b/lib/Doctrine/ORM/Persisters/Collection/ManyToManyPersister.php index 208504bfa7..e5f3c6647c 100644 --- a/lib/Doctrine/ORM/Persisters/Collection/ManyToManyPersister.php +++ b/lib/Doctrine/ORM/Persisters/Collection/ManyToManyPersister.php @@ -288,6 +288,8 @@ public function loadCriteria(PersistentCollection $collection, Criteria $criteri * @return string[] ordered tuple: * - JOIN condition to add to the SQL * - WHERE condition to add to the SQL + * + * @psalm-return array{0: string, 1: string} */ public function getFilterSql($mapping) { @@ -335,7 +337,9 @@ protected function generateFilterConditionSQL(ClassMetadata $targetEntity, $targ * * @param array $mapping * - * @return array + * @return string[] + * + * @psalm-return list */ protected function getOnConditionSQL($mapping) { @@ -416,6 +420,8 @@ protected function getDeleteSQLParameters(PersistentCollection $collection) * * @return string[]|string[][] ordered tuple containing the SQL to be executed and an array * of types for bound parameters + * + * @psalm-return array{0: string, 1: list} */ protected function getDeleteRowSQL(PersistentCollection $collection) { @@ -452,6 +458,8 @@ protected function getDeleteRowSQL(PersistentCollection $collection) * @param mixed $element * * @return array + * + * @psalm-return list */ protected function getDeleteRowSQLParameters(PersistentCollection $collection, $element) { @@ -465,6 +473,8 @@ protected function getDeleteRowSQLParameters(PersistentCollection $collection, $ * * @return string[]|string[][] ordered tuple containing the SQL to be executed and an array * of types for bound parameters + * + * @psalm-return array{0: string, 1: list} */ protected function getInsertRowSQL(PersistentCollection $collection) { @@ -503,6 +513,8 @@ protected function getInsertRowSQL(PersistentCollection $collection) * @param mixed $element * * @return array + * + * @psalm-return list */ protected function getInsertRowSQLParameters(PersistentCollection $collection, $element) { @@ -516,7 +528,9 @@ protected function getInsertRowSQLParameters(PersistentCollection $collection, $ * @param \Doctrine\ORM\PersistentCollection $collection * @param object $element * - * @return array + * @return mixed[] + * + * @psalm-return list */ private function collectJoinTableColumnParameters(PersistentCollection $collection, $element) { @@ -564,6 +578,8 @@ private function collectJoinTableColumnParameters(PersistentCollection $collecti * - where clauses to be added for filtering * - parameters to be bound for filtering * - types of the parameters to be bound for filtering + * + * @psalm-return array{0: string, 1: list, 2: list, 3: list} */ private function getJoinTableRestrictionsWithKey(PersistentCollection $collection, $key, $addFilters) { @@ -649,6 +665,8 @@ private function getJoinTableRestrictionsWithKey(PersistentCollection $collectio * - where clauses to be added for filtering * - parameters to be bound for filtering * - types of the parameters to be bound for filtering + * + * @psalm-return array{0: string, 1: list, 2: list, 3: list} */ private function getJoinTableRestrictions(PersistentCollection $collection, $element, $addFilters) { diff --git a/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php b/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php index caa91f55b6..4de961de95 100644 --- a/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php +++ b/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php @@ -360,6 +360,11 @@ protected function fetchVersionValue($versionedClass, array $id) return Type::getType($fieldMapping['type'])->convertToPHPValue($value, $this->platform); } + /** + * @return Type[] + * + * @psalm-return list + */ private function extractIdentifierTypes(array $id, ClassMetadata $versionedClass) : array { $types = []; @@ -601,7 +606,9 @@ public function delete($entity) * * @param object $entity The entity for which to prepare the data. * - * @return array The prepared data. + * @return mixed[][] The prepared data. + * + * @psalm-return array> */ protected function prepareUpdateData($entity) { @@ -688,9 +695,11 @@ protected function prepareUpdateData($entity) * * @param object $entity The entity for which to prepare the data. * - * @return array The prepared data for the tables to update. + * @return mixed[][] The prepared data for the tables to update. * * @see prepareUpdateData + * + * @psalm-return array */ protected function prepareInsertData($entity) { @@ -1133,7 +1142,7 @@ public function getCountSQL($criteria = []) * * @throws \Doctrine\ORM\ORMException */ - protected final function getOrderBySQL(array $orderBy, $baseTableAlias) + final protected function getOrderBySQL(array $orderBy, $baseTableAlias) : string { $orderByList = []; @@ -1418,7 +1427,9 @@ public function getInsertSQL() * Subclasses should override this method to alter or change the list of * columns placed in the INSERT statements used by the persister. * - * @return array The list of columns. + * @return string[] The list of columns. + * + * @psalm-return list */ protected function getInsertColumnList() { @@ -1655,6 +1666,8 @@ public function getSelectConditionStatementSQL($field, $value, $assoc = null, $c * @return string[] * * @throws \Doctrine\ORM\ORMException + * + * @psalm-return list */ private function getSelectConditionStatementColumnSQL($field, $assoc = null) { @@ -1846,8 +1859,9 @@ public function expandParameters($criteria) * - value to be bound * - class to which the field belongs to * + * @return mixed[][] * - * @return array + * @psalm-return array{0: array, 1: list} */ private function expandToManyParameters($criteria) { @@ -1873,9 +1887,11 @@ private function expandToManyParameters($criteria) * @param mixed $value * @param ClassMetadata $class * - * @return array + * @return Type[] * * @throws \Doctrine\ORM\Query\QueryException + * + * @psalm-return list */ private function getTypes($field, $value, ClassMetadata $class) { diff --git a/lib/Doctrine/ORM/Persisters/SqlValueVisitor.php b/lib/Doctrine/ORM/Persisters/SqlValueVisitor.php index a5df126c4d..560ea93221 100644 --- a/lib/Doctrine/ORM/Persisters/SqlValueVisitor.php +++ b/lib/Doctrine/ORM/Persisters/SqlValueVisitor.php @@ -93,7 +93,9 @@ public function walkValue(Value $value) /** * Returns the Parameters and Types necessary for matching the last visited expression. * - * @return array + * @return mixed[][] + * + * @psalm-return array{0: array, 1: array} */ public function getParamsAndTypes() { diff --git a/lib/Doctrine/ORM/Proxy/ProxyFactory.php b/lib/Doctrine/ORM/Proxy/ProxyFactory.php index 8cdce2f763..ddeadb4e94 100644 --- a/lib/Doctrine/ORM/Proxy/ProxyFactory.php +++ b/lib/Doctrine/ORM/Proxy/ProxyFactory.php @@ -122,6 +122,8 @@ protected function createProxyDefinition($className) * @return \Closure * * @throws \Doctrine\ORM\EntityNotFoundException + * + * @psalm-return \Closure(BaseProxy):void */ private function createInitializer(ClassMetadata $classMetadata, EntityPersister $entityPersister) { @@ -173,6 +175,8 @@ private function createInitializer(ClassMetadata $classMetadata, EntityPersister * @return \Closure * * @throws \Doctrine\ORM\EntityNotFoundException + * + * @psalm-return \Closure(BaseProxy):void */ private function createCloner(ClassMetadata $classMetadata, EntityPersister $entityPersister) { diff --git a/lib/Doctrine/ORM/Query.php b/lib/Doctrine/ORM/Query.php index 1264997657..f13d930628 100644 --- a/lib/Doctrine/ORM/Query.php +++ b/lib/Doctrine/ORM/Query.php @@ -380,11 +380,13 @@ private function evictEntityCacheRegion() * * @param array $paramMappings * - * @return array + * @return mixed[][] * * @throws Query\QueryException + * + * @psalm-return array{0: list, 1: array} */ - private function processParameterMappings($paramMappings) + private function processParameterMappings($paramMappings) : array { $sqlParams = []; $types = []; @@ -429,7 +431,11 @@ private function processParameterMappings($paramMappings) return [$sqlParams, $types]; } - /** @return mixed[] tuple of (value, type) */ + /** + * @return mixed[] tuple of (value, type) + * + * @psalm-return array{0: mixed, 1: mixed} + */ private function resolveParameterValue(Parameter $parameter) : array { if ($parameter->typeWasSpecified()) { @@ -466,9 +472,9 @@ private function resolveParameterValue(Parameter $parameter) : array * * @param \Doctrine\Common\Cache\Cache|null $queryCache Cache driver. * - * @return Query This query instance. + * @return self This query instance. */ - public function setQueryCacheDriver($queryCache) + public function setQueryCacheDriver($queryCache) : self { $this->_queryCache = $queryCache; @@ -480,9 +486,9 @@ public function setQueryCacheDriver($queryCache) * * @param boolean $bool * - * @return Query This query instance. + * @return self This query instance. */ - public function useQueryCache($bool) + public function useQueryCache($bool) : self { $this->_useQueryCache = $bool; @@ -509,9 +515,9 @@ public function getQueryCacheDriver() * * @param integer $timeToLive How long the cache entry is valid. * - * @return Query This query instance. + * @return self This query instance. */ - public function setQueryCacheLifetime($timeToLive) + public function setQueryCacheLifetime($timeToLive) : self { if ($timeToLive !== null) { $timeToLive = (int) $timeToLive; @@ -537,9 +543,9 @@ public function getQueryCacheLifetime() * * @param boolean $expire Whether or not to force query cache expiration. * - * @return Query This query instance. + * @return self This query instance. */ - public function expireQueryCache($expire = true) + public function expireQueryCache($expire = true) : self { $this->_expireQueryCache = $expire; @@ -571,10 +577,8 @@ public function free() * Sets a DQL query string. * * @param string $dqlQuery DQL Query. - * - * @return \Doctrine\ORM\AbstractQuery */ - public function setDQL($dqlQuery) + public function setDQL($dqlQuery) : self { if ($dqlQuery !== null) { $this->_dql = $dqlQuery; @@ -626,9 +630,9 @@ public function contains($dql) * * @param int|null $firstResult The first result to return. * - * @return Query This query object. + * @return self This query object. */ - public function setFirstResult($firstResult) + public function setFirstResult($firstResult) : self { $this->_firstResult = $firstResult; $this->_state = self::STATE_DIRTY; @@ -652,9 +656,9 @@ public function getFirstResult() * * @param integer|null $maxResults * - * @return Query This query object. + * @return self This query object. */ - public function setMaxResults($maxResults) + public function setMaxResults($maxResults) : self { $this->_maxResults = $maxResults; $this->_state = self::STATE_DIRTY; @@ -716,11 +720,9 @@ public function setHydrationMode($hydrationMode) * * @param int $lockMode * - * @return Query - * * @throws TransactionRequiredException */ - public function setLockMode($lockMode) + public function setLockMode($lockMode) : self { if (in_array($lockMode, [LockMode::NONE, LockMode::PESSIMISTIC_READ, LockMode::PESSIMISTIC_WRITE], true)) { if ( ! $this->_em->getConnection()->isTransactionActive()) { diff --git a/lib/Doctrine/ORM/Query/AST/Functions/TrimFunction.php b/lib/Doctrine/ORM/Query/AST/Functions/TrimFunction.php index 9e748c308f..f26616ed86 100644 --- a/lib/Doctrine/ORM/Query/AST/Functions/TrimFunction.php +++ b/lib/Doctrine/ORM/Query/AST/Functions/TrimFunction.php @@ -105,7 +105,7 @@ public function parse(Parser $parser) } /** - * @return integer + * @return int */ private function getTrimMode() { diff --git a/lib/Doctrine/ORM/Query/Expr/Base.php b/lib/Doctrine/ORM/Query/Expr/Base.php index d4b8d3871f..7ac660e5a9 100644 --- a/lib/Doctrine/ORM/Query/Expr/Base.php +++ b/lib/Doctrine/ORM/Query/Expr/Base.php @@ -66,7 +66,7 @@ public function __construct($args = []) /** * @param array $args * - * @return Base + * @return static */ public function addMultiple($args = []) { @@ -80,7 +80,7 @@ public function addMultiple($args = []) /** * @param mixed $arg * - * @return Base + * @return static * * @throws \InvalidArgumentException */ diff --git a/lib/Doctrine/ORM/Query/Filter/SQLFilter.php b/lib/Doctrine/ORM/Query/Filter/SQLFilter.php index c48edd43fa..c12a7cb215 100644 --- a/lib/Doctrine/ORM/Query/Filter/SQLFilter.php +++ b/lib/Doctrine/ORM/Query/Filter/SQLFilter.php @@ -67,9 +67,9 @@ final public function __construct(EntityManagerInterface $em) * the type conversion of this type. This is usually not needed for * strings and numeric types. * - * @return SQLFilter The current SQL filter. + * @return self The current SQL filter. */ - final public function setParameter($name, $value, $type = null) + final public function setParameter($name, $value, $type = null) : self { if (null === $type) { $type = ParameterTypeInferer::inferType($value); diff --git a/lib/Doctrine/ORM/Query/Parser.php b/lib/Doctrine/ORM/Query/Parser.php index c3de92a124..b20abb1183 100644 --- a/lib/Doctrine/ORM/Query/Parser.php +++ b/lib/Doctrine/ORM/Query/Parser.php @@ -2689,7 +2689,7 @@ public function Literal() /** * InParameter ::= Literal | InputParameter * - * @return string | \Doctrine\ORM\Query\AST\InputParameter + * @return AST\InputParameter|AST\Literal */ public function InParameter() { @@ -2964,7 +2964,7 @@ public function EntityExpression() /** * SimpleEntityExpression ::= IdentificationVariable | InputParameter * - * @return string | \Doctrine\ORM\Query\AST\InputParameter + * @return AST\InputParameter|AST\PathExpression */ public function SimpleEntityExpression() { diff --git a/lib/Doctrine/ORM/Query/ParserResult.php b/lib/Doctrine/ORM/Query/ParserResult.php index 84ad17822b..4a4d0184e9 100644 --- a/lib/Doctrine/ORM/Query/ParserResult.php +++ b/lib/Doctrine/ORM/Query/ParserResult.php @@ -65,8 +65,7 @@ public function __construct() /** * Gets the ResultSetMapping for the parsed query. * - * @return ResultSetMapping|null The result set mapping of the parsed query or NULL - * if the query is not a SELECT query. + * @return ResultSetMapping The result set mapping of the parsed query */ public function getResultSetMapping() { diff --git a/lib/Doctrine/ORM/Query/ResultSetMapping.php b/lib/Doctrine/ORM/Query/ResultSetMapping.php index 640b8e65ca..477678c2ed 100644 --- a/lib/Doctrine/ORM/Query/ResultSetMapping.php +++ b/lib/Doctrine/ORM/Query/ResultSetMapping.php @@ -184,7 +184,7 @@ class ResultSetMapping * @param string|null $resultAlias The result alias with which the entity result should be * placed in the result structure. * - * @return ResultSetMapping This ResultSetMapping instance. + * @return static This ResultSetMapping instance. * * @todo Rename: addRootEntity */ @@ -209,7 +209,7 @@ public function addEntityResult($class, $alias, $resultAlias = null) * column should be used for. * @param string $discrColumn The name of the discriminator column in the SQL result set. * - * @return ResultSetMapping This ResultSetMapping instance. + * @return static This ResultSetMapping instance. * * @todo Rename: addDiscriminatorColumn */ @@ -227,7 +227,7 @@ public function setDiscriminatorColumn($alias, $discrColumn) * @param string $alias The alias of an entity result or joined entity result. * @param string $fieldName The name of the field to use for indexing. * - * @return ResultSetMapping This ResultSetMapping instance. + * @return static This ResultSetMapping instance. */ public function addIndexBy($alias, $fieldName) { @@ -262,7 +262,7 @@ public function addIndexBy($alias, $fieldName) * * @param string $resultColumnName * - * @return ResultSetMapping This ResultSetMapping instance. + * @return static This ResultSetMapping instance. */ public function addIndexByScalar($resultColumnName) { @@ -277,7 +277,7 @@ public function addIndexByScalar($resultColumnName) * @param string $alias * @param string $resultColumnName * - * @return ResultSetMapping This ResultSetMapping instance. + * @return static This ResultSetMapping instance. */ public function addIndexByColumn($alias, $resultColumnName) { @@ -328,7 +328,7 @@ public function isFieldResult($columnName) * If not specified, the field is assumed to belong to the class * designated by $alias. * - * @return ResultSetMapping This ResultSetMapping instance. + * @return static This ResultSetMapping instance. * * @todo Rename: addField */ @@ -357,7 +357,7 @@ public function addFieldResult($alias, $columnName, $fieldName, $declaringClass * @param string $relation The association field that connects the parent entity result * with the joined entity result. * - * @return ResultSetMapping This ResultSetMapping instance. + * @return static This ResultSetMapping instance. * * @todo Rename: addJoinedEntity */ @@ -377,7 +377,7 @@ public function addJoinedEntityResult($class, $alias, $parentAlias, $relation) * @param string $alias The result alias with which the scalar result should be placed in the result structure. * @param string $type The column type * - * @return ResultSetMapping This ResultSetMapping instance. + * @return static This ResultSetMapping instance. * * @todo Rename: addScalar */ @@ -564,7 +564,7 @@ public function isMixedResult() * @param bool $isIdentifierColumn * @param string $type The column type * - * @return ResultSetMapping This ResultSetMapping instance. + * @return static This ResultSetMapping instance. * * @todo Make all methods of this class require all parameters and not infer anything */ diff --git a/lib/Doctrine/ORM/Query/ResultSetMappingBuilder.php b/lib/Doctrine/ORM/Query/ResultSetMappingBuilder.php index 0bf11814b9..8281dfd400 100644 --- a/lib/Doctrine/ORM/Query/ResultSetMappingBuilder.php +++ b/lib/Doctrine/ORM/Query/ResultSetMappingBuilder.php @@ -223,7 +223,9 @@ private function getColumnAlias($columnName, $mode, array $customRenameColumns) * @param int $mode * @param array $customRenameColumns * - * @return array + * @return string[] + * + * @psalm-return array */ private function getColumnAliasMap($className, $mode, array $customRenameColumns) { @@ -273,7 +275,7 @@ public function addNamedNativeQueryMapping(ClassMetadataInfo $class, array $quer * @param ClassMetadataInfo $class * @param string $resultClassName * - * @return ResultSetMappingBuilder + * @return self */ public function addNamedNativeQueryResultClassMapping(ClassMetadataInfo $class, $resultClassName) { @@ -318,7 +320,7 @@ public function addNamedNativeQueryResultClassMapping(ClassMetadataInfo $class, * @param ClassMetadataInfo $class * @param string $resultSetMappingName * - * @return ResultSetMappingBuilder + * @return self */ public function addNamedNativeQueryResultSetMapping(ClassMetadataInfo $class, $resultSetMappingName) { @@ -370,7 +372,7 @@ public function addNamedNativeQueryResultSetMapping(ClassMetadataInfo $class, $r * @param array $entityMapping * @param string $alias * - * @return ResultSetMappingBuilder + * @return self * * @throws MappingException * @throws \InvalidArgumentException diff --git a/lib/Doctrine/ORM/QueryBuilder.php b/lib/Doctrine/ORM/QueryBuilder.php index 18efdf9a0f..32f47db474 100644 --- a/lib/Doctrine/ORM/QueryBuilder.php +++ b/lib/Doctrine/ORM/QueryBuilder.php @@ -440,7 +440,9 @@ public function getRootAlias() * $qb->getRootAliases(); // array('u') * * - * @return array + * @return mixed[] + * + * @psalm-return list */ public function getRootAliases() { @@ -473,7 +475,10 @@ public function getRootAliases() * * $qb->getAllAliases(); // array('u','a') * - * @return array + * + * @return mixed[] + * + * @psalm-return list */ public function getAllAliases() { @@ -492,7 +497,9 @@ public function getAllAliases() * $qb->getRootEntities(); // array('User') * * - * @return array + * @return mixed[] + * + * @psalm-return list */ public function getRootEntities() { diff --git a/lib/Doctrine/ORM/Tools/Console/Command/MappingDescribeCommand.php b/lib/Doctrine/ORM/Tools/Console/Command/MappingDescribeCommand.php index 4c71789082..97c6b7eae7 100644 --- a/lib/Doctrine/ORM/Tools/Console/Command/MappingDescribeCommand.php +++ b/lib/Doctrine/ORM/Tools/Console/Command/MappingDescribeCommand.php @@ -135,7 +135,7 @@ private function displayEntity($entityName, EntityManagerInterface $entityManage * * @return string[] */ - private function getMappedEntities(EntityManagerInterface $entityManager) + private function getMappedEntities(EntityManagerInterface $entityManager) : array { $entityClassNames = $entityManager->getConfiguration() ->getMetadataDriverImpl() @@ -237,9 +237,11 @@ private function formatValue($value) * @param string $label Label for the value * @param mixed $value A Value to show * - * @return array + * @return string[] + * + * @psalm-return array{0: string, 1: string} */ - private function formatField($label, $value) + private function formatField($label, $value) : array { if (null === $value) { $value = 'None'; @@ -253,9 +255,11 @@ private function formatField($label, $value) * * @param array $propertyMappings * - * @return array + * @return string[][] + * + * @psalm-return list */ - private function formatMappings(array $propertyMappings) + private function formatMappings(array $propertyMappings) : array { $output = []; @@ -275,9 +279,11 @@ private function formatMappings(array $propertyMappings) * * @param array $entityListeners * - * @return array + * @return string[] + * + * @psalm-return array{0: string, 1: string} */ - private function formatEntityListeners(array $entityListeners) + private function formatEntityListeners(array $entityListeners) : array { return $this->formatField('Entity listeners', array_map('get_class', $entityListeners)); } diff --git a/lib/Doctrine/ORM/Tools/ConvertDoctrine1Schema.php b/lib/Doctrine/ORM/Tools/ConvertDoctrine1Schema.php index 41a103df4e..91a4e78f07 100644 --- a/lib/Doctrine/ORM/Tools/ConvertDoctrine1Schema.php +++ b/lib/Doctrine/ORM/Tools/ConvertDoctrine1Schema.php @@ -68,7 +68,9 @@ public function __construct($from) * Gets an array of ClassMetadataInfo instances from the passed * Doctrine 1 schema. * - * @return array An array of ClassMetadataInfo instances + * @return ClassMetadataInfo[] An array of ClassMetadataInfo instances + * + * @psalm-return list */ public function getMetadata() { @@ -170,7 +172,7 @@ private function convertColumns($className, array $model, ClassMetadataInfo $met * @param string|array $column * @param ClassMetadataInfo $metadata * - * @return array + * @return mixed[] * * @throws ToolsException */ diff --git a/lib/Doctrine/ORM/Tools/EntityGenerator.php b/lib/Doctrine/ORM/Tools/EntityGenerator.php index 6dbbe60613..d7683f4e69 100644 --- a/lib/Doctrine/ORM/Tools/EntityGenerator.php +++ b/lib/Doctrine/ORM/Tools/EntityGenerator.php @@ -23,6 +23,7 @@ use Doctrine\Common\Inflector\Inflector; use Doctrine\DBAL\Types\Type; use Doctrine\ORM\Mapping\ClassMetadataInfo; +use ReflectionClass; use const E_USER_DEPRECATED; use function str_replace; use function trigger_error; @@ -920,9 +921,11 @@ protected function hasMethod($method, ClassMetadataInfo $metadata) /** * @param ClassMetadataInfo $metadata * - * @return array + * @return ReflectionClass[] * * @throws \ReflectionException + * + * @psalm-return array */ protected function getTraits(ClassMetadataInfo $metadata) { @@ -1153,7 +1156,7 @@ protected function generateDiscriminatorColumnAnnotation(ClassMetadataInfo $meta /** * @param ClassMetadataInfo $metadata * - * @return string + * @return string|null */ protected function generateDiscriminatorMapAnnotation(ClassMetadataInfo $metadata) { diff --git a/lib/Doctrine/ORM/Tools/EntityRepositoryGenerator.php b/lib/Doctrine/ORM/Tools/EntityRepositoryGenerator.php index 9b3b290ac7..753ca550c1 100644 --- a/lib/Doctrine/ORM/Tools/EntityRepositoryGenerator.php +++ b/lib/Doctrine/ORM/Tools/EntityRepositoryGenerator.php @@ -170,7 +170,7 @@ public function writeEntityRepositoryClass($fullClassName, $outputDirectory) /** * @param string $repositoryName * - * @return \Doctrine\ORM\Tools\EntityRepositoryGenerator + * @return self */ public function setDefaultRepositoryName($repositoryName) { diff --git a/lib/Doctrine/ORM/Tools/Export/Driver/PhpExporter.php b/lib/Doctrine/ORM/Tools/Export/Driver/PhpExporter.php index c0cd1767bc..90c75dc969 100644 --- a/lib/Doctrine/ORM/Tools/Export/Driver/PhpExporter.php +++ b/lib/Doctrine/ORM/Tools/Export/Driver/PhpExporter.php @@ -182,6 +182,11 @@ protected function _varExport($var) return $export; } + /** + * @return string[] + * + * @psalm-return list + */ private function processEntityListeners(ClassMetadataInfo $metadata) : array { $lines = []; diff --git a/lib/Doctrine/ORM/Tools/Pagination/LimitSubqueryOutputWalker.php b/lib/Doctrine/ORM/Tools/Pagination/LimitSubqueryOutputWalker.php index 034b33b2c1..5f00fdce88 100644 --- a/lib/Doctrine/ORM/Tools/Pagination/LimitSubqueryOutputWalker.php +++ b/lib/Doctrine/ORM/Tools/Pagination/LimitSubqueryOutputWalker.php @@ -521,7 +521,9 @@ private function getInnerSQL(SelectStatement $AST) /** * @param SelectStatement $AST * - * @return array + * @return array-key[] + * + * @psalm-return array */ private function getSQLIdentifier(SelectStatement $AST) { diff --git a/lib/Doctrine/ORM/Tools/SchemaTool.php b/lib/Doctrine/ORM/Tools/SchemaTool.php index 4c46e329a8..57f45fabe1 100644 --- a/lib/Doctrine/ORM/Tools/SchemaTool.php +++ b/lib/Doctrine/ORM/Tools/SchemaTool.php @@ -107,7 +107,7 @@ public function createSchema(array $classes) * * @param array $classes * - * @return array The SQL statements needed to create the schema for the classes. + * @return string[] The SQL statements needed to create the schema for the classes. */ public function getCreateSchemaSql(array $classes) { @@ -794,7 +794,7 @@ public function dropDatabase() /** * Gets the SQL needed to drop the database schema for the connections database. * - * @return array + * @return string[] */ public function getDropDatabaseSQL() { @@ -812,7 +812,7 @@ public function getDropDatabaseSQL() * * @param array $classes * - * @return array + * @return string[] */ public function getDropSchemaSQL(array $classes) { @@ -888,7 +888,7 @@ public function updateSchema(array $classes, $saveMode = false) * @param boolean $saveMode If TRUE, only generates SQL for a partial update * that does not include SQL for dropping assets which are scheduled for deletion. * - * @return array The sequence of SQL statements. + * @return string[] The sequence of SQL statements. */ public function getUpdateSchemaSql(array $classes, $saveMode = false) { diff --git a/lib/Doctrine/ORM/Tools/SchemaValidator.php b/lib/Doctrine/ORM/Tools/SchemaValidator.php index 6446598b8d..df4138d5ab 100644 --- a/lib/Doctrine/ORM/Tools/SchemaValidator.php +++ b/lib/Doctrine/ORM/Tools/SchemaValidator.php @@ -81,7 +81,9 @@ public function validateMapping() * * @param ClassMetadataInfo $class * - * @return array + * @return string[] + * + * @psalm-return list */ public function validateClass(ClassMetadataInfo $class) { diff --git a/lib/Doctrine/ORM/Utility/HierarchyDiscriminatorResolver.php b/lib/Doctrine/ORM/Utility/HierarchyDiscriminatorResolver.php index 3474770c2e..abb54d7549 100644 --- a/lib/Doctrine/ORM/Utility/HierarchyDiscriminatorResolver.php +++ b/lib/Doctrine/ORM/Utility/HierarchyDiscriminatorResolver.php @@ -18,6 +18,10 @@ private function __construct() /** * This method is needed to make INSTANCEOF work correctly with inheritance: if the class at hand has inheritance, * it extracts all the discriminators from the child classes and returns them + * + * @return null[] + * + * @psalm-return array */ public static function resolveDiscriminatorsForClass( ClassMetadata $rootClassMetadata, diff --git a/psalm.xml b/psalm.xml index f36f7d1117..2c61242af8 100644 --- a/psalm.xml +++ b/psalm.xml @@ -12,4 +12,12 @@ + + + + + + + + From 75fe18ea5f56caeda2f34f9677bac13fe2dc2a98 Mon Sep 17 00:00:00 2001 From: Igor Pellegrini Date: Sun, 5 Jul 2020 20:24:08 +0200 Subject: [PATCH 096/136] Add alert to "avoid persisting detached entities" (#8109) The alert is hidden into the code of ``EntityManager``, while it's useful to be mentioned in the documentation. --- docs/en/reference/working-with-objects.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/en/reference/working-with-objects.rst b/docs/en/reference/working-with-objects.rst index 2218befe4d..1e75d4a57c 100644 --- a/docs/en/reference/working-with-objects.rst +++ b/docs/en/reference/working-with-objects.rst @@ -250,6 +250,12 @@ as follows: - If X is a detached entity, an exception will be thrown on flush. +.. caution:: + + Do not pass detached entities to the persist operation. The persist operation always + considers entities that are not yet known to the ``EntityManager`` as new entities + (refer to the ``STATE_NEW`` constant inside the ``UnitOfWork``). + Removing entities ----------------- From 3689b76a86b7844f8d44158acd739fe62623e7c5 Mon Sep 17 00:00:00 2001 From: tom93 Date: Mon, 6 Jul 2020 07:46:48 +1200 Subject: [PATCH 097/136] Fix QueryBuilder::getParameter() on parameter names with colons (#8107) * Fix type errors (partially cherry picked from commit 17e7c2a42e0ee49781e60d6facdd2efc9e1f86b3) * Fix QueryBuilder::getParameter() on parameter names with colons Fixes #8106. Co-authored-by: Michael Moravec --- lib/Doctrine/ORM/AbstractQuery.php | 4 +- lib/Doctrine/ORM/Query/Parameter.php | 14 ++++- lib/Doctrine/ORM/QueryBuilder.php | 4 +- .../ORM/Functional/Ticket/GH8106Test.php | 54 +++++++++++++++++++ 4 files changed, 73 insertions(+), 3 deletions(-) create mode 100644 tests/Doctrine/Tests/ORM/Functional/Ticket/GH8106Test.php diff --git a/lib/Doctrine/ORM/AbstractQuery.php b/lib/Doctrine/ORM/AbstractQuery.php index 98555ed348..0646fa3f6d 100644 --- a/lib/Doctrine/ORM/AbstractQuery.php +++ b/lib/Doctrine/ORM/AbstractQuery.php @@ -321,11 +321,13 @@ public function getParameters() */ public function getParameter($key) { + $key = Query\Parameter::normalizeName($key); + $filteredParameters = $this->parameters->filter( function (Query\Parameter $parameter) use ($key) : bool { $parameterName = $parameter->getName(); - return $key === $parameterName || (string) $key === (string) $parameterName; + return $key === $parameterName; } ); diff --git a/lib/Doctrine/ORM/Query/Parameter.php b/lib/Doctrine/ORM/Query/Parameter.php index 6e968a1a9a..4ef0f8e432 100644 --- a/lib/Doctrine/ORM/Query/Parameter.php +++ b/lib/Doctrine/ORM/Query/Parameter.php @@ -30,6 +30,18 @@ */ class Parameter { + /** + * Returns the internal representation of a parameter name. + * + * @param string|int $name The parameter name or position. + * + * @return string The normalized parameter name. + */ + public static function normalizeName($name) + { + return trim((string) $name, ':'); + } + /** * The parameter name. * @@ -67,7 +79,7 @@ class Parameter */ public function __construct($name, $value, $type = null) { - $this->name = trim($name, ':'); + $this->name = self::normalizeName($name); $this->typeSpecified = $type !== null; $this->setValue($value, $type); diff --git a/lib/Doctrine/ORM/QueryBuilder.php b/lib/Doctrine/ORM/QueryBuilder.php index 32f47db474..87dd5091fb 100644 --- a/lib/Doctrine/ORM/QueryBuilder.php +++ b/lib/Doctrine/ORM/QueryBuilder.php @@ -609,11 +609,13 @@ public function getParameters() */ public function getParameter($key) { + $key = Query\Parameter::normalizeName($key); + $filteredParameters = $this->parameters->filter( function (Query\Parameter $parameter) use ($key) : bool { $parameterName = $parameter->getName(); - return $key === $parameterName || (string) $key === (string) $parameterName; + return $key === $parameterName; } ); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/GH8106Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/GH8106Test.php new file mode 100644 index 0000000000..0645a1c859 --- /dev/null +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/GH8106Test.php @@ -0,0 +1,54 @@ +_schemaTool->createSchema( + [ + $this->_em->getClassMetadata(GH8106User::class), + ] + ); + } + + public function testIssue() : void + { + $user = new GH8106User(); + $this->_em->persist($user); + $this->_em->flush(); + $this->_em->clear(); + + $qb = $this->_em->createQueryBuilder(); + $qb + ->select('u') + ->from(GH8106User::class, 'u') + ->where('u.id = :id') + ->setParameter(':id', 1) + ->setParameter(':id', 1); + + $result = $qb->getQuery()->getResult(); // should not throw QueryException + + self::assertCount(1, $result); + } +} + +/** @Entity */ +class GH8106User +{ + /** @Id @Column(type="integer") @GeneratedValue */ + public $id; +} From 181114f2c7a065c6a6402b5eb1302cce56157bf0 Mon Sep 17 00:00:00 2001 From: Benjamin Eberlei Date: Sun, 5 Jul 2020 21:51:35 +0200 Subject: [PATCH 098/136] [GH-8106] Move test into existing QueryTest testcase to reduce surface. --- .../ORM/Functional/Ticket/GH8106Test.php | 54 ------------------- tests/Doctrine/Tests/ORM/Query/QueryTest.php | 15 ++++++ 2 files changed, 15 insertions(+), 54 deletions(-) delete mode 100644 tests/Doctrine/Tests/ORM/Functional/Ticket/GH8106Test.php diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/GH8106Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/GH8106Test.php deleted file mode 100644 index 0645a1c859..0000000000 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/GH8106Test.php +++ /dev/null @@ -1,54 +0,0 @@ -_schemaTool->createSchema( - [ - $this->_em->getClassMetadata(GH8106User::class), - ] - ); - } - - public function testIssue() : void - { - $user = new GH8106User(); - $this->_em->persist($user); - $this->_em->flush(); - $this->_em->clear(); - - $qb = $this->_em->createQueryBuilder(); - $qb - ->select('u') - ->from(GH8106User::class, 'u') - ->where('u.id = :id') - ->setParameter(':id', 1) - ->setParameter(':id', 1); - - $result = $qb->getQuery()->getResult(); // should not throw QueryException - - self::assertCount(1, $result); - } -} - -/** @Entity */ -class GH8106User -{ - /** @Id @Column(type="integer") @GeneratedValue */ - public $id; -} diff --git a/tests/Doctrine/Tests/ORM/Query/QueryTest.php b/tests/Doctrine/Tests/ORM/Query/QueryTest.php index 5ac6eef904..57492eb80f 100644 --- a/tests/Doctrine/Tests/ORM/Query/QueryTest.php +++ b/tests/Doctrine/Tests/ORM/Query/QueryTest.php @@ -429,4 +429,19 @@ public function testNonExistentExecutor() $query = $this->_em->createQuery('0')->execute(); } + + /** + * @group 8106 + */ + public function testGetParameterColonNormalize() : void + { + $query = $this->_em->createQuery('select u from ' . CmsUser::class . ' u where u.name = :name'); + + $query->setParameter(':name', 'Benjamin'); + $query->setParameter('name', 'Benjamin'); + + self::assertCount(1, $query->getParameters()); + self::assertSame('Benjamin', $query->getParameter(':name')->getValue()); + self::assertSame('Benjamin', $query->getParameter('name')->getValue()); + } } From 190218b26762aff38792d56d36065540e8a97e8c Mon Sep 17 00:00:00 2001 From: orklah Date: Tue, 7 Jul 2020 22:02:34 +0200 Subject: [PATCH 099/136] Change list() syntax to array destructuring (short list syntax) (#8204) --- lib/Doctrine/ORM/AbstractQuery.php | 2 +- .../Entity/AbstractEntityPersister.php | 2 +- lib/Doctrine/ORM/EntityManager.php | 2 +- .../ORM/Internal/HydrationCompleteHandler.php | 2 +- .../ORM/Mapping/ClassMetadataInfo.php | 5 ++-- .../Collection/ManyToManyPersister.php | 24 ++++++++++++------- .../Entity/BasicEntityPersister.php | 24 +++++++++---------- lib/Doctrine/ORM/Query.php | 2 +- .../ORM/Query/ResultSetMappingBuilder.php | 3 ++- lib/Doctrine/ORM/Tools/SchemaTool.php | 2 +- lib/Doctrine/ORM/UnitOfWork.php | 4 ++-- .../ORM/Functional/EntityRepositoryTest.php | 14 +++++------ ...ManyToManyBidirectionalAssociationTest.php | 4 ++-- ...nyToManySelfReferentialAssociationTest.php | 2 +- .../ORM/Functional/Ticket/DDC1884Test.php | 4 ++-- ...tyPersisterCompositeTypeParametersTest.php | 4 ++-- 16 files changed, 55 insertions(+), 45 deletions(-) diff --git a/lib/Doctrine/ORM/AbstractQuery.php b/lib/Doctrine/ORM/AbstractQuery.php index 0646fa3f6d..71c32a6cb6 100644 --- a/lib/Doctrine/ORM/AbstractQuery.php +++ b/lib/Doctrine/ORM/AbstractQuery.php @@ -969,7 +969,7 @@ private function executeIgnoreQueryCache($parameters = null, $hydrationMode = nu $setCacheEntry = function() {}; if ($this->_hydrationCacheProfile !== null) { - list($cacheKey, $realCacheKey) = $this->getHydrationCacheId(); + [$cacheKey, $realCacheKey] = $this->getHydrationCacheId(); $queryCacheProfile = $this->getHydrationCacheProfile(); $cache = $queryCacheProfile->getResultCacheDriver(); diff --git a/lib/Doctrine/ORM/Cache/Persister/Entity/AbstractEntityPersister.php b/lib/Doctrine/ORM/Cache/Persister/Entity/AbstractEntityPersister.php index 05484120ec..3fdc969630 100644 --- a/lib/Doctrine/ORM/Cache/Persister/Entity/AbstractEntityPersister.php +++ b/lib/Doctrine/ORM/Cache/Persister/Entity/AbstractEntityPersister.php @@ -293,7 +293,7 @@ private function storeJoinedAssociations($entity) */ protected function getHash($query, $criteria, array $orderBy = null, $limit = null, $offset = null) { - list($params) = ($criteria instanceof Criteria) + [$params] = $criteria instanceof Criteria ? $this->persister->expandCriteriaParameters($criteria) : $this->persister->expandParameters($criteria); diff --git a/lib/Doctrine/ORM/EntityManager.php b/lib/Doctrine/ORM/EntityManager.php index 40aab33fcb..cfbba06d9b 100644 --- a/lib/Doctrine/ORM/EntityManager.php +++ b/lib/Doctrine/ORM/EntityManager.php @@ -327,7 +327,7 @@ public function createNativeQuery($sql, ResultSetMapping $rsm) */ public function createNamedNativeQuery($name) { - list($sql, $rsm) = $this->config->getNamedNativeQuery($name); + [$sql, $rsm] = $this->config->getNamedNativeQuery($name); return $this->createNativeQuery($sql, $rsm); } diff --git a/lib/Doctrine/ORM/Internal/HydrationCompleteHandler.php b/lib/Doctrine/ORM/Internal/HydrationCompleteHandler.php index 72a0c70348..480cc13807 100644 --- a/lib/Doctrine/ORM/Internal/HydrationCompleteHandler.php +++ b/lib/Doctrine/ORM/Internal/HydrationCompleteHandler.php @@ -89,7 +89,7 @@ public function hydrationComplete() $this->deferredPostLoadInvocations = []; foreach ($toInvoke as $classAndEntity) { - list($class, $invoke, $entity) = $classAndEntity; + [$class, $invoke, $entity] = $classAndEntity; $this->listenersInvoker->invoke( $class, diff --git a/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php b/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php index b53a211f98..2a70213a99 100644 --- a/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php +++ b/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php @@ -30,6 +30,7 @@ use ReflectionClass; use ReflectionProperty; use RuntimeException; +use function explode; /** * A ClassMetadata instance holds all the object-relational mapping metadata @@ -2342,7 +2343,7 @@ public function setPrimaryTable(array $table) if (isset($table['name'])) { // Split schema and table name from a table name like "myschema.mytable" if (strpos($table['name'], '.') !== false) { - list($this->table['schema'], $table['name']) = explode('.', $table['name'], 2); + [$this->table['schema'], $table['name']] = explode('.', $table['name'], 2); } if ($table['name'][0] === '`') { @@ -2568,7 +2569,7 @@ public function addSqlResultSetMapping(array $resultMapping) if (!isset($field['column'])) { $fieldName = $field['name']; if (strpos($fieldName, '.')) { - list(, $fieldName) = explode('.', $fieldName); + [, $fieldName] = explode('.', $fieldName); } $resultMapping['entities'][$key]['fields'][$k]['column'] = $fieldName; diff --git a/lib/Doctrine/ORM/Persisters/Collection/ManyToManyPersister.php b/lib/Doctrine/ORM/Persisters/Collection/ManyToManyPersister.php index e5f3c6647c..7a1dfb1af9 100644 --- a/lib/Doctrine/ORM/Persisters/Collection/ManyToManyPersister.php +++ b/lib/Doctrine/ORM/Persisters/Collection/ManyToManyPersister.php @@ -68,8 +68,8 @@ public function update(PersistentCollection $collection) return; // ignore inverse side } - list($deleteSql, $deleteTypes) = $this->getDeleteRowSQL($collection); - list($insertSql, $insertTypes) = $this->getInsertRowSQL($collection); + [$deleteSql, $deleteTypes] = $this->getDeleteRowSQL($collection); + [$insertSql, $insertTypes] = $this->getInsertRowSQL($collection); foreach ($collection->getDeleteDiff() as $element) { $this->conn->executeUpdate( @@ -136,7 +136,7 @@ public function count(PersistentCollection $collection) $types[] = PersisterHelper::getTypeOfColumn($referencedName, $sourceClass, $this->em); } - list($joinTargetEntitySQL, $filterSql) = $this->getFilterSql($mapping); + [$joinTargetEntitySQL, $filterSql] = $this->getFilterSql($mapping); if ($filterSql) { $conditions[] = $filterSql; @@ -188,7 +188,11 @@ public function containsKey(PersistentCollection $collection, $key) throw new \BadMethodCallException("Selecting a collection by index is only supported on indexed collections."); } - list($quotedJoinTable, $whereClauses, $params, $types) = $this->getJoinTableRestrictionsWithKey($collection, $key, true); + [$quotedJoinTable, $whereClauses, $params, $types] = $this->getJoinTableRestrictionsWithKey( + $collection, + $key, + true + ); $sql = 'SELECT 1 FROM ' . $quotedJoinTable . ' WHERE ' . implode(' AND ', $whereClauses); @@ -204,7 +208,11 @@ public function contains(PersistentCollection $collection, $element) return false; } - list($quotedJoinTable, $whereClauses, $params, $types) = $this->getJoinTableRestrictions($collection, $element, true); + [$quotedJoinTable, $whereClauses, $params, $types] = $this->getJoinTableRestrictions( + $collection, + $element, + true + ); $sql = 'SELECT 1 FROM ' . $quotedJoinTable . ' WHERE ' . implode(' AND ', $whereClauses); @@ -644,7 +652,7 @@ private function getJoinTableRestrictionsWithKey(PersistentCollection $collectio } if ($addFilters) { - list($joinTargetEntitySQL, $filterSql) = $this->getFilterSql($filterMapping); + [$joinTargetEntitySQL, $filterSql] = $this->getFilterSql($filterMapping); if ($filterSql) { $quotedJoinTable .= ' ' . $joinTargetEntitySQL; @@ -712,7 +720,7 @@ private function getJoinTableRestrictions(PersistentCollection $collection, $ele if ($addFilters) { $quotedJoinTable .= ' t'; - list($joinTargetEntitySQL, $filterSql) = $this->getFilterSql($filterMapping); + [$joinTargetEntitySQL, $filterSql] = $this->getFilterSql($filterMapping); if ($filterSql) { $quotedJoinTable .= ' ' . $joinTargetEntitySQL; @@ -743,7 +751,7 @@ private function expandCriteriaParameters(Criteria $criteria) $valueVisitor->dispatch($expression); - list(, $types) = $valueVisitor->getParamsAndTypes(); + [, $types] = $valueVisitor->getParamsAndTypes(); return $types; } diff --git a/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php b/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php index 4de961de95..45dcd282f5 100644 --- a/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php +++ b/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php @@ -722,7 +722,7 @@ public function load(array $criteria, $entity = null, $assoc = null, array $hint $this->switchPersisterContext(null, $limit); $sql = $this->getSelectSQL($criteria, $assoc, $lockMode, $limit, null, $orderBy); - list($params, $types) = $this->expandParameters($criteria); + [$params, $types] = $this->expandParameters($criteria); $stmt = $this->conn->executeQuery($sql, $params, $types); if ($entity !== null) { @@ -814,7 +814,7 @@ public function loadOneToOneEntity(array $assoc, $sourceEntity, array $identifie public function refresh(array $id, $entity, $lockMode = null) { $sql = $this->getSelectSQL($id, null, $lockMode); - list($params, $types) = $this->expandParameters($id); + [$params, $types] = $this->expandParameters($id); $stmt = $this->conn->executeQuery($sql, $params, $types); $hydrator = $this->em->newHydrator(Query::HYDRATE_OBJECT); @@ -828,7 +828,7 @@ public function count($criteria = []) { $sql = $this->getCountSQL($criteria); - list($params, $types) = ($criteria instanceof Criteria) + [$params, $types] = $criteria instanceof Criteria ? $this->expandCriteriaParameters($criteria) : $this->expandParameters($criteria); @@ -845,7 +845,7 @@ public function loadCriteria(Criteria $criteria) $offset = $criteria->getFirstResult(); $query = $this->getSelectSQL($criteria, null, null, $limit, $offset, $orderBy); - list($params, $types) = $this->expandCriteriaParameters($criteria); + [$params, $types] = $this->expandCriteriaParameters($criteria); $stmt = $this->conn->executeQuery($query, $params, $types); $hydrator = $this->em->newHydrator(($this->currentPersisterContext->selectJoinSql) ? Query::HYDRATE_OBJECT : Query::HYDRATE_SIMPLEOBJECT); @@ -871,14 +871,14 @@ public function expandCriteriaParameters(Criteria $criteria) $valueVisitor->dispatch($expression); - list($params, $types) = $valueVisitor->getParamsAndTypes(); + [$params, $types] = $valueVisitor->getParamsAndTypes(); foreach ($params as $param) { $sqlParams = array_merge($sqlParams, $this->getValues($param)); } foreach ($types as $type) { - list ($field, $value) = $type; + [$field, $value] = $type; $sqlTypes = array_merge($sqlTypes, $this->getTypes($field, $value, $this->class)); } @@ -893,7 +893,7 @@ public function loadAll(array $criteria = [], array $orderBy = null, $limit = nu $this->switchPersisterContext($offset, $limit); $sql = $this->getSelectSQL($criteria, null, null, $limit, $offset, $orderBy); - list($params, $types) = $this->expandParameters($criteria); + [$params, $types] = $this->expandParameters($criteria); $stmt = $this->conn->executeQuery($sql, $params, $types); $hydrator = $this->em->newHydrator(($this->currentPersisterContext->selectJoinSql) ? Query::HYDRATE_OBJECT : Query::HYDRATE_SIMPLEOBJECT); @@ -1038,7 +1038,7 @@ private function getManyToManyStatement(array $assoc, $sourceEntity, $offset = n } $sql = $this->getSelectSQL($criteria, $assoc, null, $limit, $offset); - list($params, $types) = $this->expandToManyParameters($parameters); + [$params, $types] = $this->expandToManyParameters($parameters); return $this->conn->executeQuery($sql, $params, $types); } @@ -1546,7 +1546,7 @@ public function lock(array $criteria, $lockMode) . $where . $lockSql; - list($params, $types) = $this->expandParameters($criteria); + [$params, $types] = $this->expandParameters($criteria); $this->conn->executeQuery($sql, $params, $types); } @@ -1825,7 +1825,7 @@ private function getOneToManyStatement(array $assoc, $sourceEntity, $offset = nu } $sql = $this->getSelectSQL($criteria, $assoc, null, $limit, $offset); - list($params, $types) = $this->expandToManyParameters($parameters); + [$params, $types] = $this->expandToManyParameters($parameters); return $this->conn->executeQuery($sql, $params, $types); } @@ -2004,11 +2004,11 @@ public function exists($entity, Criteria $extraConditions = null) . $this->getLockTablesSql(null) . ' WHERE ' . $this->getSelectConditionSQL($criteria); - list($params, $types) = $this->expandParameters($criteria); + [$params, $types] = $this->expandParameters($criteria); if (null !== $extraConditions) { $sql .= ' AND ' . $this->getSelectConditionCriteriaSQL($extraConditions); - list($criteriaParams, $criteriaTypes) = $this->expandCriteriaParameters($extraConditions); + [$criteriaParams, $criteriaTypes] = $this->expandCriteriaParameters($extraConditions); $params = array_merge($params, $criteriaParams); $types = array_merge($types, $criteriaTypes); diff --git a/lib/Doctrine/ORM/Query.php b/lib/Doctrine/ORM/Query.php index f13d930628..131830bcae 100644 --- a/lib/Doctrine/ORM/Query.php +++ b/lib/Doctrine/ORM/Query.php @@ -325,7 +325,7 @@ protected function _doExecute() $this->evictEntityCacheRegion(); } - list($sqlParams, $types) = $this->processParameterMappings($paramMappings); + [$sqlParams, $types] = $this->processParameterMappings($paramMappings); $this->evictResultSetCache( $executor, diff --git a/lib/Doctrine/ORM/Query/ResultSetMappingBuilder.php b/lib/Doctrine/ORM/Query/ResultSetMappingBuilder.php index 8281dfd400..5fe71d6b18 100644 --- a/lib/Doctrine/ORM/Query/ResultSetMappingBuilder.php +++ b/lib/Doctrine/ORM/Query/ResultSetMappingBuilder.php @@ -23,6 +23,7 @@ use Doctrine\ORM\Mapping\ClassMetadataInfo; use Doctrine\ORM\Mapping\MappingException; use Doctrine\ORM\Utility\PersisterHelper; +use function explode; /** * A ResultSetMappingBuilder uses the EntityManager to automatically populate entity fields. @@ -393,7 +394,7 @@ public function addNamedNativeQueryEntityResultMapping(ClassMetadataInfo $classM $relation = null; if (strpos($fieldName, '.') !== false) { - list($relation, $fieldName) = explode('.', $fieldName); + [$relation, $fieldName] = explode('.', $fieldName); } if (isset($classMetadata->associationMappings[$relation])) { diff --git a/lib/Doctrine/ORM/Tools/SchemaTool.php b/lib/Doctrine/ORM/Tools/SchemaTool.php index 57f45fabe1..0189d2b1f9 100644 --- a/lib/Doctrine/ORM/Tools/SchemaTool.php +++ b/lib/Doctrine/ORM/Tools/SchemaTool.php @@ -639,7 +639,7 @@ private function gatherRelationJoinColumns( foreach ($joinColumns as $joinColumn) { - list($definingClass, $referencedFieldName) = $this->getDefiningClass( + [$definingClass, $referencedFieldName] = $this->getDefiningClass( $class, $joinColumn['referencedColumnName'] ); diff --git a/lib/Doctrine/ORM/UnitOfWork.php b/lib/Doctrine/ORM/UnitOfWork.php index 3383a44b0c..68c6b92895 100644 --- a/lib/Doctrine/ORM/UnitOfWork.php +++ b/lib/Doctrine/ORM/UnitOfWork.php @@ -548,7 +548,7 @@ private function computeSingleEntityChangeSet($entity) private function executeExtraUpdates() { foreach ($this->extraUpdates as $oid => $update) { - list ($entity, $changeset) = $update; + [$entity, $changeset] = $update; $this->entityChangeSets[$oid] = $changeset; $this->getEntityPersister(get_class($entity))->update($entity); @@ -1393,7 +1393,7 @@ public function scheduleExtraUpdate($entity, array $changeset) $extraUpdate = [$entity, $changeset]; if (isset($this->extraUpdates[$oid])) { - list(, $changeset2) = $this->extraUpdates[$oid]; + [, $changeset2] = $this->extraUpdates[$oid]; $extraUpdate = [$entity, $changeset + $changeset2]; } diff --git a/tests/Doctrine/Tests/ORM/Functional/EntityRepositoryTest.php b/tests/Doctrine/Tests/ORM/Functional/EntityRepositoryTest.php index c928c23aa5..555eaff8be 100644 --- a/tests/Doctrine/Tests/ORM/Functional/EntityRepositoryTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/EntityRepositoryTest.php @@ -409,7 +409,7 @@ public function testInvalidMagicCall() */ public function testFindByAssociationKey_ExceptionOnInverseSide() { - list($userId, $addressId) = $this->loadAssociatedFixture(); + [$userId, $addressId] = $this->loadAssociatedFixture(); $repos = $this->_em->getRepository(CmsUser::class); $this->expectException(ORMException::class); @@ -423,7 +423,7 @@ public function testFindByAssociationKey_ExceptionOnInverseSide() */ public function testFindOneByAssociationKey() { - list($userId, $addressId) = $this->loadAssociatedFixture(); + [$userId, $addressId] = $this->loadAssociatedFixture(); $repos = $this->_em->getRepository(CmsAddress::class); $address = $repos->findOneBy(['user' => $userId]); @@ -450,7 +450,7 @@ public function testFindOneByOrderBy() */ public function testFindByAssociationKey() { - list($userId, $addressId) = $this->loadAssociatedFixture(); + [$userId, $addressId] = $this->loadAssociatedFixture(); $repos = $this->_em->getRepository(CmsAddress::class); $addresses = $repos->findBy(['user' => $userId]); @@ -464,7 +464,7 @@ public function testFindByAssociationKey() */ public function testFindAssociationByMagicCall() { - list($userId, $addressId) = $this->loadAssociatedFixture(); + [$userId, $addressId] = $this->loadAssociatedFixture(); $repos = $this->_em->getRepository(CmsAddress::class); $addresses = $repos->findByUser($userId); @@ -478,7 +478,7 @@ public function testFindAssociationByMagicCall() */ public function testFindOneAssociationByMagicCall() { - list($userId, $addressId) = $this->loadAssociatedFixture(); + [$userId, $addressId] = $this->loadAssociatedFixture(); $repos = $this->_em->getRepository(CmsAddress::class); $address = $repos->findOneByUser($userId); @@ -856,7 +856,7 @@ public function testMatchingCriteriaGteComparison() */ public function testMatchingCriteriaAssocationByObjectInMemory() { - list($userId, $addressId) = $this->loadAssociatedFixture(); + [$userId, $addressId] = $this->loadAssociatedFixture(); $user = $this->_em->find(CmsUser::class, $userId); @@ -879,7 +879,7 @@ public function testMatchingCriteriaAssocationByObjectInMemory() */ public function testMatchingCriteriaAssocationInWithArray() { - list($userId, $addressId) = $this->loadAssociatedFixture(); + [$userId, $addressId] = $this->loadAssociatedFixture(); $user = $this->_em->find(CmsUser::class, $userId); diff --git a/tests/Doctrine/Tests/ORM/Functional/ManyToManyBidirectionalAssociationTest.php b/tests/Doctrine/Tests/ORM/Functional/ManyToManyBidirectionalAssociationTest.php index 9c70ab7f6a..597e0f3c39 100644 --- a/tests/Doctrine/Tests/ORM/Functional/ManyToManyBidirectionalAssociationTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/ManyToManyBidirectionalAssociationTest.php @@ -130,7 +130,7 @@ protected function _findCategories() public function assertLazyLoadFromInverseSide($products) { - list ($firstProduct, $secondProduct) = $products; + [$firstProduct, $secondProduct] = $products; $firstProductCategories = $firstProduct->getCategories(); $secondProductCategories = $secondProduct->getCategories(); @@ -165,7 +165,7 @@ public function assertLazyLoadFromInverseSide($products) public function assertLazyLoadFromOwningSide($categories) { - list ($firstCategory, $secondCategory) = $categories; + [$firstCategory, $secondCategory] = $categories; $firstCategoryProducts = $firstCategory->getProducts(); $secondCategoryProducts = $secondCategory->getProducts(); diff --git a/tests/Doctrine/Tests/ORM/Functional/ManyToManySelfReferentialAssociationTest.php b/tests/Doctrine/Tests/ORM/Functional/ManyToManySelfReferentialAssociationTest.php index 559cd4ba66..7c15c83fc9 100644 --- a/tests/Doctrine/Tests/ORM/Functional/ManyToManySelfReferentialAssociationTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/ManyToManySelfReferentialAssociationTest.php @@ -82,7 +82,7 @@ public function testLazyLoadsOwningSide() public function assertLoadingOfOwningSide($products) { - list ($firstProduct, $secondProduct) = $products; + [$firstProduct, $secondProduct] = $products; $this->assertEquals(2, count($firstProduct->getRelated())); $this->assertEquals(2, count($secondProduct->getRelated())); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1884Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1884Test.php index 938459ad46..c1c723bbf0 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1884Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1884Test.php @@ -17,8 +17,8 @@ protected function setUp() $this->useModelSet('taxi'); parent::setUp(); - list($bimmer, $crysler, $merc, $volvo) = $this->createCars(Car::class); - list($john, $foo) = $this->createDrivers(Driver::class); + [$bimmer, $crysler, $merc, $volvo] = $this->createCars(Car::class); + [$john, $foo] = $this->createDrivers(Driver::class); $this->_em->flush(); $ride1 = new Ride($john, $bimmer); diff --git a/tests/Doctrine/Tests/ORM/Persisters/BasicEntityPersisterCompositeTypeParametersTest.php b/tests/Doctrine/Tests/ORM/Persisters/BasicEntityPersisterCompositeTypeParametersTest.php index 1694d97ce8..000eb637eb 100644 --- a/tests/Doctrine/Tests/ORM/Persisters/BasicEntityPersisterCompositeTypeParametersTest.php +++ b/tests/Doctrine/Tests/ORM/Persisters/BasicEntityPersisterCompositeTypeParametersTest.php @@ -43,7 +43,7 @@ public function testExpandParametersWillExpandCompositeEntityKeys() $country = new Country("IT", "Italy"); $admin1 = new Admin1(10, "Rome", $country); - list ($values, $types) = $this->_persister->expandParameters(['admin1' => $admin1]); + [$values, $types] = $this->_persister->expandParameters(['admin1' => $admin1]); $this->assertEquals(['integer', 'string'], $types); $this->assertEquals([10, 'IT'], $values); @@ -57,7 +57,7 @@ public function testExpandCriteriaParametersWillExpandCompositeEntityKeys() $criteria = Criteria::create(); $criteria->andWhere(Criteria::expr()->eq("admin1", $admin1)); - list ($values, $types) = $this->_persister->expandCriteriaParameters($criteria); + [$values, $types] = $this->_persister->expandCriteriaParameters($criteria); $this->assertEquals(['integer', 'string'], $types); $this->assertEquals([10, 'IT'], $values); From aab589b596b2d662d147c861756b90fa876d694b Mon Sep 17 00:00:00 2001 From: orklah Date: Fri, 10 Jul 2020 22:08:13 +0200 Subject: [PATCH 100/136] add/fix more types (checked by psalm) (#8199) * add/fix more psalm types * remove inexistant SimpleEntityExpression * Declare template implements for TreeWalkerChainIterator --- .../Reflection/ReflectionPropertiesGetter.php | 4 +- lib/Doctrine/ORM/OptimisticLockException.php | 2 +- .../Entity/BasicEntityPersister.php | 2 +- .../ORM/Persisters/Entity/EntityPersister.php | 2 +- lib/Doctrine/ORM/Query.php | 11 ++-- lib/Doctrine/ORM/Query/Parser.php | 54 +++++++++---------- lib/Doctrine/ORM/Query/TreeWalkerChain.php | 1 + .../ORM/Query/TreeWalkerChainIterator.php | 13 +++-- .../Tools/AttachEntityListenersListener.php | 3 +- lib/Doctrine/ORM/Tools/EntityGenerator.php | 4 +- lib/Doctrine/ORM/UnitOfWork.php | 4 +- 11 files changed, 57 insertions(+), 43 deletions(-) diff --git a/lib/Doctrine/ORM/Mapping/Reflection/ReflectionPropertiesGetter.php b/lib/Doctrine/ORM/Mapping/Reflection/ReflectionPropertiesGetter.php index 00d8796f6b..dff9e19eb3 100644 --- a/lib/Doctrine/ORM/Mapping/Reflection/ReflectionPropertiesGetter.php +++ b/lib/Doctrine/ORM/Mapping/Reflection/ReflectionPropertiesGetter.php @@ -52,9 +52,11 @@ public function __construct(ReflectionService $reflectionService) } /** - * @param $className + * @param string $className * * @return ReflectionProperty[] indexed by property internal name + * + * @psalm-param class-string $className */ public function getProperties($className) { diff --git a/lib/Doctrine/ORM/OptimisticLockException.php b/lib/Doctrine/ORM/OptimisticLockException.php index 2fbd9ce5ec..23af9bb780 100644 --- a/lib/Doctrine/ORM/OptimisticLockException.php +++ b/lib/Doctrine/ORM/OptimisticLockException.php @@ -36,7 +36,7 @@ class OptimisticLockException extends ORMException /** * @param string $msg - * @param object $entity + * @param object|null $entity */ public function __construct($msg, $entity) { diff --git a/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php b/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php index 45dcd282f5..42ec11266e 100644 --- a/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php +++ b/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php @@ -1554,7 +1554,7 @@ public function lock(array $criteria, $lockMode) /** * Gets the FROM and optionally JOIN conditions to lock the entity managed by this persister. * - * @param integer $lockMode One of the Doctrine\DBAL\LockMode::* constants. + * @param int|null $lockMode One of the Doctrine\DBAL\LockMode::* constants. * * @return string */ diff --git a/lib/Doctrine/ORM/Persisters/Entity/EntityPersister.php b/lib/Doctrine/ORM/Persisters/Entity/EntityPersister.php index 9ac6316683..8840f9db4b 100644 --- a/lib/Doctrine/ORM/Persisters/Entity/EntityPersister.php +++ b/lib/Doctrine/ORM/Persisters/Entity/EntityPersister.php @@ -86,7 +86,7 @@ public function getCountSQL($criteria = []); /** * Expands the parameters from the given criteria and use the correct binding types if found. * - * @param $criteria + * @param string[] $criteria * * @return array */ diff --git a/lib/Doctrine/ORM/Query.php b/lib/Doctrine/ORM/Query.php index 131830bcae..136bd5505a 100644 --- a/lib/Doctrine/ORM/Query.php +++ b/lib/Doctrine/ORM/Query.php @@ -22,6 +22,9 @@ use Doctrine\Common\Collections\ArrayCollection; use Doctrine\DBAL\LockMode; use Doctrine\ORM\Mapping\ClassMetadata; +use Doctrine\ORM\Query\AST\DeleteStatement; +use Doctrine\ORM\Query\AST\SelectStatement; +use Doctrine\ORM\Query\AST\UpdateStatement; use Doctrine\ORM\Query\Exec\AbstractSqlExecutor; use Doctrine\ORM\Query\Parameter; use Doctrine\ORM\Query\ParameterTypeInferer; @@ -213,9 +216,7 @@ public function getSQL() /** * Returns the corresponding AST for this DQL query. * - * @return \Doctrine\ORM\Query\AST\SelectStatement | - * \Doctrine\ORM\Query\AST\UpdateStatement | - * \Doctrine\ORM\Query\AST\DeleteStatement + * @return SelectStatement|UpdateStatement|DeleteStatement */ public function getAST() { @@ -364,11 +365,11 @@ private function evictEntityCacheRegion() { $AST = $this->getAST(); - if ($AST instanceof \Doctrine\ORM\Query\AST\SelectStatement) { + if ($AST instanceof SelectStatement) { throw new QueryException('The hint "HINT_CACHE_EVICT" is not valid for select statements.'); } - $className = ($AST instanceof \Doctrine\ORM\Query\AST\DeleteStatement) + $className = $AST instanceof DeleteStatement ? $AST->deleteClause->abstractSchemaName : $AST->updateClause->abstractSchemaName; diff --git a/lib/Doctrine/ORM/Query/Parser.php b/lib/Doctrine/ORM/Query/Parser.php index b20abb1183..3fe1eb04f4 100644 --- a/lib/Doctrine/ORM/Query/Parser.php +++ b/lib/Doctrine/ORM/Query/Parser.php @@ -21,7 +21,14 @@ use Doctrine\ORM\Mapping\ClassMetadata; use Doctrine\ORM\Query; +use Doctrine\ORM\Query\AST\DeleteStatement; use Doctrine\ORM\Query\AST\Functions; +use Doctrine\ORM\Query\AST\IdentificationVariableDeclaration; +use Doctrine\ORM\Query\AST\PathExpression; +use Doctrine\ORM\Query\AST\SelectStatement; +use Doctrine\ORM\Query\AST\Subselect; +use Doctrine\ORM\Query\AST\SubselectIdentificationVariableDeclaration; +use Doctrine\ORM\Query\AST\UpdateStatement; use function in_array; use function strpos; @@ -43,7 +50,7 @@ class Parser * * @var array * - * @psalm-var class-string + * @psalm-var array> */ private static $_STRING_FUNCTIONS = [ 'concat' => Functions\ConcatFunction::class, @@ -59,7 +66,7 @@ class Parser * * @var array * - * @psalm-var class-string + * @psalm-var array> */ private static $_NUMERIC_FUNCTIONS = [ 'length' => Functions\LengthFunction::class, @@ -85,7 +92,7 @@ class Parser * * @var array * - * @psalm-var class-string + * @psalm-var array> */ private static $_DATETIME_FUNCTIONS = [ 'current_date' => Functions\CurrentDateFunction::class, @@ -257,9 +264,7 @@ public function getEntityManager() /** * Parses and builds AST for the given Query. * - * @return \Doctrine\ORM\Query\AST\SelectStatement | - * \Doctrine\ORM\Query\AST\UpdateStatement | - * \Doctrine\ORM\Query\AST\DeleteStatement + * @return SelectStatement|UpdateStatement|DeleteStatement */ public function getAST() { @@ -839,9 +844,7 @@ private function processRootEntityAliasSelected() /** * QueryLanguage ::= SelectStatement | UpdateStatement | DeleteStatement * - * @return \Doctrine\ORM\Query\AST\SelectStatement | - * \Doctrine\ORM\Query\AST\UpdateStatement | - * \Doctrine\ORM\Query\AST\DeleteStatement + * @return SelectStatement|UpdateStatement|DeleteStatement */ public function QueryLanguage() { @@ -878,7 +881,7 @@ public function QueryLanguage() /** * SelectStatement ::= SelectClause FromClause [WhereClause] [GroupByClause] [HavingClause] [OrderByClause] * - * @return \Doctrine\ORM\Query\AST\SelectStatement + * @return SelectStatement */ public function SelectStatement() { @@ -895,7 +898,7 @@ public function SelectStatement() /** * UpdateStatement ::= UpdateClause [WhereClause] * - * @return \Doctrine\ORM\Query\AST\UpdateStatement + * @return UpdateStatement */ public function UpdateStatement() { @@ -909,7 +912,7 @@ public function UpdateStatement() /** * DeleteStatement ::= DeleteClause [WhereClause] * - * @return \Doctrine\ORM\Query\AST\DeleteStatement + * @return DeleteStatement */ public function DeleteStatement() { @@ -1078,7 +1081,7 @@ public function JoinAssociationPathExpression() * * @param integer $expectedTypes * - * @return \Doctrine\ORM\Query\AST\PathExpression + * @return PathExpression */ public function PathExpression($expectedTypes) { @@ -1114,7 +1117,7 @@ public function PathExpression($expectedTypes) /** * AssociationPathExpression ::= CollectionValuedPathExpression | SingleValuedAssociationPathExpression * - * @return \Doctrine\ORM\Query\AST\PathExpression + * @return PathExpression */ public function AssociationPathExpression() { @@ -1127,7 +1130,7 @@ public function AssociationPathExpression() /** * SingleValuedPathExpression ::= StateFieldPathExpression | SingleValuedAssociationPathExpression * - * @return \Doctrine\ORM\Query\AST\PathExpression + * @return PathExpression */ public function SingleValuedPathExpression() { @@ -1140,7 +1143,7 @@ public function SingleValuedPathExpression() /** * StateFieldPathExpression ::= IdentificationVariable "." StateField * - * @return \Doctrine\ORM\Query\AST\PathExpression + * @return PathExpression */ public function StateFieldPathExpression() { @@ -1150,7 +1153,7 @@ public function StateFieldPathExpression() /** * SingleValuedAssociationPathExpression ::= IdentificationVariable "." SingleValuedAssociationField * - * @return \Doctrine\ORM\Query\AST\PathExpression + * @return PathExpression */ public function SingleValuedAssociationPathExpression() { @@ -1160,7 +1163,7 @@ public function SingleValuedAssociationPathExpression() /** * CollectionValuedPathExpression ::= IdentificationVariable "." CollectionValuedAssociationField * - * @return \Doctrine\ORM\Query\AST\PathExpression + * @return PathExpression */ public function CollectionValuedPathExpression() { @@ -1425,7 +1428,7 @@ public function OrderByClause() /** * Subselect ::= SimpleSelectClause SubselectFromClause [WhereClause] [GroupByClause] [HavingClause] [OrderByClause] * - * @return \Doctrine\ORM\Query\AST\Subselect + * @return Subselect */ public function Subselect() { @@ -1464,7 +1467,7 @@ public function UpdateItem() /** * GroupByItem ::= IdentificationVariable | ResultVariable | SingleValuedPathExpression * - * @return string | \Doctrine\ORM\Query\AST\PathExpression + * @return string|PathExpression */ public function GroupByItem() { @@ -1583,7 +1586,7 @@ public function NewValue() /** * IdentificationVariableDeclaration ::= RangeVariableDeclaration [IndexBy] {Join}* * - * @return \Doctrine\ORM\Query\AST\IdentificationVariableDeclaration + * @return IdentificationVariableDeclaration */ public function IdentificationVariableDeclaration() { @@ -1622,8 +1625,7 @@ public function IdentificationVariableDeclaration() * accessible is "FROM", prohibiting an easy implementation without larger * changes.} * - * @return \Doctrine\ORM\Query\AST\SubselectIdentificationVariableDeclaration | - * \Doctrine\ORM\Query\AST\IdentificationVariableDeclaration + * @return SubselectIdentificationVariableDeclaration|IdentificationVariableDeclaration */ public function SubselectIdentificationVariableDeclaration() { @@ -2873,8 +2875,7 @@ public function ArithmeticPrimary() /** * StringExpression ::= StringPrimary | ResultVariable | "(" Subselect ")" * - * @return \Doctrine\ORM\Query\AST\Subselect | - * string + * @return Subselect|string */ public function StringExpression() { @@ -2947,8 +2948,7 @@ public function StringPrimary() /** * EntityExpression ::= SingleValuedAssociationPathExpression | SimpleEntityExpression * - * @return \Doctrine\ORM\Query\AST\PathExpression | - * \Doctrine\ORM\Query\AST\SimpleEntityExpression + * @return PathExpression */ public function EntityExpression() { diff --git a/lib/Doctrine/ORM/Query/TreeWalkerChain.php b/lib/Doctrine/ORM/Query/TreeWalkerChain.php index 074aa93870..a3f94d0ea9 100644 --- a/lib/Doctrine/ORM/Query/TreeWalkerChain.php +++ b/lib/Doctrine/ORM/Query/TreeWalkerChain.php @@ -33,6 +33,7 @@ class TreeWalkerChain implements TreeWalker * The tree walkers. * * @var TreeWalker[] + * @psalm-var TreeWalkerChainIterator */ private $_walkers; diff --git a/lib/Doctrine/ORM/Query/TreeWalkerChainIterator.php b/lib/Doctrine/ORM/Query/TreeWalkerChainIterator.php index a65e0ae0ed..65e4e05e21 100644 --- a/lib/Doctrine/ORM/Query/TreeWalkerChainIterator.php +++ b/lib/Doctrine/ORM/Query/TreeWalkerChainIterator.php @@ -19,8 +19,11 @@ namespace Doctrine\ORM\Query; +use Doctrine\ORM\AbstractQuery; + /** - * + * @template-implements \Iterator + * @template-implements \ArrayAccess */ class TreeWalkerChainIterator implements \Iterator, \ArrayAccess { @@ -33,14 +36,18 @@ class TreeWalkerChainIterator implements \Iterator, \ArrayAccess */ private $treeWalkerChain; /** - * @var + * @var AbstractQuery */ private $query; /** - * @var + * @var ParserResult */ private $parserResult; + /** + * @param AbstractQuery $query + * @param ParserResult $parserResult + */ public function __construct(TreeWalkerChain $treeWalkerChain, $query, $parserResult) { $this->treeWalkerChain = $treeWalkerChain; diff --git a/lib/Doctrine/ORM/Tools/AttachEntityListenersListener.php b/lib/Doctrine/ORM/Tools/AttachEntityListenersListener.php index cf7cc8b8b9..b78ec9645e 100644 --- a/lib/Doctrine/ORM/Tools/AttachEntityListenersListener.php +++ b/lib/Doctrine/ORM/Tools/AttachEntityListenersListener.php @@ -20,6 +20,7 @@ namespace Doctrine\ORM\Tools; use Doctrine\ORM\Event\LoadClassMetadataEventArgs; +use Doctrine\ORM\Mapping\ClassMetadata; /** * Mechanism to programmatically attach entity listeners. @@ -63,7 +64,7 @@ public function addEntityListener($entityClass, $listenerClass, $eventName, $lis */ public function loadClassMetadata(LoadClassMetadataEventArgs $event) { - /** @var $metadata \Doctrine\ORM\Mapping\ClassMetadata */ + /** @var ClassMetadata $metadata */ $metadata = $event->getClassMetadata(); if ( ! isset($this->entityListeners[$metadata->name])) { diff --git a/lib/Doctrine/ORM/Tools/EntityGenerator.php b/lib/Doctrine/ORM/Tools/EntityGenerator.php index d7683f4e69..4e09d1fdf0 100644 --- a/lib/Doctrine/ORM/Tools/EntityGenerator.php +++ b/lib/Doctrine/ORM/Tools/EntityGenerator.php @@ -506,11 +506,13 @@ public function setGenerateAnnotations($bool) /** * Sets the class fields visibility for the entity (can either be private or protected). * - * @param bool $visibility + * @param string $visibility * * @return void * * @throws \InvalidArgumentException + * + * @psalm-param self::FIELD_VISIBLE_* */ public function setFieldVisibility($visibility) { diff --git a/lib/Doctrine/ORM/UnitOfWork.php b/lib/Doctrine/ORM/UnitOfWork.php index 68c6b92895..1932183a09 100644 --- a/lib/Doctrine/ORM/UnitOfWork.php +++ b/lib/Doctrine/ORM/UnitOfWork.php @@ -3043,8 +3043,8 @@ public function getSingleIdentifierValue($entity) * @param mixed $id The entity identifier to look for. * @param string $rootClassName The name of the root class of the mapped entity hierarchy. * - * @return object|bool Returns the entity with the specified identifier if it exists in - * this UnitOfWork, FALSE otherwise. + * @return object|false Returns the entity with the specified identifier if it exists in + * this UnitOfWork, FALSE otherwise. */ public function tryGetById($id, $rootClassName) { From 271f3480c8da6c0045903402c7dcb4a2db6a6acb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Wed, 15 Jul 2020 22:46:25 +0200 Subject: [PATCH 101/136] Fix: Typo (#8213) --- docs/en/reference/association-mapping.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/en/reference/association-mapping.rst b/docs/en/reference/association-mapping.rst index 6347d89c69..946ae7dc4d 100644 --- a/docs/en/reference/association-mapping.rst +++ b/docs/en/reference/association-mapping.rst @@ -18,9 +18,9 @@ This chapter is split into three different sections. One tip for working with relations is to read the relation from left to right, where the left word refers to the current Entity. For example: -- OneToMany - One instance of the current Entity has Many instances (references) to the refered Entity. -- ManyToOne - Many instances of the current Entity refer to One instance of the refered Entity. -- OneToOne - One instance of the current Entity refers to One instance of the refered Entity. +- OneToMany - One instance of the current Entity has Many instances (references) to the referred Entity. +- ManyToOne - Many instances of the current Entity refer to One instance of the referred Entity. +- OneToOne - One instance of the current Entity refers to One instance of the referred Entity. See below for all the possible relations. From efd25484f402835a5de1b51466e291fd069dd144 Mon Sep 17 00:00:00 2001 From: njutn95 Date: Mon, 20 Jul 2020 21:19:16 +0200 Subject: [PATCH 102/136] Update aggregate-fields.rst (#8215) Minor typo fix --- docs/en/cookbook/aggregate-fields.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/cookbook/aggregate-fields.rst b/docs/en/cookbook/aggregate-fields.rst index 7e5a89dce2..6295c77916 100644 --- a/docs/en/cookbook/aggregate-fields.rst +++ b/docs/en/cookbook/aggregate-fields.rst @@ -22,7 +22,7 @@ into the account can either be of positive or negative money values. Each account has a credit limit and the account is never allowed to have a balance below that value. -For simplicity we live in a world were money is composed of +For simplicity we live in a world where money is composed of integers only. Also we omit the receiver/sender name, stated reason for transfer and the execution date. These all would have to be added on the ``Entry`` object. From 7e5fe79349cd09a9f482460f8af22a8a6d1373ca Mon Sep 17 00:00:00 2001 From: Benjamin Cremer Date: Mon, 3 Aug 2020 21:40:52 +0200 Subject: [PATCH 103/136] Change preferred cache driver for metadata and query caches (#8223) See: https://twitter.com/lcobucci/status/1289087725694484481 --- docs/en/reference/improving-performance.rst | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/docs/en/reference/improving-performance.rst b/docs/en/reference/improving-performance.rst index d7ed74fc3f..ef7ce540df 100644 --- a/docs/en/reference/improving-performance.rst +++ b/docs/en/reference/improving-performance.rst @@ -20,12 +20,17 @@ Metadata and Query caches As already mentioned earlier in the chapter about configuring Doctrine, it is strongly discouraged to use Doctrine without a -Metadata and Query cache (preferably with APC or Memcache as the -cache driver). Operating Doctrine without these caches means +Metadata and Query cache. + +Operating Doctrine without these caches means Doctrine will need to load your mapping information on every single request and has to parse each DQL query on every single request. This is a waste of resources. +The preferred cache driver for metadata and query caches is ``PhpFileCache``. +This driver serializes cache items and writes them to a file. +This allows for opcode caching to be used and provides high performance in most scenarios. + See :ref:`integrating-with-the-orm` Alternative Query Result Formats From 7cffba87434b4e770135503dc83aa2c3387f6795 Mon Sep 17 00:00:00 2001 From: Kirill Matasov Date: Thu, 6 Aug 2020 18:55:05 +0300 Subject: [PATCH 104/136] Fix annotation in Expr --- lib/Doctrine/ORM/Query/Expr.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/Doctrine/ORM/Query/Expr.php b/lib/Doctrine/ORM/Query/Expr.php index 25231822d1..59f833993c 100644 --- a/lib/Doctrine/ORM/Query/Expr.php +++ b/lib/Doctrine/ORM/Query/Expr.php @@ -41,8 +41,9 @@ class Expr * // (u.type = ?1) AND (u.role = ?2) * $expr->andX($expr->eq('u.type', ':1'), $expr->eq('u.role', ':2')); * - * @param Expr\Comparison|Expr\Func|Expr\Orx|string $x Optional clause. Defaults to null, but requires at least one - * defined when converting to string. + * @param Expr\Comparison|Expr\Func|Expr\Andx|Expr\Orx|string $x Optional clause. Defaults to null, + * but requires at least one defined + * when converting to string. * * @return Expr\Andx */ @@ -60,8 +61,9 @@ public function andX($x = null) * // (u.type = ?1) OR (u.role = ?2) * $q->where($q->expr()->orX('u.type = ?1', 'u.role = ?2')); * - * @param mixed $x Optional clause. Defaults to null, but requires - * at least one defined when converting to string. + * @param Expr\Comparison|Expr\Func|Expr\Andx|Expr\Orx|string $x Optional clause. Defaults to null, + * but requires at least one defined + * when converting to string. * * @return Expr\Orx */ From 8230afcde995c4dc8570eeb48a82405392239a47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Paris?= Date: Thu, 6 Aug 2020 21:23:18 +0200 Subject: [PATCH 105/136] Fetch deeper This is needed to preserve parent information and be able to find the merge base with the head branch. The assumption here is that the common ancestor can be found among the 10 parent commits. --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4641a0319a..2db2c83418 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -81,6 +81,8 @@ jobs: steps: - name: "Checkout" uses: "actions/checkout@v2" + with: + fetch-depth: 10 - name: "Install PHP" uses: "shivammathur/setup-php@v2" From 424241f29c65b58a3eb8d2e5869ff653a794bac3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Paris?= Date: Sun, 9 Aug 2020 22:48:52 +0200 Subject: [PATCH 106/136] Use more accurate terminology (#8236) I think this was a mistake when writing this documentation, and that the original author meant to use attribute here, columns do not have columns, they have attributes. --- docs/en/reference/inheritance-mapping.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/reference/inheritance-mapping.rst b/docs/en/reference/inheritance-mapping.rst index 4d21ac73b8..3b29ad8ac2 100644 --- a/docs/en/reference/inheritance-mapping.rst +++ b/docs/en/reference/inheritance-mapping.rst @@ -584,7 +584,7 @@ Things to note: - The "attribute override" specifies the overrides base on the property name. - The column type *CANNOT* be changed. If the column type is not equal you get a ``MappingException`` -- The override can redefine all the columns except the type. +- The override can redefine all the attributes except the type. Query the Type -------------- From 1e2ed077312df7dc45023c6b0085ca653e86f53c Mon Sep 17 00:00:00 2001 From: Simon Podlipsky Date: Wed, 12 Aug 2020 08:38:00 +0200 Subject: [PATCH 107/136] Use consistent formatting in command line (#8238) --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2db2c83418..9ef8c7c246 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -108,4 +108,4 @@ jobs: run: "git remote set-branches --add origin $GITHUB_BASE_REF && git fetch origin $GITHUB_BASE_REF" - name: "Run git-phpcs" - run: "php git-phpcs.phar origin/$GITHUB_BASE_REF...$GITHUB_SHA --report=checkstyle|cs2pr" + run: "php git-phpcs.phar origin/$GITHUB_BASE_REF...$GITHUB_SHA --report=checkstyle | cs2pr" From da18985aca1f93cde5115b357f0f54475bfaf811 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Paris?= Date: Sat, 29 Aug 2020 12:28:40 +0200 Subject: [PATCH 108/136] Stop using the DBAL extension of PHPBench (#8252) It has been removed, and the default XML storage driver is supposed to be fine for our purposes. --- phpbench.json | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/phpbench.json b/phpbench.json index 74fdef412a..f8d71231e8 100644 --- a/phpbench.json +++ b/phpbench.json @@ -3,13 +3,6 @@ "path": "tests/Doctrine/Performance", "extensions": [ - "PhpBench\\Extensions\\Dbal\\DbalExtension", "PhpBench\\Extensions\\XDebug\\XDebugExtension" - ], - - "storage": "dbal", - "storage.dbal.connection": { - "driver": "pdo_sqlite", - "path": "tests/Doctrine/Performance/history.db" - } + ] } From ccae8f717684dcd871b418444d7ca7155c677169 Mon Sep 17 00:00:00 2001 From: Christoph Ziegenberg <1983424+cziegenberg@users.noreply.github.com> Date: Sat, 29 Aug 2020 13:25:18 +0200 Subject: [PATCH 109/136] Fix for bug #8229 (id column from parent class renamed in child class) (#8234) This fixes problems with id columns defined in the parent class but renamed in the child class using an attribute override. Before this change always the child column name was used (which was not present in the parent class), now the correct column names are used for the parent table when creating inserts, joins and deletions for it. Co-authored-by: Crossjoin --- .../ORM/Mapping/ClassMetadataInfo.php | 7 + .../Entity/BasicEntityPersister.php | 50 +++- .../Entity/JoinedSubclassPersister.php | 71 +++-- lib/Doctrine/ORM/Query/SqlWalker.php | 38 ++- lib/Doctrine/ORM/Tools/SchemaTool.php | 11 +- .../ORM/Functional/Ticket/GH8229Test.php | 246 ++++++++++++++++++ 6 files changed, 375 insertions(+), 48 deletions(-) create mode 100644 tests/Doctrine/Tests/ORM/Functional/Ticket/GH8229Test.php diff --git a/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php b/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php index 2a70213a99..6089d389a6 100644 --- a/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php +++ b/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php @@ -30,6 +30,7 @@ use ReflectionClass; use ReflectionProperty; use RuntimeException; +use function array_key_exists; use function explode; /** @@ -2262,6 +2263,12 @@ public function setAttributeOverride($fieldName, array $overrideMapping) throw MappingException::invalidOverrideFieldType($this->name, $fieldName); } + // Fix for bug GH-8229 (id column from parent class renamed in child class): + // The contained 'inherited' information was accidentally deleted by the unset() call below. + if (array_key_exists('inherited', $this->fieldMappings[$fieldName])) { + $overrideMapping['inherited'] = $this->fieldMappings[$fieldName]['inherited']; + } + unset($this->fieldMappings[$fieldName]); unset($this->fieldNames[$mapping['columnName']]); unset($this->columnNames[$mapping['fieldName']]); diff --git a/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php b/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php index 42ec11266e..9a0d5944c0 100644 --- a/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php +++ b/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php @@ -37,6 +37,7 @@ use Doctrine\ORM\UnitOfWork; use Doctrine\ORM\Utility\IdentifierFlattener; use Doctrine\ORM\Utility\PersisterHelper; +use function array_key_exists; use function array_map; use function array_merge; use function assert; @@ -447,14 +448,26 @@ protected final function updateTable($entity, $quotedTableName, array $updateDat $types[] = $this->columnTypes[$columnName]; } - $where = []; - $identifier = $this->em->getUnitOfWork()->getEntityIdentifier($entity); + $where = []; + $identifier = $this->em->getUnitOfWork()->getEntityIdentifier($entity); + $quotedClassTableName = $this->quoteStrategy->getTableName($this->class, $this->platform); foreach ($this->class->identifier as $idField) { if ( ! isset($this->class->associationMappings[$idField])) { - $params[] = $identifier[$idField]; - $types[] = $this->class->fieldMappings[$idField]['type']; - $where[] = $this->quoteStrategy->getColumnName($idField, $this->class, $this->platform); + $params[] = $identifier[$idField]; + $types[] = $this->class->fieldMappings[$idField]['type']; + + // Fix for bug GH-8229 (id column from parent class renamed in child class): + // This method is called with the updated entity, but with different table names + // (the entity table name or a table name of an inherited entity). In dependence + // of the used table, the identifier name must be adjusted. + $class = $this->class; + if (isset($class->fieldMappings[$idField]['inherited']) && $quotedTableName !== $quotedClassTableName) { + $className = $this->class->fieldMappings[$idField]['inherited']; + $class = $this->em->getClassMetadata($className); + } + + $where[] = $this->quoteStrategy->getColumnName($idField, $class, $this->platform); continue; } @@ -632,7 +645,18 @@ protected function prepareUpdateData($entity) $newVal = $change[1]; if ( ! isset($this->class->associationMappings[$field])) { - $fieldMapping = $this->class->fieldMappings[$field]; + $class = $this->class; + + // Fix for bug GH-8229 (id column from parent class renamed in child class): + // Get the correct class metadata + foreach ($class->parentClasses as $parentClassName) { + $parentClass = $this->em->getClassMetadata($parentClassName); + if (array_key_exists($field, $parentClass->fieldMappings)) { + $class = $parentClass; + } + } + + $fieldMapping = $class->fieldMappings[$field]; $columnName = $fieldMapping['columnName']; $this->columnTypes[$columnName] = $fieldMapping['type']; @@ -1672,11 +1696,17 @@ public function getSelectConditionStatementSQL($field, $value, $assoc = null, $c private function getSelectConditionStatementColumnSQL($field, $assoc = null) { if (isset($this->class->fieldMappings[$field])) { - $className = (isset($this->class->fieldMappings[$field]['inherited'])) - ? $this->class->fieldMappings[$field]['inherited'] - : $this->class->name; + // Fix for bug GH-8229 (id column from parent class renamed in child class): + // Use the correct metadata and name for the id column + if (isset($this->class->fieldMappings[$field]['inherited'])) { + $className = $this->class->fieldMappings[$field]['inherited']; + $class = $this->em->getClassMetadata($className); + } else { + $className = $this->class->name; + $class = $this->class; + } - return [$this->getSQLTableAlias($className) . '.' . $this->quoteStrategy->getColumnName($field, $this->class, $this->platform)]; + return [$this->getSQLTableAlias($className) . '.' . $this->quoteStrategy->getColumnName($field, $class, $this->platform)]; } if (isset($this->class->associationMappings[$field])) { diff --git a/lib/Doctrine/ORM/Persisters/Entity/JoinedSubclassPersister.php b/lib/Doctrine/ORM/Persisters/Entity/JoinedSubclassPersister.php index 1f6d40133c..c37611e92d 100644 --- a/lib/Doctrine/ORM/Persisters/Entity/JoinedSubclassPersister.php +++ b/lib/Doctrine/ORM/Persisters/Entity/JoinedSubclassPersister.php @@ -26,6 +26,8 @@ use Doctrine\Common\Collections\Criteria; use Doctrine\ORM\Utility\PersisterHelper; +use function array_combine; +use function array_reverse; /** * The joined subclass persister maps a single entity instance to several tables in the @@ -271,35 +273,42 @@ public function update($entity) public function delete($entity) { $identifier = $this->em->getUnitOfWork()->getEntityIdentifier($entity); - $id = array_combine($this->class->getIdentifierColumnNames(), $identifier); $this->deleteJoinTableRecords($identifier); - // If the database platform supports FKs, just - // delete the row from the root table. Cascades do the rest. - if ($this->platform->supportsForeignKeyConstraints()) { - $rootClass = $this->em->getClassMetadata($this->class->rootEntityName); - $rootTable = $this->quoteStrategy->getTableName($rootClass, $this->platform); - $rootTypes = $this->getClassIdentifiersTypes($rootClass); - - return (bool) $this->conn->delete($rootTable, $id, $rootTypes); - } - - // Delete from all tables individually, starting from this class' table up to the root table. - $rootTable = $this->quoteStrategy->getTableName($this->class, $this->platform); - $rootTypes = $this->getClassIdentifiersTypes($this->class); - - $affectedRows = $this->conn->delete($rootTable, $id, $rootTypes); - - foreach ($this->class->parentClasses as $parentClass) { + // Delete parent entries in reverse order (root first, until the direct parent of the current class). + // + // If foreign key are supported (and set as well as active), the first deletion will cascade and the + // following queries won't delete anything, but it's better not to rely on a possible foreign key + // functionality which cannot be checked here (foreign keys can be missing or disabled although + // supported in general). + // + // On the other hand the supportsForeignKeyConstraints() method of the platform is also not reliable + // when it returns false, because it only means that Doctrine\DBAL doesn't support foreign keys for + // this platform, but they may be set in an existing database structure or added manually, so the + // previous order of deletion (current class to root) would have failed - this could i.e. happen with + // SQLite where foreign keys are theoretically possible but not supported by DBAL. + $deleted = false; + foreach (array_reverse($this->class->parentClasses) as $parentClass) { $parentMetadata = $this->em->getClassMetadata($parentClass); $parentTable = $this->quoteStrategy->getTableName($parentMetadata, $this->platform); $parentTypes = $this->getClassIdentifiersTypes($parentMetadata); + $parentId = array_combine($parentMetadata->getIdentifierColumnNames(), $identifier); - $this->conn->delete($parentTable, $id, $parentTypes); + $affectedRows = $this->conn->delete($parentTable, $parentId, $parentTypes); + $deleted = $deleted ?: ($affectedRows > 0); } - return (bool) $affectedRows; + // Now delete the entries from the current class (if not deleted automatically + // because of a foreign key). + $currentTable = $this->quoteStrategy->getTableName($this->class, $this->platform); + $currentTypes = $this->getClassIdentifiersTypes($this->class); + $currentId = array_combine($this->class->getIdentifierColumnNames(), $identifier); + + $affectedRows = $this->conn->delete($currentTable, $currentId, $currentTypes); + $deleted = $deleted ?: ($affectedRows > 0); + + return $deleted; } /** @@ -412,8 +421,11 @@ protected function getLockTablesSql($lockMode) $parentClass = $this->em->getClassMetadata($parentClassName); $joinSql .= ' INNER JOIN ' . $this->quoteStrategy->getTableName($parentClass, $this->platform) . ' ' . $tableAlias . ' ON '; - foreach ($identifierColumns as $idColumn) { - $conditions[] = $baseTableAlias . '.' . $idColumn . ' = ' . $tableAlias . '.' . $idColumn; + // Fix for bug GH-8229 (id column from parent class renamed in child class): + // Use the correct name for the id column as named in the parent class. + $parentIdentifierColumns = $parentClass->getIdentifierColumnNames(); + foreach ($identifierColumns as $index => $idColumn) { + $conditions[] = $baseTableAlias . '.' . $idColumn . ' = ' . $tableAlias . '.' . $parentIdentifierColumns[$index]; } $joinSql .= implode(' AND ', $conditions); @@ -589,9 +601,11 @@ private function getJoinSql($baseTableAlias) $tableAlias = $this->getSQLTableAlias($parentClassName); $joinSql .= ' INNER JOIN ' . $this->quoteStrategy->getTableName($parentClass, $this->platform) . ' ' . $tableAlias . ' ON '; - - foreach ($identifierColumn as $idColumn) { - $conditions[] = $baseTableAlias . '.' . $idColumn . ' = ' . $tableAlias . '.' . $idColumn; + // Fix for bug GH-8229 (id column from parent class renamed in child class): + // Use the correct name for the id column as named in the parent class. + $parentIdentifierColumn = $parentClass->getIdentifierColumnNames(); + foreach ($identifierColumn as $index => $idColumn) { + $conditions[] = $baseTableAlias . '.' . $idColumn . ' = ' . $tableAlias . '.' . $parentIdentifierColumn[$index]; } $joinSql .= implode(' AND ', $conditions); @@ -604,8 +618,11 @@ private function getJoinSql($baseTableAlias) $tableAlias = $this->getSQLTableAlias($subClassName); $joinSql .= ' LEFT JOIN ' . $this->quoteStrategy->getTableName($subClass, $this->platform) . ' ' . $tableAlias . ' ON '; - foreach ($identifierColumn as $idColumn) { - $conditions[] = $baseTableAlias . '.' . $idColumn . ' = ' . $tableAlias . '.' . $idColumn; + // Fix for bug GH-8229 (id column from parent class renamed in child class): + // Use the correct name for the id column as named in the parent class. + $subClassIdentifierColumn = $subClass->getIdentifierColumnNames(); + foreach ($identifierColumn as $index => $idColumn) { + $conditions[] = $baseTableAlias . '.' . $idColumn . ' = ' . $tableAlias . '.' . $subClassIdentifierColumn[$index]; } $joinSql .= implode(' AND ', $conditions); diff --git a/lib/Doctrine/ORM/Query/SqlWalker.php b/lib/Doctrine/ORM/Query/SqlWalker.php index b25df75910..edfc18eec8 100644 --- a/lib/Doctrine/ORM/Query/SqlWalker.php +++ b/lib/Doctrine/ORM/Query/SqlWalker.php @@ -366,8 +366,12 @@ private function _generateClassTableInheritanceJoins($class, $dqlAlias) $sqlParts = []; - foreach ($this->quoteStrategy->getIdentifierColumnNames($class, $this->platform) as $columnName) { - $sqlParts[] = $baseTableAlias . '.' . $columnName . ' = ' . $tableAlias . '.' . $columnName; + // Fix for bug GH-8229 (id column from parent class renamed in child class): + // Use the correct name for the id column as named in the parent class. + $identifierColumn = $this->quoteStrategy->getIdentifierColumnNames($class, $this->platform); + $parentIdentifierColumn = $this->quoteStrategy->getIdentifierColumnNames($parentClass, $this->platform); + foreach ($identifierColumn as $index => $idColumn) { + $sqlParts[] = $baseTableAlias . '.' . $idColumn . ' = ' . $tableAlias . '.' . $parentIdentifierColumn[$index]; } // Add filters on the root class @@ -661,11 +665,21 @@ public function walkPathExpression($pathExpr) $dqlAlias = $pathExpr->identificationVariable; $class = $this->queryComponents[$dqlAlias]['metadata']; + // Fix for bug GH-8229 (id column from parent class renamed in child class): + // Use the correct name for the id column as named in the inherited class. + $mapping = $class->fieldMappings[$fieldName]; + if (isset($mapping['inherited'])) { + $inheritedClass = $this->em->getClassMetadata($mapping['inherited']); + $quotedColumnName = $this->quoteStrategy->getColumnName($fieldName, $inheritedClass, $this->platform); + } else { + $quotedColumnName = $this->quoteStrategy->getColumnName($fieldName, $class, $this->platform); + } + if ($this->useSqlTableAliases) { $sql .= $this->walkIdentificationVariable($dqlAlias, $fieldName) . '.'; } - $sql .= $this->quoteStrategy->getColumnName($fieldName, $class, $this->platform); + $sql .= $quotedColumnName; break; case AST\PathExpression::TYPE_SINGLE_VALUED_ASSOCIATION: @@ -1405,13 +1419,19 @@ public function walkSelectExpression($selectExpression) continue; } - $tableName = (isset($mapping['inherited'])) - ? $this->em->getClassMetadata($mapping['inherited'])->getTableName() - : $class->getTableName(); + // Fix for bug GH-8229 (id column from parent class renamed in child class): + // Use the correct name for the id column as named in the inherited class. + if (isset($mapping['inherited'])) { + $inheritedClass = $this->em->getClassMetadata($mapping['inherited']); + $tableName = $inheritedClass->getTableName(); + $quotedColumnName = $this->quoteStrategy->getColumnName($fieldName, $inheritedClass, $this->platform); + } else { + $tableName = $class->getTableName(); + $quotedColumnName = $this->quoteStrategy->getColumnName($fieldName, $class, $this->platform); + } - $sqlTableAlias = $this->getSQLTableAlias($tableName, $dqlAlias); - $columnAlias = $this->getSQLColumnAlias($mapping['columnName']); - $quotedColumnName = $this->quoteStrategy->getColumnName($fieldName, $class, $this->platform); + $sqlTableAlias = $this->getSQLTableAlias($tableName, $dqlAlias); + $columnAlias = $this->getSQLColumnAlias($mapping['columnName']); $col = $sqlTableAlias . '.' . $quotedColumnName; diff --git a/lib/Doctrine/ORM/Tools/SchemaTool.php b/lib/Doctrine/ORM/Tools/SchemaTool.php index 0189d2b1f9..3fd36b8afd 100644 --- a/lib/Doctrine/ORM/Tools/SchemaTool.php +++ b/lib/Doctrine/ORM/Tools/SchemaTool.php @@ -31,6 +31,7 @@ use Doctrine\ORM\ORMException; use Doctrine\ORM\Tools\Event\GenerateSchemaTableEventArgs; use Doctrine\ORM\Tools\Event\GenerateSchemaEventArgs; +use function array_intersect_key; /** * The SchemaTool is a tool to create/drop/update database schemas based on @@ -248,14 +249,20 @@ function (ClassMetadata $class) use ($idMapping) : bool { } if ( ! empty($inheritedKeyColumns)) { + // Fix for bug GH-8229 (id column from parent class renamed in child class): + // Use the correct name for the id columns as named in the parent class. + $parentClass = $this->em->getClassMetadata($class->rootEntityName); + $parentKeyColumnNames = $parentClass->getIdentifierColumnNames(); + $parentKeyColumns = array_intersect_key($parentKeyColumnNames, $inheritedKeyColumns); + // Add a FK constraint on the ID column $table->addForeignKeyConstraint( $this->quoteStrategy->getTableName( - $this->em->getClassMetadata($class->rootEntityName), + $parentClass, $this->platform ), $inheritedKeyColumns, - $inheritedKeyColumns, + $parentKeyColumns, ['onDelete' => 'CASCADE'] ); } diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/GH8229Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/GH8229Test.php new file mode 100644 index 0000000000..d07405811c --- /dev/null +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/GH8229Test.php @@ -0,0 +1,246 @@ +setUpEntitySchema( + [ + GH8229Resource::class, + GH8229User::class, + ] + ); + } + + /** + * This tests the basic functionality when working with an entity using joined + * table inheritance and renamed identifier columns. It tests inserts, updates + * and deletions. + */ + public function testCorrectColumnNameInParentClassAfterAttributeOveride() + { + // Test creation + $entity = new GH8229User('foo'); + $identifier = $entity->id; + $this->_em->persist($entity); + $this->_em->flush(); + $this->_em->clear(); + + // Test reading (parent) + $entity = $this->_em->getRepository(GH8229Resource::class)->find($identifier); + self::assertEquals($identifier, $entity->id); + + // Test update (parent) + $entity->status = 2; + $this->_em->persist($entity); + $this->_em->flush(); + $this->_em->clear(); + $entity = $this->_em->getRepository(GH8229Resource::class)->find($identifier); + self::assertEquals(2, $entity->status); + $this->_em->clear(); + + // Test reading (child) + $entity = $this->_em->getRepository(GH8229User::class)->find($identifier); + self::assertEquals($identifier, $entity->id); + + // Test update (child) + $entity->username = 'bar'; + $entity->status = 3; + $this->_em->persist($entity); + $this->_em->flush(); + $this->_em->clear(); + $entity = $this->_em->getRepository(GH8229User::class)->find($identifier); + self::assertEquals('bar', $entity->username); + self::assertEquals(3, $entity->status); + + // Test deletion + $this->_em->remove($entity); + $this->_em->flush(); + $this->_em->clear(); + } + + /** + * This test checks if foreign keys are generated for the schema, when a joined + * table inheritance is used and the identifier columns in the inheriting class + * are renamed. + */ + public function testForeignKeyInChildClassAfterAttributeOveride() + { + $schemaTool = new SchemaTool($this->_em); + + $schema = $schemaTool->getSchemaFromMetadata( + [ + $this->_em->getClassMetadata(GH8229Resource::class), + $this->_em->getClassMetadata(GH8229User::class), + ] + ); + + $childTable = $schema->getTable('gh8229_user'); + $childTableForeignKeys = $childTable->getForeignKeys(); + + self::assertCount(1, $childTableForeignKeys); + } + + /** + * This test checks if data are completely deleted, when a joined table inheritance is used, + * and the DBAL component generally supports foreign keys for the current platform, but the + * foreign keys never existed, have been removed or disabled. + */ + public function testJoinedTableDeletionWithDisabledForeignKeys() + { + // Remove foreign key (if it exists) + $connection = $this->_em->getConnection(); + $platform = $connection->getDatabasePlatform(); + if ($platform->supportsForeignKeyConstraints()) { + $class = $this->_em->getClassMetadata(GH8229User::class); + $table = $this->_schemaTool->getSchemaFromMetadata([$class])->getTable('gh8229_user'); + $foreignKeys = $table->getForeignKeys(); + + // Check if really set (seems to be not the case in MariaDB and MySQL) + if (count($foreignKeys) > 0) { + $statement = $platform->getDropForeignKeySQL(array_values($foreignKeys)[0], $table); + $connection->exec($statement); + } + } + + // Create entity + $entity = new GH8229User('foo'); + $identifier = $entity->id; + $this->_em->persist($entity); + $this->_em->flush(); + $this->_em->clear(); + + // Delete entity + $entity = $this->_em->getRepository(GH8229User::class)->find($identifier); + $this->_em->remove($entity); + $this->_em->flush(); + $this->_em->clear(); + + // Check if the child entry has been really deleted + $result = $connection->executeQuery('SELECT 1 FROM gh8229_user WHERE user_id = ?', [$identifier]); + $foundRows = count($result->fetchAll()); // Note: $result->rowCount() returns 1 instead of 0 in SQLite! + self::assertSame(0, $foundRows); + } + + /** + * This test checks the SQL generated for a DQL, because in the SELECT part, the JOIN part + * and the ORDER BY part the wrong column names were used. + */ + public function testCorrectColumnNamesInSQLFromDQL() + { + // Create entity + $entity = new GH8229User('foo'); + $identifier = $entity->id; + $this->_em->persist($entity); + $this->_em->flush(); + $this->_em->clear(); + + // Query entity + $dql = 'SELECT o FROM Doctrine\Tests\ORM\Functional\Ticket\GH8229User o WHERE o.id = :id GROUP BY o.id, o.username ORDER BY o.id ASC'; + $query = $this->_em->createQuery($dql); + $query = $query->setParameter('id', $identifier); + self::assertEquals($identifier, $query->getSingleResult()->id); + + // Delete entity + $entity = $this->_em->getRepository(GH8229User::class)->find($identifier); + $this->_em->remove($entity); + $this->_em->flush(); + $this->_em->clear(); + } + + /** + * This test checks the the right columns are used when creating a pessimistic write lock + * for an entity with joined table inheritance. + */ + public function testCorrectColumnNamesInPessimisticWriteLock() + { + // Create entity + $entity = new GH8229User('foo'); + $identifier = $entity->id; + $this->_em->persist($entity); + $this->_em->flush(); + + // Test lock + $this->_em->getConnection()->beginTransaction(); + $this->_em->lock($entity, LockMode::PESSIMISTIC_WRITE); + $this->_em->getConnection()->commit(); + $this->_em->clear(); + + self::assertEquals($identifier, $entity->id); + } +} + + +/** + * @Entity + * @Table(name="gh8229_resource") + * @InheritanceType("JOINED") + * @DiscriminatorColumn(name="resource_type", type="string", length=191) + * @DiscriminatorMap({ + * "resource"=GH8229Resource::class, + * "user"=GH8229User::class, + * }) + */ +abstract class GH8229Resource +{ + /** + * @Id() + * @Column(name="resource_id", type="integer") + */ + public $id; + + /** + * Additional property to test update + * + * @Column(type="integer", name="resource_status", nullable=false) + */ + public $status; + + private static $sequence = 0; + + protected function __construct() + { + $this->id = ++self::$sequence; + $this->status = 1; + } +} + +/** + * @Entity + * @Table(name="gh8229_user") + * @AttributeOverrides({ + * @AttributeOverride(name="id", column=@Column(name="user_id", type="integer")), + * @AttributeOverride(name="status", column=@Column(name="user_status", type="integer")) + * }) + */ +final class GH8229User extends GH8229Resource +{ + /** + * Additional property to test update + * + * @Column(type="string", name="username", length=191, nullable=false) + */ + public $username; + + public function __construct($username) + { + parent::__construct(); + + $this->username = $username; + } +} From 717ef9106c99abf10ef6dca8091e32ea3fb77a46 Mon Sep 17 00:00:00 2001 From: Thomas Landauer Date: Thu, 3 Sep 2020 22:44:28 +0200 Subject: [PATCH 110/136] Update events.rst (#8257) * Update events.rst Improved code formatting * Update docs/en/reference/events.rst I was wondering myself what the `#` was about ;-) Co-authored-by: Claudio Zizza <859964+SenseException@users.noreply.github.com> * Update events.rst See https://github.com/doctrine/orm/pull/8257#discussion_r482305774 Co-authored-by: Claudio Zizza <859964+SenseException@users.noreply.github.com> --- docs/en/reference/events.rst | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/docs/en/reference/events.rst b/docs/en/reference/events.rst index e4aab3e139..073e507f96 100644 --- a/docs/en/reference/events.rst +++ b/docs/en/reference/events.rst @@ -151,24 +151,24 @@ the life-time of their registered entities. - preRemove - The preRemove event occurs for a given entity before the respective EntityManager remove operation for that entity is - executed. It is not called for a DQL DELETE statement. -- postRemove - The postRemove event occurs for an entity after the + executed. It is not called for a DQL ``DELETE`` statement. +- postRemove - The postRemove event occurs after the entity has been deleted. It will be invoked after the database - delete operations. It is not called for a DQL DELETE statement. -- prePersist - The prePersist event occurs for a given entity - before the respective EntityManager persist operation for that - entity is executed. It should be noted that this event is only triggered on + ``DELETE`` operation. It is not called for a DQL ``DELETE`` statement. +- prePersist - The prePersist event occurs + before the EntityManager persist operation for an + entity is executed. This event is only triggered on *initial* persist of an entity (i.e. it does not trigger on future updates). -- postPersist - The postPersist event occurs for an entity after - the entity has been made persistent. It will be invoked after the - database insert operations. Generated primary key values are +- postPersist - The postPersist event occurs after + an entity has been made persistent. It will be invoked after the + database ``INSERT`` operation. Generated primary key values are available in the postPersist event. - preUpdate - The preUpdate event occurs before the database - update operations to entity data. It is not called for a DQL UPDATE statement + ``UPDATE`` operation. It is not called for a DQL ``UPDATE`` statement nor when the computed changeset is empty. - postUpdate - The postUpdate event occurs after the database - update operations to entity data. It is not called for a DQL UPDATE statement. -- postLoad - The postLoad event occurs for an entity after the + ``UPDATE`` operation. It is not called for a DQL ``UPDATE`` statement. +- postLoad - The postLoad event occurs after an entity has been loaded into the current EntityManager from the database or after the refresh operation has been applied to it. - loadClassMetadata - The loadClassMetadata event occurs after the @@ -185,7 +185,7 @@ the life-time of their registered entities. callback. - postFlush - The postFlush event occurs at the end of a flush operation. This event is not a lifecycle callback. -- onClear - The onClear event occurs when the EntityManager#clear() operation is +- onClear - The onClear event occurs when the ``EntityManager::clear()`` operation is invoked, after all references to entities have been removed from the unit of work. This event is not a lifecycle callback. @@ -991,4 +991,3 @@ process and manipulate the instance. } } - From ab2b4987b3530da787a518d49d354d6d9d29054d Mon Sep 17 00:00:00 2001 From: Yohann Durand Date: Tue, 8 Sep 2020 20:56:51 +0200 Subject: [PATCH 111/136] Improve formatting (#8028) --- docs/en/reference/events.rst | 92 +++++++++++++++++++----------------- 1 file changed, 48 insertions(+), 44 deletions(-) diff --git a/docs/en/reference/events.rst b/docs/en/reference/events.rst index 073e507f96..7aa0fcffca 100644 --- a/docs/en/reference/events.rst +++ b/docs/en/reference/events.rst @@ -145,49 +145,53 @@ An example for a correct notation can be found in the example Lifecycle Events ---------------- -The EntityManager and UnitOfWork trigger a bunch of events during -the life-time of their registered entities. +The ``EntityManager`` and ``UnitOfWork`` classes trigger a bunch of +events during the life-time of their registered entities. -- preRemove - The preRemove event occurs for a given entity before - the respective EntityManager remove operation for that entity is - executed. It is not called for a DQL ``DELETE`` statement. -- postRemove - The postRemove event occurs after the + +- ``preRemove`` - The ``preRemove`` event occurs for a given entity + before the respective ``EntityManager`` remove operation for that + entity is executed. It is not called for a DQL ``DELETE`` statement. +- ``postRemove`` - The ``postRemove`` event occurs for an entity after the entity has been deleted. It will be invoked after the database - ``DELETE`` operation. It is not called for a DQL ``DELETE`` statement. -- prePersist - The prePersist event occurs - before the EntityManager persist operation for an - entity is executed. This event is only triggered on + delete operations. It is not called for a DQL ``DELETE`` statement. +- ``prePersist`` - The ``prePersist`` event occurs for a given entity + before the respective ``EntityManager`` persist operation for that + entity is executed. It should be noted that this event is only triggered on *initial* persist of an entity (i.e. it does not trigger on future updates). -- postPersist - The postPersist event occurs after - an entity has been made persistent. It will be invoked after the - database ``INSERT`` operation. Generated primary key values are +- ``postPersist`` - The ``postPersist`` event occurs for an entity after + the entity has been made persistent. It will be invoked after the + database insert operations. Generated primary key values are available in the postPersist event. -- preUpdate - The preUpdate event occurs before the database - ``UPDATE`` operation. It is not called for a DQL ``UPDATE`` statement - nor when the computed changeset is empty. -- postUpdate - The postUpdate event occurs after the database - ``UPDATE`` operation. It is not called for a DQL ``UPDATE`` statement. -- postLoad - The postLoad event occurs after an - entity has been loaded into the current EntityManager from the +- ``preUpdate`` - The ``preUpdate`` event occurs before the database + update operations to entity data. It is not called for a DQL + ``UPDATE`` statement nor when the computed changeset is empty. +- ``postUpdate`` - The ``postUpdate`` event occurs after the database + update operations to entity data. It is not called for a DQL + ``UPDATE`` statement. +- ``postLoad`` - The postLoad event occurs for an entity after the + entity has been loaded into the current ``EntityManager`` from the database or after the refresh operation has been applied to it. -- loadClassMetadata - The loadClassMetadata event occurs after the +- ``loadClassMetadata`` - The ``loadClassMetadata`` event occurs after the mapping metadata for a class has been loaded from a mapping source (annotations/xml/yaml). This event is not a lifecycle callback. -- onClassMetadataNotFound - Loading class metadata for a particular +- ``onClassMetadataNotFound`` - Loading class metadata for a particular requested class name failed. Manipulating the given event args instance allows providing fallback metadata even when no actual metadata exists or could be found. This event is not a lifecycle callback. -- preFlush - The preFlush event occurs at the very beginning of a flush - operation. -- onFlush - The onFlush event occurs after the change-sets of all +- ``preFlush`` - The ``preFlush`` event occurs at the very beginning of + a flush operation. +- ``onFlush`` - The ``onFlush`` event occurs after the change-sets of all managed entities are computed. This event is not a lifecycle callback. -- postFlush - The postFlush event occurs at the end of a flush operation. This +- ``postFlush`` - The ``postFlush`` event occurs at the end of a flush operation. This event is not a lifecycle callback. -- onClear - The onClear event occurs when the ``EntityManager::clear()`` operation is - invoked, after all references to entities have been removed from the unit of - work. This event is not a lifecycle callback. +- ``onClear`` - The ``onClear`` event occurs when the + ``EntityManager#clear()`` operation is invoked, after all references + to entities have been removed from the unit of work. This event is not + a lifecycle callback. + .. warning:: @@ -199,7 +203,7 @@ the life-time of their registered entities. .. warning:: - Note that the postRemove event or any events triggered after an entity removal + Note that the ``postRemove`` event or any events triggered after an entity removal can receive an uninitializable proxy in case you have configured an entity to cascade remove relations. In this case, you should load yourself the proxy in the associated pre event. @@ -222,13 +226,13 @@ listeners: - Lifecycle Event Listeners and Subscribers are classes with specific callback methods that receives some kind of ``EventArgs`` instance. -The EventArgs instance received by the listener gives access to the entity, -EntityManager and other relevant data. +The ``EventArgs`` instance received by the listener gives access to the entity, +``EntityManager`` instance and other relevant data. .. note:: All Lifecycle events that happen during the ``flush()`` of - an EntityManager have very specific constraints on the allowed + an ``EntityManager`` have very specific constraints on the allowed operations that can be executed. Please read the :ref:`reference-events-implementing-listeners` section very carefully to understand which operations are allowed in which lifecycle event. @@ -410,9 +414,9 @@ sit at a level above the entities and allow you to implement re-usable behaviors across different entity classes. Note that they require much more detailed knowledge about the inner -workings of the EntityManager and UnitOfWork. Please read the -:ref:`reference-events-implementing-listeners` section carefully if you -are trying to write your own listener. +workings of the ``EntityManager`` and ``UnitOfWork`` classes. Please +read the :ref:`reference-events-implementing-listeners` section +carefully if you are trying to write your own listener. For event subscribers, there are no surprises. They declare the lifecycle events in their ``getSubscribedEvents`` method and provide @@ -501,16 +505,16 @@ Implementing Event Listeners ---------------------------- This section explains what is and what is not allowed during -specific lifecycle events of the UnitOfWork. Although you get -passed the EntityManager in all of these events, you have to follow -these restrictions very carefully since operations in the wrong -event may produce lots of different errors, such as inconsistent +specific lifecycle events of the ``UnitOfWork`` class. Although you get +passed the ``EntityManager`` instance in all of these events, you have +to follow these restrictions very carefully since operations in the +wrong event may produce lots of different errors, such as inconsistent data and lost updates/persists/removes. For the described events that are also lifecycle callback events the restrictions apply as well, with the additional restriction that (prior to version 2.4) you do not have access to the -EntityManager or UnitOfWork APIs inside these events. +``EntityManager`` or ``UnitOfWork`` APIs inside these events. prePersist ~~~~~~~~~~ @@ -586,8 +590,8 @@ entities and their associations have been computed. This means, the - Collections scheduled for update - Collections scheduled for removal -To make use of the onFlush event you have to be familiar with the -internal UnitOfWork API, which grants you access to the previously +To make use of the ``onFlush`` event you have to be familiar with the +internal ``UnitOfWork`` API, which grants you access to the previously mentioned sets. See this example: .. code-block:: php @@ -735,7 +739,7 @@ Restrictions for this event: the event to modify primitive field values, e.g. use ``$eventArgs->setNewValue($field, $value);`` as in the Alice to Bob example above. - Any calls to ``EntityManager#persist()`` or - ``EntityManager#remove()``, even in combination with the UnitOfWork + ``EntityManager#remove()``, even in combination with the ``UnitOfWork`` API are strongly discouraged and don't work as expected outside the flush operation. From 706670215d4d59c4443aeb8542a4d1319c11fe14 Mon Sep 17 00:00:00 2001 From: Guillaume Simon Date: Sun, 20 Sep 2020 18:56:57 +0200 Subject: [PATCH 112/136] Fix OrderByItem parser to proceed with SimpleArithmetic expression before function (#8277) There is parser bug for OrderByItem(), where a function is detected before a SimpleArithmeticExpression while it should be the reverse: simple arithmetic expressions can start with a function too, and thus they should be matched first if present. This fix enables the use of expressions in sorting and with window functions. --- lib/Doctrine/ORM/Query/Parser.php | 8 ++++---- .../Doctrine/Tests/ORM/Query/SelectSqlGenerationTest.php | 9 +++++++++ 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/lib/Doctrine/ORM/Query/Parser.php b/lib/Doctrine/ORM/Query/Parser.php index 3fe1eb04f4..696fe7f1e1 100644 --- a/lib/Doctrine/ORM/Query/Parser.php +++ b/lib/Doctrine/ORM/Query/Parser.php @@ -1510,10 +1510,6 @@ public function OrderByItem() $glimpse = $this->lexer->glimpse(); switch (true) { - case ($this->isFunction()): - $expr = $this->FunctionDeclaration(); - break; - case ($this->isMathOperator($peek)): $expr = $this->SimpleArithmeticExpression(); break; @@ -1526,6 +1522,10 @@ public function OrderByItem() $expr = $this->ScalarExpression(); break; + case $this->isFunction(): + $expr = $this->FunctionDeclaration(); + break; + default: $expr = $this->ResultVariable(); break; diff --git a/tests/Doctrine/Tests/ORM/Query/SelectSqlGenerationTest.php b/tests/Doctrine/Tests/ORM/Query/SelectSqlGenerationTest.php index 2c3435fdbd..92ba2fe0dd 100644 --- a/tests/Doctrine/Tests/ORM/Query/SelectSqlGenerationTest.php +++ b/tests/Doctrine/Tests/ORM/Query/SelectSqlGenerationTest.php @@ -281,6 +281,7 @@ public function testSupportsOrderByAsc() 'SELECT f0_.id AS id_0, f0_.username AS username_1 FROM forum_users f0_ ORDER BY f0_.id ASC' ); } + public function testSupportsOrderByDesc() { $this->assertSqlGeneration( @@ -289,6 +290,14 @@ public function testSupportsOrderByDesc() ); } + public function testSupportsOrderByWithSimpleArithmeticExpression() : void + { + $this->assertSqlGeneration( + 'SELECT u FROM Doctrine\Tests\Models\Forum\ForumUser u ORDER BY LENGTH(u.username) + LENGTH(u.username) asc', + 'SELECT f0_.id AS id_0, f0_.username AS username_1 FROM forum_users f0_ ORDER BY LENGTH(f0_.username) + LENGTH(f0_.username) ASC' + ); + } + public function testSupportsSelectDistinct() { $this->assertSqlGeneration( From 107ba93d79b3e4dc9a8b0b7903245ed738a811a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Mon, 21 Sep 2020 22:51:49 +0200 Subject: [PATCH 113/136] Convert CRLF to LF in test file (#8276) * Convert CRLF to LF in test file * fix cs --- .../ORM/Functional/Ticket/DDC2074Test.php | 126 +++++++++--------- 1 file changed, 65 insertions(+), 61 deletions(-) diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2074Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2074Test.php index ed77ba1346..0456adc50e 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2074Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2074Test.php @@ -1,61 +1,65 @@ -useModelSet('ecommerce'); - parent::setUp(); - } - - public function testShouldNotScheduleDeletionOnClonedInstances() - { - $class = $this->_em->getClassMetadata(ECommerceProduct::class); - $product = new ECommerceProduct(); - $category = new ECommerceCategory(); - $collection = new PersistentCollection($this->_em, $class, new ArrayCollection([$category])); - $collection->setOwner($product, $class->associationMappings['categories']); - - $uow = $this->_em->getUnitOfWork(); - $clonedCollection = clone $collection; - $clonedCollection->clear(); - - $this->assertEquals(0, count($uow->getScheduledCollectionDeletions())); - } - - public function testSavingClonedPersistentCollection() - { - $product = new ECommerceProduct(); - $category = new ECommerceCategory(); - $category->setName('foo'); - $product->addCategory($category); - - $this->_em->persist($product); - $this->_em->persist($category); - $this->_em->flush(); - - $newProduct = clone $product; - - $this->_em->persist($newProduct); - $this->_em->flush(); - $this->_em->clear(); - - $product1 = $this->_em->find(ECommerceProduct::class, $product->getId()); - $product2 = $this->_em->find(ECommerceProduct::class, $newProduct->getId()); - - $this->assertCount(1, $product1->getCategories()); - $this->assertCount(1, $product2->getCategories()); - - $this->assertSame($product1->getCategories()->get(0), $product2->getCategories()->get(0)); - } -} +useModelSet('ecommerce'); + parent::setUp(); + } + + public function testShouldNotScheduleDeletionOnClonedInstances() + { + $class = $this->_em->getClassMetadata(ECommerceProduct::class); + $product = new ECommerceProduct(); + $category = new ECommerceCategory(); + $collection = new PersistentCollection($this->_em, $class, new ArrayCollection([$category])); + $collection->setOwner($product, $class->associationMappings['categories']); + + $uow = $this->_em->getUnitOfWork(); + $clonedCollection = clone $collection; + $clonedCollection->clear(); + + $this->assertEquals(0, count($uow->getScheduledCollectionDeletions())); + } + + public function testSavingClonedPersistentCollection() + { + $product = new ECommerceProduct(); + $category = new ECommerceCategory(); + $category->setName('foo'); + $product->addCategory($category); + + $this->_em->persist($product); + $this->_em->persist($category); + $this->_em->flush(); + + $newProduct = clone $product; + + $this->_em->persist($newProduct); + $this->_em->flush(); + $this->_em->clear(); + + $product1 = $this->_em->find(ECommerceProduct::class, $product->getId()); + $product2 = $this->_em->find(ECommerceProduct::class, $newProduct->getId()); + + $this->assertCount(1, $product1->getCategories()); + $this->assertCount(1, $product2->getCategories()); + + $this->assertSame($product1->getCategories()->get(0), $product2->getCategories()->get(0)); + } +} From d810ea4111924bff4c718c558903ce8ac5dff1a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Paris?= Date: Tue, 22 Sep 2020 20:10:05 +0200 Subject: [PATCH 114/136] Use inline literals over escaping (#8279) Escaping underscores does not work as expected. See https://www.doctrine-project.org/projects/doctrine-orm/en/latest/cookbook/dql-custom-walkers.html#modify-the-output-walker-to-generate-vendor-specific-sql --- docs/en/cookbook/dql-custom-walkers.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/en/cookbook/dql-custom-walkers.rst b/docs/en/cookbook/dql-custom-walkers.rst index e840126db3..ebb79272e1 100644 --- a/docs/en/cookbook/dql-custom-walkers.rst +++ b/docs/en/cookbook/dql-custom-walkers.rst @@ -167,7 +167,7 @@ can be set via ``Query::setHint($name, $value)`` as shown in the previous example with the ``HINT_CUSTOM_TREE_WALKERS`` query hint. We will implement a custom Output Walker that allows to specify the -SQL\_NO\_CACHE query hint. +``SQL_NO_CACHE`` query hint. .. code-block:: php @@ -180,7 +180,7 @@ SQL\_NO\_CACHE query hint. Our ``MysqlWalker`` will extend the default ``SqlWalker``. We will modify the generation of the SELECT clause, adding the -SQL\_NO\_CACHE on those queries that need it: +``SQL_NO_CACHE`` on those queries that need it: .. code-block:: php From f4524a8bb0a95f544e4469d7940f7d558b8598d8 Mon Sep 17 00:00:00 2001 From: orklah Date: Fri, 25 Sep 2020 20:44:07 +0200 Subject: [PATCH 115/136] Fix psalm errors and upgrade strictness (#8209) * Fixes and improvements * fix param type --- lib/Doctrine/ORM/AbstractQuery.php | 12 ++++++++---- lib/Doctrine/ORM/Cache/DefaultCache.php | 3 --- .../Collection/AbstractCollectionPersister.php | 2 +- .../Persister/Entity/AbstractEntityPersister.php | 11 +++++------ .../NonStrictReadWriteCachedEntityPersister.php | 6 ++++++ lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php | 3 --- lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php | 2 -- lib/Doctrine/ORM/ORMException.php | 2 +- .../Persisters/Collection/ManyToManyPersister.php | 9 +++------ .../ORM/Persisters/Entity/BasicEntityPersister.php | 4 +++- lib/Doctrine/ORM/Query/Expr.php | 2 +- lib/Doctrine/ORM/Query/Expr/Composite.php | 2 +- lib/Doctrine/ORM/Query/SqlWalker.php | 4 +++- .../ORM/Repository/DefaultRepositoryFactory.php | 1 - .../ORM/Tools/AttachEntityListenersListener.php | 1 - .../ORM/Tools/Export/Driver/AbstractExporter.php | 8 ++++++++ lib/Doctrine/ORM/Tools/Pagination/Paginator.php | 2 -- .../ORM/Tools/ResolveTargetEntityListener.php | 1 - lib/Doctrine/ORM/Tools/SchemaTool.php | 1 - psalm.xml | 2 +- tests/Doctrine/Tests/Mocks/CacheRegionMock.php | 3 --- .../Tests/Models/ManyToManyPersister/ChildClass.php | 1 + .../Tests/Models/ManyToManyPersister/ParentClass.php | 1 + .../Tests/ORM/Functional/Ticket/DDC2138Test.php | 2 +- .../Tests/ORM/Functional/Ticket/GH7062Test.php | 1 + 25 files changed, 45 insertions(+), 41 deletions(-) diff --git a/lib/Doctrine/ORM/AbstractQuery.php b/lib/Doctrine/ORM/AbstractQuery.php index 71c32a6cb6..0bb2ce8d9b 100644 --- a/lib/Doctrine/ORM/AbstractQuery.php +++ b/lib/Doctrine/ORM/AbstractQuery.php @@ -72,6 +72,7 @@ abstract class AbstractQuery * The parameter map of this query. * * @var ArrayCollection|Parameter[] + * @psalm-var ArrayCollection */ protected $parameters; @@ -340,6 +341,8 @@ function (Query\Parameter $parameter) use ($key) : bool { * @param ArrayCollection|mixed[] $parameters * * @return static This query instance. + * + * @psalm-param ArrayCollection|mixed[] $parameters */ public function setParameters($parameters) { @@ -470,7 +473,7 @@ protected function getResultSetMapping() */ private function translateNamespaces(Query\ResultSetMapping $rsm) { - $translate = function ($alias) { + $translate = function ($alias) : string { return $this->_em->getClassMetadata($alias)->getName(); }; @@ -631,7 +634,7 @@ public function disableResultCache() : self /** * Defines how long the result cache will be active before expire. * - * @param integer $lifetime How long the cache entry is valid. + * @param int|null $lifetime How long the cache entry is valid. * * @return static This query instance. */ @@ -966,7 +969,8 @@ private function executeIgnoreQueryCache($parameters = null, $hydrationMode = nu $this->setParameters($parameters); } - $setCacheEntry = function() {}; + $setCacheEntry = static function () : void { + }; if ($this->_hydrationCacheProfile !== null) { [$cacheKey, $realCacheKey] = $this->getHydrationCacheId(); @@ -983,7 +987,7 @@ private function executeIgnoreQueryCache($parameters = null, $hydrationMode = nu $result = []; } - $setCacheEntry = function($data) use ($cache, $result, $cacheKey, $realCacheKey, $queryCacheProfile) { + $setCacheEntry = static function ($data) use ($cache, $result, $cacheKey, $realCacheKey, $queryCacheProfile) : void { $result[$realCacheKey] = $data; $cache->save($cacheKey, $result, $queryCacheProfile->getLifetime()); diff --git a/lib/Doctrine/ORM/Cache/DefaultCache.php b/lib/Doctrine/ORM/Cache/DefaultCache.php index 80fbd81438..9c93ddd7e1 100644 --- a/lib/Doctrine/ORM/Cache/DefaultCache.php +++ b/lib/Doctrine/ORM/Cache/DefaultCache.php @@ -60,9 +60,6 @@ class DefaultCache implements Cache */ private $defaultQueryCache; - /** - * {@inheritdoc} - */ public function __construct(EntityManagerInterface $em) { $this->em = $em; diff --git a/lib/Doctrine/ORM/Cache/Persister/Collection/AbstractCollectionPersister.php b/lib/Doctrine/ORM/Cache/Persister/Collection/AbstractCollectionPersister.php index c13c20774a..cad22555fe 100644 --- a/lib/Doctrine/ORM/Cache/Persister/Collection/AbstractCollectionPersister.php +++ b/lib/Doctrine/ORM/Cache/Persister/Collection/AbstractCollectionPersister.php @@ -144,7 +144,7 @@ public function getTargetEntityMetadata() * @param \Doctrine\ORM\PersistentCollection $collection * @param \Doctrine\ORM\Cache\CollectionCacheKey $key * - * @return \Doctrine\ORM\PersistentCollection|null + * @return object[]|null */ public function loadCollectionCache(PersistentCollection $collection, CollectionCacheKey $key) { diff --git a/lib/Doctrine/ORM/Cache/Persister/Entity/AbstractEntityPersister.php b/lib/Doctrine/ORM/Cache/Persister/Entity/AbstractEntityPersister.php index 3fdc969630..a2fd0bfe3d 100644 --- a/lib/Doctrine/ORM/Cache/Persister/Entity/AbstractEntityPersister.php +++ b/lib/Doctrine/ORM/Cache/Persister/Entity/AbstractEntityPersister.php @@ -283,11 +283,11 @@ private function storeJoinedAssociations($entity) /** * Generates a string of currently query * - * @param array $query - * @param string $criteria - * @param array $orderBy - * @param integer $limit - * @param integer $offset + * @param string $query + * @param string[]|Criteria $criteria + * @param string[] $orderBy + * @param int $limit + * @param int $offset * * @return string */ @@ -548,7 +548,6 @@ public function loadManyToManyCollection(array $assoc, $sourceEntity, Persistent { $persister = $this->uow->getCollectionPersister($assoc); $hasCache = ($persister instanceof CachedPersister); - $key = null; if ( ! $hasCache) { return $this->persister->loadManyToManyCollection($assoc, $sourceEntity, $coll); diff --git a/lib/Doctrine/ORM/Cache/Persister/Entity/NonStrictReadWriteCachedEntityPersister.php b/lib/Doctrine/ORM/Cache/Persister/Entity/NonStrictReadWriteCachedEntityPersister.php index a2844673be..4ced02192f 100644 --- a/lib/Doctrine/ORM/Cache/Persister/Entity/NonStrictReadWriteCachedEntityPersister.php +++ b/lib/Doctrine/ORM/Cache/Persister/Entity/NonStrictReadWriteCachedEntityPersister.php @@ -100,6 +100,12 @@ public function update($entity) $this->queuedCache['update'][] = $entity; } + /** + * @param object $entity + * @param bool $isChanged + * + * @return bool + */ private function updateCache($entity, $isChanged) { $class = $this->metadataFactory->getMetadataFor(get_class($entity)); diff --git a/lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php b/lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php index d864bf9ea8..e8963a9940 100644 --- a/lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php +++ b/lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php @@ -274,7 +274,6 @@ public function loadMetadataForClass($className, ClassMetadata $metadata) } // Evaluate annotations on properties/fields - /* @var $property \ReflectionProperty */ foreach ($class->getProperties() as $property) { if ($metadata->isMappedSuperclass && ! $property->isPrivate() || @@ -505,7 +504,6 @@ public function loadMetadataForClass($className, ClassMetadata $metadata) $hasMapping = false; $listenerClass = new \ReflectionClass($listenerClassName); - /* @var $method \ReflectionMethod */ foreach ($listenerClass->getMethods(\ReflectionMethod::IS_PUBLIC) as $method) { // find method callbacks. $callbacks = $this->getMethodCallbacks($method); @@ -525,7 +523,6 @@ public function loadMetadataForClass($className, ClassMetadata $metadata) // Evaluate @HasLifecycleCallbacks annotation if (isset($classAnnotations[Mapping\HasLifecycleCallbacks::class])) { - /* @var $method \ReflectionMethod */ foreach ($class->getMethods(\ReflectionMethod::IS_PUBLIC) as $method) { foreach ($this->getMethodCallbacks($method) as $value) { $metadata->addLifecycleCallback($value[0], $value[1]); diff --git a/lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php b/lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php index 2c42500356..b9cecf3393 100644 --- a/lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php +++ b/lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php @@ -677,7 +677,6 @@ private function _parseOptions(SimpleXMLElement $options) { $array = []; - /* @var $option SimpleXMLElement */ foreach ($options as $option) { if ($option->count()) { $value = $this->_parseOptions($option->children()); @@ -851,7 +850,6 @@ private function cacheToArray(SimpleXMLElement $cacheMapping) private function _getCascadeMappings(SimpleXMLElement $cascadeElement) { $cascades = []; - /* @var $action SimpleXmlElement */ foreach ($cascadeElement->children() as $action) { // According to the JPA specifications, XML uses "cascade-persist" // instead of "persist". Here, both variations diff --git a/lib/Doctrine/ORM/ORMException.php b/lib/Doctrine/ORM/ORMException.php index 2712ed9244..689b5be288 100644 --- a/lib/Doctrine/ORM/ORMException.php +++ b/lib/Doctrine/ORM/ORMException.php @@ -110,7 +110,7 @@ public static function unrecognizedField($field) * @param string $given * @param string $expected * - * @return \Doctrine\ORM\ORMInvalidArgumentException + * @return \Doctrine\ORM\ORMException */ public static function unexpectedAssociationValue($class, $association, $given, $expected) { diff --git a/lib/Doctrine/ORM/Persisters/Collection/ManyToManyPersister.php b/lib/Doctrine/ORM/Persisters/Collection/ManyToManyPersister.php index 7a1dfb1af9..2cd6c3f6f2 100644 --- a/lib/Doctrine/ORM/Persisters/Collection/ManyToManyPersister.php +++ b/lib/Doctrine/ORM/Persisters/Collection/ManyToManyPersister.php @@ -373,9 +373,7 @@ protected function getOnConditionSQL($mapping) } /** - * {@inheritdoc} - * - * @override + * @return string */ protected function getDeleteSQL(PersistentCollection $collection) { @@ -393,10 +391,9 @@ protected function getDeleteSQL(PersistentCollection $collection) } /** - * {@inheritdoc} - * * Internal note: Order of the parameters must be the same as the order of the columns in getDeleteSql. - * @override + * + * @return mixed[] */ protected function getDeleteSQLParameters(PersistentCollection $collection) { diff --git a/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php b/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php index 9a0d5944c0..9b8bdc92dc 100644 --- a/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php +++ b/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php @@ -2071,7 +2071,9 @@ protected function getJoinSQLForJoinColumns($joinColumns) } /** - * {@inheritdoc} + * @param string $columnName + * + * @return string */ public function getSQLColumnAlias($columnName) { diff --git a/lib/Doctrine/ORM/Query/Expr.php b/lib/Doctrine/ORM/Query/Expr.php index 59f833993c..0973a032ae 100644 --- a/lib/Doctrine/ORM/Query/Expr.php +++ b/lib/Doctrine/ORM/Query/Expr.php @@ -629,7 +629,7 @@ private function _quoteLiteral($literal) * @param integer|string $x Starting range value to be used in BETWEEN() function. * @param integer|string $y End point value to be used in BETWEEN() function. * - * @return Expr\Func A BETWEEN expression. + * @return string A BETWEEN expression. */ public function between($val, $x, $y) { diff --git a/lib/Doctrine/ORM/Query/Expr/Composite.php b/lib/Doctrine/ORM/Query/Expr/Composite.php index 6b8a04fa5c..635d8aa8fe 100644 --- a/lib/Doctrine/ORM/Query/Expr/Composite.php +++ b/lib/Doctrine/ORM/Query/Expr/Composite.php @@ -49,7 +49,7 @@ public function __toString() } /** - * @param string $part + * @param string|object $part * * @return string */ diff --git a/lib/Doctrine/ORM/Query/SqlWalker.php b/lib/Doctrine/ORM/Query/SqlWalker.php index edfc18eec8..f058830515 100644 --- a/lib/Doctrine/ORM/Query/SqlWalker.php +++ b/lib/Doctrine/ORM/Query/SqlWalker.php @@ -2100,7 +2100,9 @@ public function walkInstanceOfExpression($instanceOfExpr) } /** - * {@inheritdoc} + * @param mixed $inParam + * + * @return string */ public function walkInParameter($inParam) { diff --git a/lib/Doctrine/ORM/Repository/DefaultRepositoryFactory.php b/lib/Doctrine/ORM/Repository/DefaultRepositoryFactory.php index 9d4da0d3b7..ddd4c1a63b 100644 --- a/lib/Doctrine/ORM/Repository/DefaultRepositoryFactory.php +++ b/lib/Doctrine/ORM/Repository/DefaultRepositoryFactory.php @@ -61,7 +61,6 @@ public function getRepository(EntityManagerInterface $entityManager, $entityName */ private function createRepository(EntityManagerInterface $entityManager, $entityName) { - /* @var $metadata \Doctrine\ORM\Mapping\ClassMetadata */ $metadata = $entityManager->getClassMetadata($entityName); $repositoryClassName = $metadata->customRepositoryClassName ?: $entityManager->getConfiguration()->getDefaultRepositoryClassName(); diff --git a/lib/Doctrine/ORM/Tools/AttachEntityListenersListener.php b/lib/Doctrine/ORM/Tools/AttachEntityListenersListener.php index b78ec9645e..f05c52226d 100644 --- a/lib/Doctrine/ORM/Tools/AttachEntityListenersListener.php +++ b/lib/Doctrine/ORM/Tools/AttachEntityListenersListener.php @@ -64,7 +64,6 @@ public function addEntityListener($entityClass, $listenerClass, $eventName, $lis */ public function loadClassMetadata(LoadClassMetadataEventArgs $event) { - /** @var ClassMetadata $metadata */ $metadata = $event->getClassMetadata(); if ( ! isset($this->entityListeners[$metadata->name])) { diff --git a/lib/Doctrine/ORM/Tools/Export/Driver/AbstractExporter.php b/lib/Doctrine/ORM/Tools/Export/Driver/AbstractExporter.php index efe8e7bcdc..5ed79f6e76 100644 --- a/lib/Doctrine/ORM/Tools/Export/Driver/AbstractExporter.php +++ b/lib/Doctrine/ORM/Tools/Export/Driver/AbstractExporter.php @@ -189,6 +189,8 @@ public function setExtension($extension) * @param int $type * * @return string + * + * @psalm-param ClassMetadataInfo::INHERITANCE_TYPE_* $type */ protected function _getInheritanceTypeString($type) { @@ -211,6 +213,8 @@ protected function _getInheritanceTypeString($type) * @param int $mode * * @return string + * + * @psalm-param ClassMetadataInfo::FETCH_* $mode */ protected function _getFetchModeString($mode) { @@ -230,6 +234,8 @@ protected function _getFetchModeString($mode) * @param int $policy * * @return string + * + * @psalm-param ClassMetadataInfo::CHANGETRACKING_* $policy */ protected function _getChangeTrackingPolicyString($policy) { @@ -249,6 +255,8 @@ protected function _getChangeTrackingPolicyString($policy) * @param int $type * * @return string + * + * @psalm-param ClassMetadataInfo::GENERATOR_TYPE_* $type */ protected function _getIdGeneratorTypeString($type) { diff --git a/lib/Doctrine/ORM/Tools/Pagination/Paginator.php b/lib/Doctrine/ORM/Tools/Pagination/Paginator.php index 64cd9e243f..0008927363 100644 --- a/lib/Doctrine/ORM/Tools/Pagination/Paginator.php +++ b/lib/Doctrine/ORM/Tools/Pagination/Paginator.php @@ -190,7 +190,6 @@ public function getIterator() */ private function cloneQuery(Query $query) { - /* @var $cloneQuery Query */ $cloneQuery = clone $query; $cloneQuery->setParameters(clone $query->getParameters()); @@ -244,7 +243,6 @@ private function appendTreeWalker(Query $query, $walkerClass) */ private function getCountQuery() { - /* @var $countQuery Query */ $countQuery = $this->cloneQuery($this->query); if ( ! $countQuery->hasHint(CountWalker::HINT_DISTINCT)) { diff --git a/lib/Doctrine/ORM/Tools/ResolveTargetEntityListener.php b/lib/Doctrine/ORM/Tools/ResolveTargetEntityListener.php index 36f1f929bd..73b8fa7cee 100644 --- a/lib/Doctrine/ORM/Tools/ResolveTargetEntityListener.php +++ b/lib/Doctrine/ORM/Tools/ResolveTargetEntityListener.php @@ -96,7 +96,6 @@ public function onClassMetadataNotFound(OnClassMetadataNotFoundEventArgs $args) */ public function loadClassMetadata(LoadClassMetadataEventArgs $args) { - /* @var $cm \Doctrine\ORM\Mapping\ClassMetadata */ $cm = $args->getClassMetadata(); foreach ($cm->associationMappings as $mapping) { diff --git a/lib/Doctrine/ORM/Tools/SchemaTool.php b/lib/Doctrine/ORM/Tools/SchemaTool.php index 3fd36b8afd..a1906bb863 100644 --- a/lib/Doctrine/ORM/Tools/SchemaTool.php +++ b/lib/Doctrine/ORM/Tools/SchemaTool.php @@ -832,7 +832,6 @@ public function getDropSchemaSQL(array $classes) foreach ($fullSchema->getTables() as $table) { if ( ! $schema->hasTable($table->getName())) { foreach ($table->getForeignKeys() as $foreignKey) { - /* @var $foreignKey \Doctrine\DBAL\Schema\ForeignKeyConstraint */ if ($schema->hasTable($foreignKey->getForeignTableName())) { $visitor->acceptForeignKey($table, $foreignKey); } diff --git a/psalm.xml b/psalm.xml index 2c61242af8..999fe8825d 100644 --- a/psalm.xml +++ b/psalm.xml @@ -1,6 +1,6 @@ getReturn(__FUNCTION__, true); } - /** - * {@inheritdoc} - */ public function clear() { $this->calls = []; diff --git a/tests/Doctrine/Tests/Models/ManyToManyPersister/ChildClass.php b/tests/Doctrine/Tests/Models/ManyToManyPersister/ChildClass.php index d3b9b16c1e..1733cd456a 100644 --- a/tests/Doctrine/Tests/Models/ManyToManyPersister/ChildClass.php +++ b/tests/Doctrine/Tests/Models/ManyToManyPersister/ChildClass.php @@ -40,6 +40,7 @@ class ChildClass * ) * * @var Collection|ParentClass[] + * @psalm-var Collection */ public $parents; diff --git a/tests/Doctrine/Tests/Models/ManyToManyPersister/ParentClass.php b/tests/Doctrine/Tests/Models/ManyToManyPersister/ParentClass.php index 3007a1013d..0b5a8050dd 100644 --- a/tests/Doctrine/Tests/Models/ManyToManyPersister/ParentClass.php +++ b/tests/Doctrine/Tests/Models/ManyToManyPersister/ParentClass.php @@ -28,6 +28,7 @@ class ParentClass * @ManyToMany(targetEntity=ChildClass::class, mappedBy="parents", orphanRemoval=true, cascade={"persist"}) * * @var Collection|ChildClass[] + * @psalm-var Collection */ public $children; diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2138Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2138Test.php index 960395e9c7..5bf2ddbcaa 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2138Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2138Test.php @@ -178,7 +178,7 @@ public function __construct(User $user, User $followedUser) } /** - * {@inheritdoc} + * @return User */ public function getUser() { diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/GH7062Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/GH7062Test.php index 1d7a2d7cbd..47409ac8fe 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/GH7062Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/GH7062Test.php @@ -102,6 +102,7 @@ class GH7062Ranking * @OneToMany(targetEntity=GH7062RankingPosition::class, mappedBy="ranking", cascade={"all"}) * * @var Collection|GH7062RankingPosition[] + * @psalm-var Collection */ public $positions; From 79cdcde9ec2b6ea4ca118959842df7860effa2dd Mon Sep 17 00:00:00 2001 From: orklah Date: Sat, 26 Sep 2020 20:24:11 +0200 Subject: [PATCH 116/136] rename parameters to match parents (#8284) --- .../Entity/AbstractEntityPersister.php | 20 +++++++++---------- .../ORM/Decorator/EntityManagerDecorator.php | 4 ++-- lib/Doctrine/ORM/EntityManager.php | 7 ++++--- .../Internal/Hydration/AbstractHydrator.php | 6 +++--- .../ORM/Internal/Hydration/ScalarHydrator.php | 4 ++-- .../Hydration/SimpleObjectHydrator.php | 19 +++++++++--------- .../Entity/BasicEntityPersister.php | 8 ++++---- lib/Doctrine/ORM/UnitOfWork.php | 15 +++++++------- 8 files changed, 43 insertions(+), 40 deletions(-) diff --git a/lib/Doctrine/ORM/Cache/Persister/Entity/AbstractEntityPersister.php b/lib/Doctrine/ORM/Cache/Persister/Entity/AbstractEntityPersister.php index a2fd0bfe3d..555cde9712 100644 --- a/lib/Doctrine/ORM/Cache/Persister/Entity/AbstractEntityPersister.php +++ b/lib/Doctrine/ORM/Cache/Persister/Entity/AbstractEntityPersister.php @@ -544,18 +544,18 @@ public function loadCriteria(Criteria $criteria) /** * {@inheritdoc} */ - public function loadManyToManyCollection(array $assoc, $sourceEntity, PersistentCollection $coll) + public function loadManyToManyCollection(array $assoc, $sourceEntity, PersistentCollection $collection) { $persister = $this->uow->getCollectionPersister($assoc); $hasCache = ($persister instanceof CachedPersister); if ( ! $hasCache) { - return $this->persister->loadManyToManyCollection($assoc, $sourceEntity, $coll); + return $this->persister->loadManyToManyCollection($assoc, $sourceEntity, $collection); } - $ownerId = $this->uow->getEntityIdentifier($coll->getOwner()); + $ownerId = $this->uow->getEntityIdentifier($collection->getOwner()); $key = $this->buildCollectionCacheKey($assoc, $ownerId); - $list = $persister->loadCollectionCache($coll, $key); + $list = $persister->loadCollectionCache($collection, $key); if ($list !== null) { if ($this->cacheLogger) { @@ -565,7 +565,7 @@ public function loadManyToManyCollection(array $assoc, $sourceEntity, Persistent return $list; } - $list = $this->persister->loadManyToManyCollection($assoc, $sourceEntity, $coll); + $list = $this->persister->loadManyToManyCollection($assoc, $sourceEntity, $collection); $persister->storeCollectionCache($key, $list); @@ -579,18 +579,18 @@ public function loadManyToManyCollection(array $assoc, $sourceEntity, Persistent /** * {@inheritdoc} */ - public function loadOneToManyCollection(array $assoc, $sourceEntity, PersistentCollection $coll) + public function loadOneToManyCollection(array $assoc, $sourceEntity, PersistentCollection $collection) { $persister = $this->uow->getCollectionPersister($assoc); $hasCache = ($persister instanceof CachedPersister); if ( ! $hasCache) { - return $this->persister->loadOneToManyCollection($assoc, $sourceEntity, $coll); + return $this->persister->loadOneToManyCollection($assoc, $sourceEntity, $collection); } - $ownerId = $this->uow->getEntityIdentifier($coll->getOwner()); + $ownerId = $this->uow->getEntityIdentifier($collection->getOwner()); $key = $this->buildCollectionCacheKey($assoc, $ownerId); - $list = $persister->loadCollectionCache($coll, $key); + $list = $persister->loadCollectionCache($collection, $key); if ($list !== null) { if ($this->cacheLogger) { @@ -600,7 +600,7 @@ public function loadOneToManyCollection(array $assoc, $sourceEntity, PersistentC return $list; } - $list = $this->persister->loadOneToManyCollection($assoc, $sourceEntity, $coll); + $list = $this->persister->loadOneToManyCollection($assoc, $sourceEntity, $collection); $persister->storeCollectionCache($key, $list); diff --git a/lib/Doctrine/ORM/Decorator/EntityManagerDecorator.php b/lib/Doctrine/ORM/Decorator/EntityManagerDecorator.php index 4dd9cad6ab..bbc06a3e17 100644 --- a/lib/Doctrine/ORM/Decorator/EntityManagerDecorator.php +++ b/lib/Doctrine/ORM/Decorator/EntityManagerDecorator.php @@ -175,9 +175,9 @@ public function lock($entity, $lockMode, $lockVersion = null) /** * {@inheritdoc} */ - public function find($entityName, $id, $lockMode = null, $lockVersion = null) + public function find($className, $id, $lockMode = null, $lockVersion = null) { - return $this->wrapped->find($entityName, $id, $lockMode, $lockVersion); + return $this->wrapped->find($className, $id, $lockMode, $lockVersion); } /** diff --git a/lib/Doctrine/ORM/EntityManager.php b/lib/Doctrine/ORM/EntityManager.php index cfbba06d9b..9c73239aa4 100644 --- a/lib/Doctrine/ORM/EntityManager.php +++ b/lib/Doctrine/ORM/EntityManager.php @@ -31,6 +31,7 @@ use Doctrine\Persistence\Mapping\MappingException; use Doctrine\Persistence\ObjectRepository; use Throwable; +use function ltrim; use const E_USER_DEPRECATED; use function trigger_error; @@ -373,7 +374,7 @@ public function flush($entity = null) /** * Finds an Entity by its identifier. * - * @param string $entityName The class name of the entity to find. + * @param string $className The class name of the entity to find. * @param mixed $id The identity of the entity to find. * @param integer|null $lockMode One of the \Doctrine\DBAL\LockMode::* constants * or NULL if no specific lock mode should be used @@ -388,9 +389,9 @@ public function flush($entity = null) * @throws TransactionRequiredException * @throws ORMException */ - public function find($entityName, $id, $lockMode = null, $lockVersion = null) + public function find($className, $id, $lockMode = null, $lockVersion = null) { - $class = $this->metadataFactory->getMetadataFor(ltrim($entityName, '\\')); + $class = $this->metadataFactory->getMetadataFor(ltrim($className, '\\')); if ($lockMode !== null) { $this->checkLockRequirements($lockMode, $class); diff --git a/lib/Doctrine/ORM/Internal/Hydration/AbstractHydrator.php b/lib/Doctrine/ORM/Internal/Hydration/AbstractHydrator.php index 7ae2cb2451..136bf4e576 100644 --- a/lib/Doctrine/ORM/Internal/Hydration/AbstractHydrator.php +++ b/lib/Doctrine/ORM/Internal/Hydration/AbstractHydrator.php @@ -228,14 +228,14 @@ protected function cleanup() * * Template method. * - * @param array $data The row data. - * @param array $result The result to fill. + * @param mixed[] $row The row data. + * @param mixed[] $result The result to fill. * * @return void * * @throws HydrationException */ - protected function hydrateRowData(array $data, array &$result) + protected function hydrateRowData(array $row, array &$result) { throw new HydrationException("hydrateRowData() not implemented by this hydrator."); } diff --git a/lib/Doctrine/ORM/Internal/Hydration/ScalarHydrator.php b/lib/Doctrine/ORM/Internal/Hydration/ScalarHydrator.php index 093e89c4e1..56ce39bdc3 100644 --- a/lib/Doctrine/ORM/Internal/Hydration/ScalarHydrator.php +++ b/lib/Doctrine/ORM/Internal/Hydration/ScalarHydrator.php @@ -47,8 +47,8 @@ protected function hydrateAllData() /** * {@inheritdoc} */ - protected function hydrateRowData(array $data, array &$result) + protected function hydrateRowData(array $row, array &$result) { - $result[] = $this->gatherScalarRowData($data); + $result[] = $this->gatherScalarRowData($row); } } diff --git a/lib/Doctrine/ORM/Internal/Hydration/SimpleObjectHydrator.php b/lib/Doctrine/ORM/Internal/Hydration/SimpleObjectHydrator.php index ec5eef1ac5..4f16cb03c0 100644 --- a/lib/Doctrine/ORM/Internal/Hydration/SimpleObjectHydrator.php +++ b/lib/Doctrine/ORM/Internal/Hydration/SimpleObjectHydrator.php @@ -22,6 +22,7 @@ use PDO; use Doctrine\ORM\Mapping\ClassMetadata; use Doctrine\ORM\Query; +use function array_keys; use function in_array; class SimpleObjectHydrator extends AbstractHydrator @@ -77,7 +78,7 @@ protected function hydrateAllData() /** * {@inheritdoc} */ - protected function hydrateRowData(array $sqlResult, array &$result) + protected function hydrateRowData(array $row, array &$result) { $entityName = $this->class->name; $data = []; @@ -92,27 +93,27 @@ protected function hydrateRowData(array $sqlResult, array &$result) $discrColumnName = $metaMappingDiscrColumnName; } - if ( ! isset($sqlResult[$discrColumnName])) { + if (! isset($row[$discrColumnName])) { throw HydrationException::missingDiscriminatorColumn($entityName, $discrColumnName, key($this->_rsm->aliasMap)); } - if ($sqlResult[$discrColumnName] === '') { + if ($row[$discrColumnName] === '') { throw HydrationException::emptyDiscriminatorValue(key($this->_rsm->aliasMap)); } $discrMap = $this->class->discriminatorMap; - if ( ! isset($discrMap[$sqlResult[$discrColumnName]])) { - throw HydrationException::invalidDiscriminatorValue($sqlResult[$discrColumnName], array_keys($discrMap)); + if (! isset($discrMap[$row[$discrColumnName]])) { + throw HydrationException::invalidDiscriminatorValue($row[$discrColumnName], array_keys($discrMap)); } - $entityName = $discrMap[$sqlResult[$discrColumnName]]; - $discrColumnValue = $sqlResult[$discrColumnName]; + $entityName = $discrMap[$row[$discrColumnName]]; + $discrColumnValue = $row[$discrColumnName]; - unset($sqlResult[$discrColumnName]); + unset($row[$discrColumnName]); } - foreach ($sqlResult as $column => $value) { + foreach ($row as $column => $value) { // An ObjectHydrator should be used instead of SimpleObjectHydrator if (isset($this->_rsm->relationMap[$column])) { throw new \Exception(sprintf('Unable to retrieve association information for column "%s"', $column)); diff --git a/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php b/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php index 9b8bdc92dc..ce52b6d075 100644 --- a/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php +++ b/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php @@ -987,11 +987,11 @@ private function loadCollectionFromStatement($assoc, $stmt, $coll) /** * {@inheritdoc} */ - public function loadManyToManyCollection(array $assoc, $sourceEntity, PersistentCollection $coll) + public function loadManyToManyCollection(array $assoc, $sourceEntity, PersistentCollection $collection) { $stmt = $this->getManyToManyStatement($assoc, $sourceEntity); - return $this->loadCollectionFromStatement($assoc, $stmt, $coll); + return $this->loadCollectionFromStatement($assoc, $stmt, $collection); } /** @@ -1795,11 +1795,11 @@ public function getOneToManyCollection(array $assoc, $sourceEntity, $offset = nu /** * {@inheritdoc} */ - public function loadOneToManyCollection(array $assoc, $sourceEntity, PersistentCollection $coll) + public function loadOneToManyCollection(array $assoc, $sourceEntity, PersistentCollection $collection) { $stmt = $this->getOneToManyStatement($assoc, $sourceEntity); - return $this->loadCollectionFromStatement($assoc, $stmt, $coll); + return $this->loadCollectionFromStatement($assoc, $stmt, $collection); } /** diff --git a/lib/Doctrine/ORM/UnitOfWork.php b/lib/Doctrine/ORM/UnitOfWork.php index 1932183a09..0889e17e76 100644 --- a/lib/Doctrine/ORM/UnitOfWork.php +++ b/lib/Doctrine/ORM/UnitOfWork.php @@ -47,6 +47,7 @@ use Throwable; use UnexpectedValueException; use function get_class; +use function spl_object_hash; /** * The UnitOfWork is responsible for tracking changes to objects during an @@ -472,7 +473,7 @@ private function postCommitCleanup($entity) : void : $entity; foreach ($entities as $object) { - $oid = \spl_object_hash($object); + $oid = spl_object_hash($object); $this->clearEntityChangeSet($oid); @@ -897,7 +898,7 @@ private function computeAssociationChanges($assoc, $value) * through the object-graph where cascade-persistence * is enabled for this object. */ - $this->nonCascadedNewDetectedEntities[\spl_object_hash($entry)] = [$assoc, $entry]; + $this->nonCascadedNewDetectedEntities[spl_object_hash($entry)] = [$assoc, $entry]; break; } @@ -3214,17 +3215,17 @@ public function clearEntityChangeSet($oid) /** * Notifies this UnitOfWork of a property change in an entity. * - * @param object $entity The entity that owns the property. + * @param object $sender The entity that owns the property. * @param string $propertyName The name of the property that changed. * @param mixed $oldValue The old value of the property. * @param mixed $newValue The new value of the property. * * @return void */ - public function propertyChanged($entity, $propertyName, $oldValue, $newValue) + public function propertyChanged($sender, $propertyName, $oldValue, $newValue) { - $oid = spl_object_hash($entity); - $class = $this->em->getClassMetadata(get_class($entity)); + $oid = spl_object_hash($sender); + $class = $this->em->getClassMetadata(get_class($sender)); $isAssocField = isset($class->associationMappings[$propertyName]); @@ -3236,7 +3237,7 @@ public function propertyChanged($entity, $propertyName, $oldValue, $newValue) $this->entityChangeSets[$oid][$propertyName] = [$oldValue, $newValue]; if ( ! isset($this->scheduledForSynchronization[$class->rootEntityName][$oid])) { - $this->scheduleForDirtyCheck($entity); + $this->scheduleForDirtyCheck($sender); } } From e0eb82a3b12a3fd0878b5d56c3c293c04c168329 Mon Sep 17 00:00:00 2001 From: orklah Date: Wed, 30 Sep 2020 22:00:38 +0200 Subject: [PATCH 117/136] psalm fixes (#8286) --- lib/Doctrine/ORM/AbstractQuery.php | 5 +- .../Cache/Logging/StatisticsCacheLogger.php | 18 ++-- .../ORM/Cache/Region/FileLockRegion.php | 2 + .../ORM/Decorator/EntityManagerDecorator.php | 12 +-- .../ORM/Mapping/ClassMetadataInfo.php | 8 +- .../ORM/Mapping/Driver/AnnotationDriver.php | 3 +- lib/Doctrine/ORM/PersistentCollection.php | 4 + .../Collection/OneToManyPersister.php | 2 + .../Entity/BasicEntityPersister.php | 8 +- .../ORM/Query/AST/SimpleSelectExpression.php | 4 +- lib/Doctrine/ORM/Query/AST/WhereClause.php | 2 +- .../ORM/Query/Exec/AbstractSqlExecutor.php | 4 +- .../Query/Exec/MultiTableDeleteExecutor.php | 8 +- .../Query/Exec/MultiTableUpdateExecutor.php | 8 +- .../Exec/SingleTableDeleteUpdateExecutor.php | 2 + lib/Doctrine/ORM/Query/Parser.php | 17 ++-- lib/Doctrine/ORM/Query/SqlWalker.php | 4 +- lib/Doctrine/ORM/Query/TreeWalkerAdapter.php | 94 ++++++++++++++++++ lib/Doctrine/ORM/Query/TreeWalkerChain.php | 96 +++++++++++++++++++ .../ORM/Query/TreeWalkerChainIterator.php | 12 ++- lib/Doctrine/ORM/QueryBuilder.php | 1 + .../Command/ConvertDoctrine1SchemaCommand.php | 5 +- .../Console/Command/ConvertMappingCommand.php | 5 +- .../Command/GenerateEntitiesCommand.php | 2 +- .../Command/MappingDescribeCommand.php | 2 +- .../Tools/Console/Command/RunDqlCommand.php | 2 +- .../ORM/Tools/Export/Driver/YamlExporter.php | 5 +- .../Tools/Pagination/LimitSubqueryWalker.php | 4 +- .../ORM/Tools/Pagination/Paginator.php | 3 +- .../Decorator/EntityManagerDecoratorTest.php | 5 + 30 files changed, 286 insertions(+), 61 deletions(-) diff --git a/lib/Doctrine/ORM/AbstractQuery.php b/lib/Doctrine/ORM/AbstractQuery.php index 0bb2ce8d9b..483049e66d 100644 --- a/lib/Doctrine/ORM/AbstractQuery.php +++ b/lib/Doctrine/ORM/AbstractQuery.php @@ -348,6 +348,7 @@ public function setParameters($parameters) { // BC compatibility with 2.3- if (is_array($parameters)) { + /** @psalm-var ArrayCollection $parameterCollection */ $parameterCollection = new ArrayCollection(); foreach ($parameters as $key => $value) { @@ -393,9 +394,11 @@ public function setParameter($key, $value, $type = null) * * @param mixed $value * - * @return array|string + * @return mixed[]|string|int|float|bool * * @throws \Doctrine\ORM\ORMInvalidArgumentException + * + * @psalm-return array|scalar */ public function processParameterValue($value) { diff --git a/lib/Doctrine/ORM/Cache/Logging/StatisticsCacheLogger.php b/lib/Doctrine/ORM/Cache/Logging/StatisticsCacheLogger.php index 122e3534ac..8d73ff371d 100644 --- a/lib/Doctrine/ORM/Cache/Logging/StatisticsCacheLogger.php +++ b/lib/Doctrine/ORM/Cache/Logging/StatisticsCacheLogger.php @@ -33,17 +33,17 @@ class StatisticsCacheLogger implements CacheLogger { /** - * @var array + * @var int[] */ private $cacheMissCountMap = []; /** - * @var array + * @var int[] */ private $cacheHitCountMap = []; /** - * @var array + * @var int[] */ private $cachePutCountMap = []; @@ -142,7 +142,7 @@ public function queryCachePut($regionName, QueryCacheKey $key) * * @param string $regionName The name of the cache region. * - * @return integer + * @return int */ public function getRegionHitCount($regionName) { @@ -154,7 +154,7 @@ public function getRegionHitCount($regionName) * * @param string $regionName The name of the cache region. * - * @return integer + * @return int */ public function getRegionMissCount($regionName) { @@ -166,7 +166,7 @@ public function getRegionMissCount($regionName) * * @param string $regionName The name of the cache region. * - * @return integer + * @return int */ public function getRegionPutCount($regionName) { @@ -222,7 +222,7 @@ public function clearStats() /** * Get the total number of put in cache. * - * @return integer + * @return int */ public function getPutCount() { @@ -232,7 +232,7 @@ public function getPutCount() /** * Get the total number of entries successfully retrieved from cache. * - * @return integer + * @return int */ public function getHitCount() { @@ -242,7 +242,7 @@ public function getHitCount() /** * Get the total number of cached entries *not* found in cache. * - * @return integer + * @return int */ public function getMissCount() { diff --git a/lib/Doctrine/ORM/Cache/Region/FileLockRegion.php b/lib/Doctrine/ORM/Cache/Region/FileLockRegion.php index 880d9dabc5..db605cc26d 100644 --- a/lib/Doctrine/ORM/Cache/Region/FileLockRegion.php +++ b/lib/Doctrine/ORM/Cache/Region/FileLockRegion.php @@ -249,6 +249,8 @@ public function lock(CacheKey $key) /** * {@inheritdoc} + * + * @return bool */ public function unlock(CacheKey $key, Lock $lock) { diff --git a/lib/Doctrine/ORM/Decorator/EntityManagerDecorator.php b/lib/Doctrine/ORM/Decorator/EntityManagerDecorator.php index bbc06a3e17..16959dfb14 100644 --- a/lib/Doctrine/ORM/Decorator/EntityManagerDecorator.php +++ b/lib/Doctrine/ORM/Decorator/EntityManagerDecorator.php @@ -65,7 +65,7 @@ public function getExpressionBuilder() */ public function beginTransaction() { - return $this->wrapped->beginTransaction(); + $this->wrapped->beginTransaction(); } /** @@ -81,7 +81,7 @@ public function transactional($func) */ public function commit() { - return $this->wrapped->commit(); + $this->wrapped->commit(); } /** @@ -89,7 +89,7 @@ public function commit() */ public function rollback() { - return $this->wrapped->rollback(); + $this->wrapped->rollback(); } /** @@ -153,7 +153,7 @@ public function getPartialReference($entityName, $identifier) */ public function close() { - return $this->wrapped->close(); + $this->wrapped->close(); } /** @@ -169,7 +169,7 @@ public function copy($entity, $deep = false) */ public function lock($entity, $lockMode, $lockVersion = null) { - return $this->wrapped->lock($entity, $lockMode, $lockVersion); + $this->wrapped->lock($entity, $lockMode, $lockVersion); } /** @@ -185,7 +185,7 @@ public function find($className, $id, $lockMode = null, $lockVersion = null) */ public function flush($entity = null) { - return $this->wrapped->flush($entity); + $this->wrapped->flush($entity); } /** diff --git a/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php b/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php index 6089d389a6..0fc8980c8c 100644 --- a/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php +++ b/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php @@ -397,6 +397,8 @@ class ClassMetadataInfo implements ClassMetadata * Whether a unique constraint should be generated for the column. * * @var array + * + * @psalm-var array */ public $fieldMappings = []; @@ -644,7 +646,7 @@ class ClassMetadataInfo implements ClassMetadata /** * The ReflectionProperty instances of the mapped class. * - * @var ReflectionProperty[] + * @var ReflectionProperty[]|null[] */ public $reflFields = []; @@ -671,7 +673,9 @@ public function __construct($entityName, NamingStrategy $namingStrategy = null) /** * Gets the ReflectionProperties of the mapped class. * - * @return ReflectionProperty[] An array of ReflectionProperty instances. + * @return ReflectionProperty[]|null[] An array of ReflectionProperty instances. + * + * @psalm-return array */ public function getReflectionProperties() { diff --git a/lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php b/lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php index e8963a9940..de01a59d7c 100644 --- a/lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php +++ b/lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php @@ -40,7 +40,8 @@ class AnnotationDriver extends AbstractAnnotationDriver { /** - * {@inheritDoc} + * @var int[] + * @psalm-var array */ protected $entityAnnotationClasses = [ Mapping\Entity::class => 1, diff --git a/lib/Doctrine/ORM/PersistentCollection.php b/lib/Doctrine/ORM/PersistentCollection.php index 2ab54bfaf6..96bdc1a976 100644 --- a/lib/Doctrine/ORM/PersistentCollection.php +++ b/lib/Doctrine/ORM/PersistentCollection.php @@ -337,6 +337,8 @@ public function setInitialized($bool) /** * {@inheritdoc} + * + * @return object */ public function remove($key) { @@ -510,6 +512,8 @@ public function offsetSet($offset, $value) /** * {@inheritdoc} + * + * @return object */ public function offsetUnset($offset) { diff --git a/lib/Doctrine/ORM/Persisters/Collection/OneToManyPersister.php b/lib/Doctrine/ORM/Persisters/Collection/OneToManyPersister.php index 21dc4baaa4..1409b0e321 100644 --- a/lib/Doctrine/ORM/Persisters/Collection/OneToManyPersister.php +++ b/lib/Doctrine/ORM/Persisters/Collection/OneToManyPersister.php @@ -36,6 +36,8 @@ class OneToManyPersister extends AbstractCollectionPersister { /** * {@inheritdoc} + * + * @return int|null */ public function delete(PersistentCollection $collection) { diff --git a/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php b/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php index ce52b6d075..ec08ac839e 100644 --- a/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php +++ b/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php @@ -362,9 +362,9 @@ protected function fetchVersionValue($versionedClass, array $id) } /** - * @return Type[] + * @return int[]|null[]|string[] * - * @psalm-return list + * @psalm-return list */ private function extractIdentifierTypes(array $id, ClassMetadata $versionedClass) : array { @@ -1917,11 +1917,11 @@ private function expandToManyParameters($criteria) * @param mixed $value * @param ClassMetadata $class * - * @return Type[] + * @return int[]|null[]|string[] * * @throws \Doctrine\ORM\Query\QueryException * - * @psalm-return list + * @psalm-return list */ private function getTypes($field, $value, ClassMetadata $class) { diff --git a/lib/Doctrine/ORM/Query/AST/SimpleSelectExpression.php b/lib/Doctrine/ORM/Query/AST/SimpleSelectExpression.php index e556835ed6..afb98ab6bd 100644 --- a/lib/Doctrine/ORM/Query/AST/SimpleSelectExpression.php +++ b/lib/Doctrine/ORM/Query/AST/SimpleSelectExpression.php @@ -32,7 +32,7 @@ class SimpleSelectExpression extends Node { /** - * @var Node + * @var Node|string */ public $expression; @@ -42,7 +42,7 @@ class SimpleSelectExpression extends Node public $fieldIdentificationVariable; /** - * @param Node $expression + * @param Node|string $expression */ public function __construct($expression) { diff --git a/lib/Doctrine/ORM/Query/AST/WhereClause.php b/lib/Doctrine/ORM/Query/AST/WhereClause.php index e6597752ff..dab80580e8 100644 --- a/lib/Doctrine/ORM/Query/AST/WhereClause.php +++ b/lib/Doctrine/ORM/Query/AST/WhereClause.php @@ -31,7 +31,7 @@ class WhereClause extends Node { /** - * @var ConditionalExpression + * @var ConditionalExpression|ConditionalTerm */ public $conditionalExpression; diff --git a/lib/Doctrine/ORM/Query/Exec/AbstractSqlExecutor.php b/lib/Doctrine/ORM/Query/Exec/AbstractSqlExecutor.php index 8955b9215d..ee2af6ef29 100644 --- a/lib/Doctrine/ORM/Query/Exec/AbstractSqlExecutor.php +++ b/lib/Doctrine/ORM/Query/Exec/AbstractSqlExecutor.php @@ -34,7 +34,7 @@ abstract class AbstractSqlExecutor { /** - * @var array + * @var mixed[]|string */ protected $_sqlStatements; @@ -46,7 +46,7 @@ abstract class AbstractSqlExecutor /** * Gets the SQL statements that are executed by the executor. * - * @return array All the SQL update statements. + * @return mixed[]|string All the SQL update statements. */ public function getSqlStatements() { diff --git a/lib/Doctrine/ORM/Query/Exec/MultiTableDeleteExecutor.php b/lib/Doctrine/ORM/Query/Exec/MultiTableDeleteExecutor.php index 2f3d5acf5d..a6b9ef2fe4 100644 --- a/lib/Doctrine/ORM/Query/Exec/MultiTableDeleteExecutor.php +++ b/lib/Doctrine/ORM/Query/Exec/MultiTableDeleteExecutor.php @@ -22,6 +22,8 @@ use Doctrine\DBAL\Connection; use Doctrine\DBAL\Types\Type; use Doctrine\ORM\Query\AST; +use Doctrine\ORM\Query\AST\DeleteStatement; +use Doctrine\ORM\Query\SqlWalker; use Doctrine\ORM\Utility\PersisterHelper; use Throwable; @@ -57,8 +59,8 @@ class MultiTableDeleteExecutor extends AbstractSqlExecutor * Internal note: Any SQL construction and preparation takes place in the constructor for * best performance. With a query cache the executor will be cached. * - * @param \Doctrine\ORM\Query\AST\Node $AST The root AST node of the DQL query. - * @param \Doctrine\ORM\Query\SqlWalker $sqlWalker The walker used for SQL generation from the AST. + * @param DeleteStatement $AST The root AST node of the DQL query. + * @param SqlWalker $sqlWalker The walker used for SQL generation from the AST. */ public function __construct(AST\Node $AST, $sqlWalker) { @@ -116,6 +118,8 @@ public function __construct(AST\Node $AST, $sqlWalker) /** * {@inheritDoc} + * + * @return int */ public function execute(Connection $conn, array $params, array $types) { diff --git a/lib/Doctrine/ORM/Query/Exec/MultiTableUpdateExecutor.php b/lib/Doctrine/ORM/Query/Exec/MultiTableUpdateExecutor.php index 47db034210..53d13304f3 100644 --- a/lib/Doctrine/ORM/Query/Exec/MultiTableUpdateExecutor.php +++ b/lib/Doctrine/ORM/Query/Exec/MultiTableUpdateExecutor.php @@ -21,8 +21,10 @@ use Doctrine\DBAL\Connection; use Doctrine\DBAL\Types\Type; +use Doctrine\ORM\Query\AST\UpdateStatement; use Doctrine\ORM\Query\ParameterTypeInferer; use Doctrine\ORM\Query\AST; +use Doctrine\ORM\Query\SqlWalker; use Doctrine\ORM\Utility\PersisterHelper; use Throwable; @@ -66,8 +68,8 @@ class MultiTableUpdateExecutor extends AbstractSqlExecutor * Internal note: Any SQL construction and preparation takes place in the constructor for * best performance. With a query cache the executor will be cached. * - * @param \Doctrine\ORM\Query\AST\Node $AST The root AST node of the DQL query. - * @param \Doctrine\ORM\Query\SqlWalker $sqlWalker The walker used for SQL generation from the AST. + * @param UpdateStatement $AST The root AST node of the DQL query. + * @param SqlWalker $sqlWalker The walker used for SQL generation from the AST. */ public function __construct(AST\Node $AST, $sqlWalker) { @@ -161,6 +163,8 @@ public function __construct(AST\Node $AST, $sqlWalker) /** * {@inheritDoc} + * + * @return int */ public function execute(Connection $conn, array $params, array $types) { diff --git a/lib/Doctrine/ORM/Query/Exec/SingleTableDeleteUpdateExecutor.php b/lib/Doctrine/ORM/Query/Exec/SingleTableDeleteUpdateExecutor.php index e0183dd687..a457f6de9b 100644 --- a/lib/Doctrine/ORM/Query/Exec/SingleTableDeleteUpdateExecutor.php +++ b/lib/Doctrine/ORM/Query/Exec/SingleTableDeleteUpdateExecutor.php @@ -49,6 +49,8 @@ public function __construct(AST\Node $AST, $sqlWalker) /** * {@inheritDoc} + * + * @return int */ public function execute(Connection $conn, array $params, array $types) { diff --git a/lib/Doctrine/ORM/Query/Parser.php b/lib/Doctrine/ORM/Query/Parser.php index 696fe7f1e1..0475230c84 100644 --- a/lib/Doctrine/ORM/Query/Parser.php +++ b/lib/Doctrine/ORM/Query/Parser.php @@ -29,6 +29,7 @@ use Doctrine\ORM\Query\AST\Subselect; use Doctrine\ORM\Query\AST\SubselectIdentificationVariableDeclaration; use Doctrine\ORM\Query\AST\UpdateStatement; +use function assert; use function in_array; use function strpos; @@ -429,6 +430,8 @@ private function fixIdentificationVariableOrder($AST) return; } + assert($AST instanceof AST\SelectStatement); + foreach ($this->queryComponents as $dqlAlias => $qComp) { if ( ! isset($this->identVariableExpressions[$dqlAlias])) { continue; @@ -627,7 +630,7 @@ private function processDeferredIdentificationVariables() /** * Validates that the given NewObjectExpression. * - * @param \Doctrine\ORM\Query\AST\SelectClause $AST + * @param SelectStatement $AST * * @return void */ @@ -1564,7 +1567,7 @@ public function OrderByItem() * * SimpleArithmeticExpression covers all *Primary grammar rules and also SimpleEntityExpression * - * @return AST\ArithmeticExpression + * @return AST\ArithmeticExpression|AST\InputParameter|null */ public function NewValue() { @@ -1768,7 +1771,7 @@ public function RangeVariableDeclaration() /** * JoinAssociationDeclaration ::= JoinAssociationPathExpression ["AS"] AliasIdentificationVariable [IndexBy] * - * @return \Doctrine\ORM\Query\AST\JoinAssociationPathExpression + * @return AST\JoinAssociationDeclaration */ public function JoinAssociationDeclaration() { @@ -2394,7 +2397,7 @@ public function SimpleSelectExpression() /** * ConditionalExpression ::= ConditionalTerm {"OR" ConditionalTerm}* * - * @return \Doctrine\ORM\Query\AST\ConditionalExpression + * @return AST\ConditionalExpression|AST\ConditionalFactor|AST\ConditionalPrimary|AST\ConditionalTerm */ public function ConditionalExpression() { @@ -2419,7 +2422,7 @@ public function ConditionalExpression() /** * ConditionalTerm ::= ConditionalFactor {"AND" ConditionalFactor}* * - * @return \Doctrine\ORM\Query\AST\ConditionalTerm + * @return AST\ConditionalFactor|AST\ConditionalPrimary|AST\ConditionalTerm */ public function ConditionalTerm() { @@ -2444,7 +2447,7 @@ public function ConditionalTerm() /** * ConditionalFactor ::= ["NOT"] ConditionalPrimary * - * @return \Doctrine\ORM\Query\AST\ConditionalFactor + * @return AST\ConditionalFactor|AST\ConditionalPrimary */ public function ConditionalFactor() { @@ -2948,7 +2951,7 @@ public function StringPrimary() /** * EntityExpression ::= SingleValuedAssociationPathExpression | SimpleEntityExpression * - * @return PathExpression + * @return AST\InputParameter|PathExpression */ public function EntityExpression() { diff --git a/lib/Doctrine/ORM/Query/SqlWalker.php b/lib/Doctrine/ORM/Query/SqlWalker.php index f058830515..d5fe832d56 100644 --- a/lib/Doctrine/ORM/Query/SqlWalker.php +++ b/lib/Doctrine/ORM/Query/SqlWalker.php @@ -108,7 +108,7 @@ class SqlWalker implements TreeWalker private $conn; /** - * @var \Doctrine\ORM\AbstractQuery + * @var Query */ private $query; @@ -143,7 +143,7 @@ class SqlWalker implements TreeWalker * * @var array * - * @psalm-var array + * @psalm-var array */ private $queryComponents; diff --git a/lib/Doctrine/ORM/Query/TreeWalkerAdapter.php b/lib/Doctrine/ORM/Query/TreeWalkerAdapter.php index deee03ab53..99c99973b7 100644 --- a/lib/Doctrine/ORM/Query/TreeWalkerAdapter.php +++ b/lib/Doctrine/ORM/Query/TreeWalkerAdapter.php @@ -111,6 +111,8 @@ protected function _getParserResult() /** * {@inheritdoc} + * + * @return void */ public function walkSelectStatement(AST\SelectStatement $AST) { @@ -118,6 +120,8 @@ public function walkSelectStatement(AST\SelectStatement $AST) /** * {@inheritdoc} + * + * @return void */ public function walkSelectClause($selectClause) { @@ -125,6 +129,8 @@ public function walkSelectClause($selectClause) /** * {@inheritdoc} + * + * @return void */ public function walkFromClause($fromClause) { @@ -132,6 +138,8 @@ public function walkFromClause($fromClause) /** * {@inheritdoc} + * + * @return void */ public function walkFunction($function) { @@ -139,6 +147,8 @@ public function walkFunction($function) /** * {@inheritdoc} + * + * @return void */ public function walkOrderByClause($orderByClause) { @@ -146,6 +156,8 @@ public function walkOrderByClause($orderByClause) /** * {@inheritdoc} + * + * @return void */ public function walkOrderByItem($orderByItem) { @@ -153,6 +165,8 @@ public function walkOrderByItem($orderByItem) /** * {@inheritdoc} + * + * @return void */ public function walkHavingClause($havingClause) { @@ -160,6 +174,8 @@ public function walkHavingClause($havingClause) /** * {@inheritdoc} + * + * @return void */ public function walkJoin($join) { @@ -167,6 +183,8 @@ public function walkJoin($join) /** * {@inheritdoc} + * + * @return void */ public function walkSelectExpression($selectExpression) { @@ -174,6 +192,8 @@ public function walkSelectExpression($selectExpression) /** * {@inheritdoc} + * + * @return void */ public function walkQuantifiedExpression($qExpr) { @@ -181,6 +201,8 @@ public function walkQuantifiedExpression($qExpr) /** * {@inheritdoc} + * + * @return void */ public function walkSubselect($subselect) { @@ -188,6 +210,8 @@ public function walkSubselect($subselect) /** * {@inheritdoc} + * + * @return void */ public function walkSubselectFromClause($subselectFromClause) { @@ -195,6 +219,8 @@ public function walkSubselectFromClause($subselectFromClause) /** * {@inheritdoc} + * + * @return void */ public function walkSimpleSelectClause($simpleSelectClause) { @@ -202,6 +228,8 @@ public function walkSimpleSelectClause($simpleSelectClause) /** * {@inheritdoc} + * + * @return void */ public function walkSimpleSelectExpression($simpleSelectExpression) { @@ -209,6 +237,8 @@ public function walkSimpleSelectExpression($simpleSelectExpression) /** * {@inheritdoc} + * + * @return void */ public function walkAggregateExpression($aggExpression) { @@ -216,6 +246,8 @@ public function walkAggregateExpression($aggExpression) /** * {@inheritdoc} + * + * @return void */ public function walkGroupByClause($groupByClause) { @@ -223,6 +255,8 @@ public function walkGroupByClause($groupByClause) /** * {@inheritdoc} + * + * @return void */ public function walkGroupByItem($groupByItem) { @@ -230,6 +264,8 @@ public function walkGroupByItem($groupByItem) /** * {@inheritdoc} + * + * @return void */ public function walkUpdateStatement(AST\UpdateStatement $AST) { @@ -237,6 +273,8 @@ public function walkUpdateStatement(AST\UpdateStatement $AST) /** * {@inheritdoc} + * + * @return void */ public function walkDeleteStatement(AST\DeleteStatement $AST) { @@ -244,6 +282,8 @@ public function walkDeleteStatement(AST\DeleteStatement $AST) /** * {@inheritdoc} + * + * @return void */ public function walkDeleteClause(AST\DeleteClause $deleteClause) { @@ -251,6 +291,8 @@ public function walkDeleteClause(AST\DeleteClause $deleteClause) /** * {@inheritdoc} + * + * @return void */ public function walkUpdateClause($updateClause) { @@ -258,6 +300,8 @@ public function walkUpdateClause($updateClause) /** * {@inheritdoc} + * + * @return void */ public function walkUpdateItem($updateItem) { @@ -265,6 +309,8 @@ public function walkUpdateItem($updateItem) /** * {@inheritdoc} + * + * @return void */ public function walkWhereClause($whereClause) { @@ -272,6 +318,8 @@ public function walkWhereClause($whereClause) /** * {@inheritdoc} + * + * @return void */ public function walkConditionalExpression($condExpr) { @@ -279,6 +327,8 @@ public function walkConditionalExpression($condExpr) /** * {@inheritdoc} + * + * @return void */ public function walkConditionalTerm($condTerm) { @@ -286,6 +336,8 @@ public function walkConditionalTerm($condTerm) /** * {@inheritdoc} + * + * @return void */ public function walkConditionalFactor($factor) { @@ -293,6 +345,8 @@ public function walkConditionalFactor($factor) /** * {@inheritdoc} + * + * @return void */ public function walkConditionalPrimary($primary) { @@ -300,6 +354,8 @@ public function walkConditionalPrimary($primary) /** * {@inheritdoc} + * + * @return void */ public function walkExistsExpression($existsExpr) { @@ -307,6 +363,8 @@ public function walkExistsExpression($existsExpr) /** * {@inheritdoc} + * + * @return void */ public function walkCollectionMemberExpression($collMemberExpr) { @@ -314,6 +372,8 @@ public function walkCollectionMemberExpression($collMemberExpr) /** * {@inheritdoc} + * + * @return void */ public function walkEmptyCollectionComparisonExpression($emptyCollCompExpr) { @@ -321,6 +381,8 @@ public function walkEmptyCollectionComparisonExpression($emptyCollCompExpr) /** * {@inheritdoc} + * + * @return void */ public function walkNullComparisonExpression($nullCompExpr) { @@ -328,6 +390,8 @@ public function walkNullComparisonExpression($nullCompExpr) /** * {@inheritdoc} + * + * @return void */ public function walkInExpression($inExpr) { @@ -335,6 +399,8 @@ public function walkInExpression($inExpr) /** * {@inheritdoc} + * + * @return void */ public function walkInstanceOfExpression($instanceOfExpr) { @@ -342,6 +408,8 @@ public function walkInstanceOfExpression($instanceOfExpr) /** * {@inheritdoc} + * + * @return void */ public function walkLiteral($literal) { @@ -349,6 +417,8 @@ public function walkLiteral($literal) /** * {@inheritdoc} + * + * @return void */ public function walkBetweenExpression($betweenExpr) { @@ -356,6 +426,8 @@ public function walkBetweenExpression($betweenExpr) /** * {@inheritdoc} + * + * @return void */ public function walkLikeExpression($likeExpr) { @@ -363,6 +435,8 @@ public function walkLikeExpression($likeExpr) /** * {@inheritdoc} + * + * @return void */ public function walkStateFieldPathExpression($stateFieldPathExpression) { @@ -370,6 +444,8 @@ public function walkStateFieldPathExpression($stateFieldPathExpression) /** * {@inheritdoc} + * + * @return void */ public function walkComparisonExpression($compExpr) { @@ -377,6 +453,8 @@ public function walkComparisonExpression($compExpr) /** * {@inheritdoc} + * + * @return void */ public function walkInputParameter($inputParam) { @@ -384,6 +462,8 @@ public function walkInputParameter($inputParam) /** * {@inheritdoc} + * + * @return void */ public function walkArithmeticExpression($arithmeticExpr) { @@ -391,6 +471,8 @@ public function walkArithmeticExpression($arithmeticExpr) /** * {@inheritdoc} + * + * @return void */ public function walkArithmeticTerm($term) { @@ -398,6 +480,8 @@ public function walkArithmeticTerm($term) /** * {@inheritdoc} + * + * @return void */ public function walkStringPrimary($stringPrimary) { @@ -405,6 +489,8 @@ public function walkStringPrimary($stringPrimary) /** * {@inheritdoc} + * + * @return void */ public function walkArithmeticFactor($factor) { @@ -412,6 +498,8 @@ public function walkArithmeticFactor($factor) /** * {@inheritdoc} + * + * @return void */ public function walkSimpleArithmeticExpression($simpleArithmeticExpr) { @@ -419,6 +507,8 @@ public function walkSimpleArithmeticExpression($simpleArithmeticExpr) /** * {@inheritdoc} + * + * @return void */ public function walkPathExpression($pathExpr) { @@ -426,6 +516,8 @@ public function walkPathExpression($pathExpr) /** * {@inheritdoc} + * + * @return void */ public function walkResultVariable($resultVariable) { @@ -433,6 +525,8 @@ public function walkResultVariable($resultVariable) /** * {@inheritdoc} + * + * @return void */ public function getExecutor($AST) { diff --git a/lib/Doctrine/ORM/Query/TreeWalkerChain.php b/lib/Doctrine/ORM/Query/TreeWalkerChain.php index a3f94d0ea9..5118d92d44 100644 --- a/lib/Doctrine/ORM/Query/TreeWalkerChain.php +++ b/lib/Doctrine/ORM/Query/TreeWalkerChain.php @@ -70,6 +70,8 @@ public function getQueryComponents() /** * {@inheritdoc} + * + * @return void */ public function setQueryComponent($dqlAlias, array $queryComponent) { @@ -107,6 +109,8 @@ public function addTreeWalker($walkerClass) /** * {@inheritdoc} + * + * @return void */ public function walkSelectStatement(AST\SelectStatement $AST) { @@ -119,6 +123,8 @@ public function walkSelectStatement(AST\SelectStatement $AST) /** * {@inheritdoc} + * + * @return void */ public function walkSelectClause($selectClause) { @@ -129,6 +135,8 @@ public function walkSelectClause($selectClause) /** * {@inheritdoc} + * + * @return void */ public function walkFromClause($fromClause) { @@ -139,6 +147,8 @@ public function walkFromClause($fromClause) /** * {@inheritdoc} + * + * @return void */ public function walkFunction($function) { @@ -149,6 +159,8 @@ public function walkFunction($function) /** * {@inheritdoc} + * + * @return void */ public function walkOrderByClause($orderByClause) { @@ -159,6 +171,8 @@ public function walkOrderByClause($orderByClause) /** * {@inheritdoc} + * + * @return void */ public function walkOrderByItem($orderByItem) { @@ -169,6 +183,8 @@ public function walkOrderByItem($orderByItem) /** * {@inheritdoc} + * + * @return void */ public function walkHavingClause($havingClause) { @@ -179,6 +195,8 @@ public function walkHavingClause($havingClause) /** * {@inheritdoc} + * + * @return void */ public function walkJoin($join) { @@ -189,6 +207,8 @@ public function walkJoin($join) /** * {@inheritdoc} + * + * @return void */ public function walkSelectExpression($selectExpression) { @@ -199,6 +219,8 @@ public function walkSelectExpression($selectExpression) /** * {@inheritdoc} + * + * @return void */ public function walkQuantifiedExpression($qExpr) { @@ -209,6 +231,8 @@ public function walkQuantifiedExpression($qExpr) /** * {@inheritdoc} + * + * @return void */ public function walkSubselect($subselect) { @@ -219,6 +243,8 @@ public function walkSubselect($subselect) /** * {@inheritdoc} + * + * @return void */ public function walkSubselectFromClause($subselectFromClause) { @@ -229,6 +255,8 @@ public function walkSubselectFromClause($subselectFromClause) /** * {@inheritdoc} + * + * @return void */ public function walkSimpleSelectClause($simpleSelectClause) { @@ -239,6 +267,8 @@ public function walkSimpleSelectClause($simpleSelectClause) /** * {@inheritdoc} + * + * @return void */ public function walkSimpleSelectExpression($simpleSelectExpression) { @@ -249,6 +279,8 @@ public function walkSimpleSelectExpression($simpleSelectExpression) /** * {@inheritdoc} + * + * @return void */ public function walkAggregateExpression($aggExpression) { @@ -259,6 +291,8 @@ public function walkAggregateExpression($aggExpression) /** * {@inheritdoc} + * + * @return void */ public function walkGroupByClause($groupByClause) { @@ -269,6 +303,8 @@ public function walkGroupByClause($groupByClause) /** * {@inheritdoc} + * + * @return void */ public function walkGroupByItem($groupByItem) { @@ -279,6 +315,8 @@ public function walkGroupByItem($groupByItem) /** * {@inheritdoc} + * + * @return void */ public function walkUpdateStatement(AST\UpdateStatement $AST) { @@ -289,6 +327,8 @@ public function walkUpdateStatement(AST\UpdateStatement $AST) /** * {@inheritdoc} + * + * @return void */ public function walkDeleteStatement(AST\DeleteStatement $AST) { @@ -299,6 +339,8 @@ public function walkDeleteStatement(AST\DeleteStatement $AST) /** * {@inheritdoc} + * + * @return void */ public function walkDeleteClause(AST\DeleteClause $deleteClause) { @@ -309,6 +351,8 @@ public function walkDeleteClause(AST\DeleteClause $deleteClause) /** * {@inheritdoc} + * + * @return void */ public function walkUpdateClause($updateClause) { @@ -319,6 +363,8 @@ public function walkUpdateClause($updateClause) /** * {@inheritdoc} + * + * @return void */ public function walkUpdateItem($updateItem) { @@ -329,6 +375,8 @@ public function walkUpdateItem($updateItem) /** * {@inheritdoc} + * + * @return void */ public function walkWhereClause($whereClause) { @@ -339,6 +387,8 @@ public function walkWhereClause($whereClause) /** * {@inheritdoc} + * + * @return void */ public function walkConditionalExpression($condExpr) { @@ -349,6 +399,8 @@ public function walkConditionalExpression($condExpr) /** * {@inheritdoc} + * + * @return void */ public function walkConditionalTerm($condTerm) { @@ -359,6 +411,8 @@ public function walkConditionalTerm($condTerm) /** * {@inheritdoc} + * + * @return void */ public function walkConditionalFactor($factor) { @@ -369,6 +423,8 @@ public function walkConditionalFactor($factor) /** * {@inheritdoc} + * + * @return void */ public function walkConditionalPrimary($condPrimary) { @@ -379,6 +435,8 @@ public function walkConditionalPrimary($condPrimary) /** * {@inheritdoc} + * + * @return void */ public function walkExistsExpression($existsExpr) { @@ -389,6 +447,8 @@ public function walkExistsExpression($existsExpr) /** * {@inheritdoc} + * + * @return void */ public function walkCollectionMemberExpression($collMemberExpr) { @@ -399,6 +459,8 @@ public function walkCollectionMemberExpression($collMemberExpr) /** * {@inheritdoc} + * + * @return void */ public function walkEmptyCollectionComparisonExpression($emptyCollCompExpr) { @@ -409,6 +471,8 @@ public function walkEmptyCollectionComparisonExpression($emptyCollCompExpr) /** * {@inheritdoc} + * + * @return void */ public function walkNullComparisonExpression($nullCompExpr) { @@ -419,6 +483,8 @@ public function walkNullComparisonExpression($nullCompExpr) /** * {@inheritdoc} + * + * @return void */ public function walkInExpression($inExpr) { @@ -429,6 +495,8 @@ public function walkInExpression($inExpr) /** * {@inheritdoc} + * + * @return void */ public function walkInstanceOfExpression($instanceOfExpr) { @@ -439,6 +507,8 @@ public function walkInstanceOfExpression($instanceOfExpr) /** * {@inheritdoc} + * + * @return void */ public function walkLiteral($literal) { @@ -449,6 +519,8 @@ public function walkLiteral($literal) /** * {@inheritdoc} + * + * @return void */ public function walkBetweenExpression($betweenExpr) { @@ -459,6 +531,8 @@ public function walkBetweenExpression($betweenExpr) /** * {@inheritdoc} + * + * @return void */ public function walkLikeExpression($likeExpr) { @@ -469,6 +543,8 @@ public function walkLikeExpression($likeExpr) /** * {@inheritdoc} + * + * @return void */ public function walkStateFieldPathExpression($stateFieldPathExpression) { @@ -479,6 +555,8 @@ public function walkStateFieldPathExpression($stateFieldPathExpression) /** * {@inheritdoc} + * + * @return void */ public function walkComparisonExpression($compExpr) { @@ -489,6 +567,8 @@ public function walkComparisonExpression($compExpr) /** * {@inheritdoc} + * + * @return void */ public function walkInputParameter($inputParam) { @@ -499,6 +579,8 @@ public function walkInputParameter($inputParam) /** * {@inheritdoc} + * + * @return void */ public function walkArithmeticExpression($arithmeticExpr) { @@ -509,6 +591,8 @@ public function walkArithmeticExpression($arithmeticExpr) /** * {@inheritdoc} + * + * @return void */ public function walkArithmeticTerm($term) { @@ -519,6 +603,8 @@ public function walkArithmeticTerm($term) /** * {@inheritdoc} + * + * @return void */ public function walkStringPrimary($stringPrimary) { @@ -529,6 +615,8 @@ public function walkStringPrimary($stringPrimary) /** * {@inheritdoc} + * + * @return void */ public function walkArithmeticFactor($factor) { @@ -539,6 +627,8 @@ public function walkArithmeticFactor($factor) /** * {@inheritdoc} + * + * @return void */ public function walkSimpleArithmeticExpression($simpleArithmeticExpr) { @@ -549,6 +639,8 @@ public function walkSimpleArithmeticExpression($simpleArithmeticExpr) /** * {@inheritdoc} + * + * @return void */ public function walkPathExpression($pathExpr) { @@ -559,6 +651,8 @@ public function walkPathExpression($pathExpr) /** * {@inheritdoc} + * + * @return void */ public function walkResultVariable($resultVariable) { @@ -569,6 +663,8 @@ public function walkResultVariable($resultVariable) /** * {@inheritdoc} + * + * @return void */ public function getExecutor($AST) { diff --git a/lib/Doctrine/ORM/Query/TreeWalkerChainIterator.php b/lib/Doctrine/ORM/Query/TreeWalkerChainIterator.php index 65e4e05e21..955eb72100 100644 --- a/lib/Doctrine/ORM/Query/TreeWalkerChainIterator.php +++ b/lib/Doctrine/ORM/Query/TreeWalkerChainIterator.php @@ -56,7 +56,9 @@ public function __construct(TreeWalkerChain $treeWalkerChain, $query, $parserRes } /** - * {@inheritdoc} + * @return string|false + * + * @psalm-return class-string|false */ public function rewind() { @@ -64,7 +66,7 @@ public function rewind() } /** - * {@inheritdoc} + * @return TreeWalker|null */ public function current() { @@ -72,7 +74,7 @@ public function current() } /** - * {@inheritdoc} + * @return int */ public function key() { @@ -80,7 +82,7 @@ public function key() } /** - * {@inheritdoc} + * @return TreeWalker|null */ public function next() { @@ -106,7 +108,7 @@ public function offsetExists($offset) } /** - * {@inheritdoc} + * @return TreeWalker|null */ public function offsetGet($offset) { diff --git a/lib/Doctrine/ORM/QueryBuilder.php b/lib/Doctrine/ORM/QueryBuilder.php index 87dd5091fb..f590f4d5eb 100644 --- a/lib/Doctrine/ORM/QueryBuilder.php +++ b/lib/Doctrine/ORM/QueryBuilder.php @@ -574,6 +574,7 @@ public function setParameters($parameters) { // BC compatibility with 2.3- if (is_array($parameters)) { + /** @psalm-var ArrayCollection $parameterCollection */ $parameterCollection = new ArrayCollection(); foreach ($parameters as $key => $value) { diff --git a/lib/Doctrine/ORM/Tools/Console/Command/ConvertDoctrine1SchemaCommand.php b/lib/Doctrine/ORM/Tools/Console/Command/ConvertDoctrine1SchemaCommand.php index 90de7322ad..e9f2b5e05b 100644 --- a/lib/Doctrine/ORM/Tools/Console/Command/ConvertDoctrine1SchemaCommand.php +++ b/lib/Doctrine/ORM/Tools/Console/Command/ConvertDoctrine1SchemaCommand.php @@ -22,6 +22,7 @@ use Doctrine\ORM\Tools\ConvertDoctrine1Schema; use Doctrine\ORM\Tools\EntityGenerator; use Doctrine\ORM\Tools\Export\ClassMetadataExporter; +use Doctrine\ORM\Tools\Export\Driver\AnnotationExporter; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; @@ -130,7 +131,7 @@ protected function execute(InputInterface $input, OutputInterface $output) $toType = $input->getArgument('to-type'); $extend = $input->getOption('extend'); - $numSpaces = $input->getOption('num-spaces'); + $numSpaces = (int) $input->getOption('num-spaces'); $this->convertDoctrine1Schema($fromPaths, $destPath, $toType, $numSpaces, $extend, $output); @@ -180,7 +181,7 @@ public function convertDoctrine1Schema(array $fromPaths, $destPath, $toType, $nu $cme = $this->getMetadataExporter(); $exporter = $cme->getExporter($toType, $destPath); - if (strtolower($toType) === 'annotation') { + if ($exporter instanceof AnnotationExporter) { $entityGenerator = $this->getEntityGenerator(); $exporter->setEntityGenerator($entityGenerator); diff --git a/lib/Doctrine/ORM/Tools/Console/Command/ConvertMappingCommand.php b/lib/Doctrine/ORM/Tools/Console/Command/ConvertMappingCommand.php index 8de2b84a9e..eea9f34527 100644 --- a/lib/Doctrine/ORM/Tools/Console/Command/ConvertMappingCommand.php +++ b/lib/Doctrine/ORM/Tools/Console/Command/ConvertMappingCommand.php @@ -24,6 +24,7 @@ use Doctrine\ORM\Tools\DisconnectedClassMetadataFactory; use Doctrine\ORM\Tools\EntityGenerator; use Doctrine\ORM\Tools\Export\ClassMetadataExporter; +use Doctrine\ORM\Tools\Export\Driver\AnnotationExporter; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; @@ -136,11 +137,11 @@ protected function execute(InputInterface $input, OutputInterface $output) $exporter = $this->getExporter($toType, $destPath); $exporter->setOverwriteExistingFiles($input->getOption('force')); - if ($toType == 'annotation') { + if ($exporter instanceof AnnotationExporter) { $entityGenerator = new EntityGenerator(); $exporter->setEntityGenerator($entityGenerator); - $entityGenerator->setNumSpaces($input->getOption('num-spaces')); + $entityGenerator->setNumSpaces((int) $input->getOption('num-spaces')); if (($extend = $input->getOption('extend')) !== null) { $entityGenerator->setClassToExtend($extend); diff --git a/lib/Doctrine/ORM/Tools/Console/Command/GenerateEntitiesCommand.php b/lib/Doctrine/ORM/Tools/Console/Command/GenerateEntitiesCommand.php index f1bba22d2c..e3f982e353 100644 --- a/lib/Doctrine/ORM/Tools/Console/Command/GenerateEntitiesCommand.php +++ b/lib/Doctrine/ORM/Tools/Console/Command/GenerateEntitiesCommand.php @@ -124,7 +124,7 @@ protected function execute(InputInterface $input, OutputInterface $output) $entityGenerator->setGenerateStubMethods($input->getOption('generate-methods')); $entityGenerator->setRegenerateEntityIfExists($input->getOption('regenerate-entities')); $entityGenerator->setUpdateEntityIfExists($input->getOption('update-entities')); - $entityGenerator->setNumSpaces($input->getOption('num-spaces')); + $entityGenerator->setNumSpaces((int) $input->getOption('num-spaces')); $entityGenerator->setBackupExisting(!$input->getOption('no-backup')); if (($extend = $input->getOption('extend')) !== null) { diff --git a/lib/Doctrine/ORM/Tools/Console/Command/MappingDescribeCommand.php b/lib/Doctrine/ORM/Tools/Console/Command/MappingDescribeCommand.php index 97c6b7eae7..64a121b8f1 100644 --- a/lib/Doctrine/ORM/Tools/Console/Command/MappingDescribeCommand.php +++ b/lib/Doctrine/ORM/Tools/Console/Command/MappingDescribeCommand.php @@ -225,7 +225,7 @@ private function formatValue($value) } if (is_scalar($value)) { - return $value; + return (string) $value; } throw new \InvalidArgumentException(sprintf('Do not know how to format value "%s"', print_r($value, true))); diff --git a/lib/Doctrine/ORM/Tools/Console/Command/RunDqlCommand.php b/lib/Doctrine/ORM/Tools/Console/Command/RunDqlCommand.php index 7f4069202b..ae34c7fe21 100644 --- a/lib/Doctrine/ORM/Tools/Console/Command/RunDqlCommand.php +++ b/lib/Doctrine/ORM/Tools/Console/Command/RunDqlCommand.php @@ -109,7 +109,7 @@ protected function execute(InputInterface $input, OutputInterface $output) $resultSet = $query->execute([], constant($hydrationMode)); - $ui->text(Debug::dump($resultSet, $input->getOption('depth'), true, false)); + $ui->text(Debug::dump($resultSet, (int) $input->getOption('depth'), true, false)); return 0; } diff --git a/lib/Doctrine/ORM/Tools/Export/Driver/YamlExporter.php b/lib/Doctrine/ORM/Tools/Export/Driver/YamlExporter.php index 1fb960b333..1d2b582803 100644 --- a/lib/Doctrine/ORM/Tools/Export/Driver/YamlExporter.php +++ b/lib/Doctrine/ORM/Tools/Export/Driver/YamlExporter.php @@ -120,10 +120,7 @@ public function exportClassMetadata(ClassMetadataInfo $metadata) $array['id'] = $ids; if ($fieldMappings) { - if ( ! isset($array['fields'])) { - $array['fields'] = []; - } - $array['fields'] = array_merge($array['fields'], $fieldMappings); + $array['fields'] = $fieldMappings; } foreach ($metadata->associationMappings as $name => $associationMapping) { diff --git a/lib/Doctrine/ORM/Tools/Pagination/LimitSubqueryWalker.php b/lib/Doctrine/ORM/Tools/Pagination/LimitSubqueryWalker.php index 5614138a86..2f76e8565e 100644 --- a/lib/Doctrine/ORM/Tools/Pagination/LimitSubqueryWalker.php +++ b/lib/Doctrine/ORM/Tools/Pagination/LimitSubqueryWalker.php @@ -158,9 +158,7 @@ private function validate(SelectStatement $AST) /** * Retrieve either an IdentityFunction (IDENTITY(u.assoc)) or a state field (u.name). * - * @param \Doctrine\ORM\Query\AST\PathExpression $pathExpression - * - * @return \Doctrine\ORM\Query\AST\Functions\IdentityFunction + * @return IdentityFunction|PathExpression */ private function createSelectExpressionItem(PathExpression $pathExpression) { diff --git a/lib/Doctrine/ORM/Tools/Pagination/Paginator.php b/lib/Doctrine/ORM/Tools/Pagination/Paginator.php index 0008927363..de614cbd99 100644 --- a/lib/Doctrine/ORM/Tools/Pagination/Paginator.php +++ b/lib/Doctrine/ORM/Tools/Pagination/Paginator.php @@ -25,6 +25,7 @@ use Doctrine\ORM\Query\ResultSetMapping; use Doctrine\ORM\QueryBuilder; use function array_map; +use function array_sum; /** * The paginator can handle various complex scenarios with DQL. @@ -122,7 +123,7 @@ public function count() { if ($this->count === null) { try { - $this->count = array_sum(array_map('current', $this->getCountQuery()->getScalarResult())); + $this->count = (int) array_sum(array_map('current', $this->getCountQuery()->getScalarResult())); } catch (NoResultException $e) { $this->count = 0; } diff --git a/tests/Doctrine/Tests/ORM/Decorator/EntityManagerDecoratorTest.php b/tests/Doctrine/Tests/ORM/Decorator/EntityManagerDecoratorTest.php index e38c56973b..f3e309af65 100644 --- a/tests/Doctrine/Tests/ORM/Decorator/EntityManagerDecoratorTest.php +++ b/tests/Doctrine/Tests/ORM/Decorator/EntityManagerDecoratorTest.php @@ -21,6 +21,11 @@ class EntityManagerDecoratorTest extends TestCase 'refresh', 'flush', 'initializeObject', + 'beginTransaction', + 'commit', + 'rollback', + 'close', + 'lock', ]; /** From bb64fc953dcce4da425ff74d21a305202cc2683a Mon Sep 17 00:00:00 2001 From: Claudio Zizza <859964+SenseException@users.noreply.github.com> Date: Fri, 2 Oct 2020 20:31:00 +0200 Subject: [PATCH 118/136] Move website config to default branch (#8287) Adds the website config to be compatible with the doctrine/doctrine-website#356 changes --- .doctrine-project.json | 49 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .doctrine-project.json diff --git a/.doctrine-project.json b/.doctrine-project.json new file mode 100644 index 0000000000..0361aa4c67 --- /dev/null +++ b/.doctrine-project.json @@ -0,0 +1,49 @@ +{ + "active": true, + "name": "Object Relational Mapper", + "shortName": "ORM", + "slug": "orm", + "docsSlug": "doctrine-orm", + "versions": [ + { + "name": "3.0", + "branchName": "master", + "slug": "latest", + "upcoming": true + }, + { + "name": "2.8", + "branchName": "2.8.x", + "slug": "2.8", + "upcoming": true + }, + { + "name": "2.7", + "branchName": "2.7", + "slug": "2.7", + "current": true, + "aliases": [ + "current", + "stable" + ] + }, + { + "name": "2.6", + "branchName": "2.6", + "slug": "2.6", + "maintained": false + }, + { + "name": "2.5", + "branchName": "2.5", + "slug": "2.5", + "maintained": false + }, + { + "name": "2.4", + "branchName": "2.4", + "slug": "2.4", + "maintained": false + } + ] +} From 7d84a4998091ece4d645253ac65de9f879eeed2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Paris?= Date: Sat, 10 Oct 2020 19:11:26 +0200 Subject: [PATCH 119/136] Setup automated release workflow (#8301) --- .../workflows/release-on-milestone-closed.yml | 55 +++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 .github/workflows/release-on-milestone-closed.yml diff --git a/.github/workflows/release-on-milestone-closed.yml b/.github/workflows/release-on-milestone-closed.yml new file mode 100644 index 0000000000..70ccbdb2d6 --- /dev/null +++ b/.github/workflows/release-on-milestone-closed.yml @@ -0,0 +1,55 @@ +name: "Automatic Releases" + +on: + milestone: + types: + - "closed" + +jobs: + release: + name: "Git tag, release & create merge-up PR" + runs-on: "ubuntu-20.04" + + steps: + - name: "Checkout" + uses: "actions/checkout@v2" + + - name: "Release" + uses: "laminas/automatic-releases@v1" + with: + command-name: "laminas:automatic-releases:release" + env: + "GITHUB_TOKEN": ${{ secrets.GITHUB_TOKEN }} + "SIGNING_SECRET_KEY": ${{ secrets.SIGNING_SECRET_KEY }} + "GIT_AUTHOR_NAME": ${{ secrets.GIT_AUTHOR_NAME }} + "GIT_AUTHOR_EMAIL": ${{ secrets.GIT_AUTHOR_EMAIL }} + + - name: "Create Merge-Up Pull Request" + uses: "laminas/automatic-releases@v1" + with: + command-name: "laminas:automatic-releases:create-merge-up-pull-request" + env: + "GITHUB_TOKEN": ${{ secrets.GITHUB_TOKEN }} + "SIGNING_SECRET_KEY": ${{ secrets.SIGNING_SECRET_KEY }} + "GIT_AUTHOR_NAME": ${{ secrets.GIT_AUTHOR_NAME }} + "GIT_AUTHOR_EMAIL": ${{ secrets.GIT_AUTHOR_EMAIL }} + + - name: "Create and/or Switch to new Release Branch" + uses: "laminas/automatic-releases@v1" + with: + command-name: "laminas:automatic-releases:switch-default-branch-to-next-minor" + env: + "GITHUB_TOKEN": ${{ secrets.ORGANIZATION_ADMIN_TOKEN }} + "SIGNING_SECRET_KEY": ${{ secrets.SIGNING_SECRET_KEY }} + "GIT_AUTHOR_NAME": ${{ secrets.GIT_AUTHOR_NAME }} + "GIT_AUTHOR_EMAIL": ${{ secrets.GIT_AUTHOR_EMAIL }} + + - name: "Create new milestones" + uses: "laminas/automatic-releases@v1" + with: + command-name: "laminas:automatic-releases:create-milestones" + env: + "GITHUB_TOKEN": ${{ secrets.GITHUB_TOKEN }} + "SIGNING_SECRET_KEY": ${{ secrets.SIGNING_SECRET_KEY }} + "GIT_AUTHOR_NAME": ${{ secrets.GIT_AUTHOR_NAME }} + "GIT_AUTHOR_EMAIL": ${{ secrets.GIT_AUTHOR_EMAIL }} From 8fcc70cfbed098d1109ea1b7da2e3d30645f2657 Mon Sep 17 00:00:00 2001 From: Benjamin Eberlei Date: Sun, 11 Oct 2020 00:14:35 +0200 Subject: [PATCH 120/136] Change LOG_LEVEL to debug should expose more info from laminas/automatic-releases. --- .github/workflows/release-on-milestone-closed.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release-on-milestone-closed.yml b/.github/workflows/release-on-milestone-closed.yml index 70ccbdb2d6..98722a9ab3 100644 --- a/.github/workflows/release-on-milestone-closed.yml +++ b/.github/workflows/release-on-milestone-closed.yml @@ -23,6 +23,7 @@ jobs: "SIGNING_SECRET_KEY": ${{ secrets.SIGNING_SECRET_KEY }} "GIT_AUTHOR_NAME": ${{ secrets.GIT_AUTHOR_NAME }} "GIT_AUTHOR_EMAIL": ${{ secrets.GIT_AUTHOR_EMAIL }} + "LOG_LEVEL": "debug" - name: "Create Merge-Up Pull Request" uses: "laminas/automatic-releases@v1" From 59fd9b5ea7fd7a5264bd88e1ee32ae556c7244fb Mon Sep 17 00:00:00 2001 From: Benjamin Eberlei Date: Sun, 11 Oct 2020 00:17:52 +0200 Subject: [PATCH 121/136] Change LOG_LEVEL to debug should expose more info from laminas/automatic-releases. --- .github/workflows/release-on-milestone-closed.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-on-milestone-closed.yml b/.github/workflows/release-on-milestone-closed.yml index 98722a9ab3..5088910480 100644 --- a/.github/workflows/release-on-milestone-closed.yml +++ b/.github/workflows/release-on-milestone-closed.yml @@ -23,7 +23,7 @@ jobs: "SIGNING_SECRET_KEY": ${{ secrets.SIGNING_SECRET_KEY }} "GIT_AUTHOR_NAME": ${{ secrets.GIT_AUTHOR_NAME }} "GIT_AUTHOR_EMAIL": ${{ secrets.GIT_AUTHOR_EMAIL }} - "LOG_LEVEL": "debug" + "LOG_LEVEL": "DEBUG" - name: "Create Merge-Up Pull Request" uses: "laminas/automatic-releases@v1" From 8d250f592114d9ff66f22fe7f35dd37ef041c386 Mon Sep 17 00:00:00 2001 From: Benjamin Eberlei Date: Sun, 11 Oct 2020 12:03:57 +0200 Subject: [PATCH 122/136] Use SHELL_VERBOSITY=3 instead of LOG_LEVEL=DEBUG --- .github/workflows/release-on-milestone-closed.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-on-milestone-closed.yml b/.github/workflows/release-on-milestone-closed.yml index 5088910480..f9980aa9ca 100644 --- a/.github/workflows/release-on-milestone-closed.yml +++ b/.github/workflows/release-on-milestone-closed.yml @@ -23,7 +23,7 @@ jobs: "SIGNING_SECRET_KEY": ${{ secrets.SIGNING_SECRET_KEY }} "GIT_AUTHOR_NAME": ${{ secrets.GIT_AUTHOR_NAME }} "GIT_AUTHOR_EMAIL": ${{ secrets.GIT_AUTHOR_EMAIL }} - "LOG_LEVEL": "DEBUG" + "SHELL_VERBOSITY": "3" - name: "Create Merge-Up Pull Request" uses: "laminas/automatic-releases@v1" From 4d2908a0659e5219fa0cc25a4fbe564506a20d0d Mon Sep 17 00:00:00 2001 From: Benjamin Eberlei Date: Sun, 11 Oct 2020 19:14:47 +0200 Subject: [PATCH 123/136] Change to false for better readability of test output. --- phpunit.xml.dist | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index ea31c212af..818ffb7484 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -14,7 +14,7 @@ From 18d96fcc020db31353d953171e4978da3b0dd0cd Mon Sep 17 00:00:00 2001 From: Thomas Landauer Date: Mon, 12 Oct 2020 21:27:18 +0200 Subject: [PATCH 124/136] Update working-with-indexed-associations.rst (#8298) * Update working-with-indexed-associations.rst Fixing broken link * Update docs/en/tutorials/working-with-indexed-associations.rst Co-authored-by: Claudio Zizza <859964+SenseException@users.noreply.github.com> Co-authored-by: Claudio Zizza <859964+SenseException@users.noreply.github.com> --- docs/en/tutorials/working-with-indexed-associations.rst | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/en/tutorials/working-with-indexed-associations.rst b/docs/en/tutorials/working-with-indexed-associations.rst index 0381764bee..a0045bebcb 100644 --- a/docs/en/tutorials/working-with-indexed-associations.rst +++ b/docs/en/tutorials/working-with-indexed-associations.rst @@ -291,6 +291,5 @@ Outlook into the Future ~~~~~~~~~~~~~~~~~~~~~~~ For the inverse side of a many-to-many associations there will be a way to persist the keys and the order -as a third and fourth parameter into the join table. This feature is discussed in `DDC-213 `_ +as a third and fourth parameter into the join table. This feature is discussed in `#2817 `_ This feature cannot be implemented for one-to-many associations, because they are never the owning side. - From 5fde5801c152227ac7da00768633c9a06a779f5d Mon Sep 17 00:00:00 2001 From: Laurent VOULLEMIER Date: Tue, 13 Oct 2020 21:52:04 +0200 Subject: [PATCH 125/136] Fix many typos (#8299) - Some uppercase letters were used in the middle of sentence - Some dots were missing - There was two sentences with wrong or missing words --- docs/en/reference/second-level-cache.rst | 59 +++++++++++++----------- 1 file changed, 32 insertions(+), 27 deletions(-) diff --git a/docs/en/reference/second-level-cache.rst b/docs/en/reference/second-level-cache.rst index 8a0b4c2310..5b97c131e1 100644 --- a/docs/en/reference/second-level-cache.rst +++ b/docs/en/reference/second-level-cache.rst @@ -77,11 +77,10 @@ A query region might be something like : Cache Regions ------------- -``Doctrine\ORM\Cache\Region\DefaultRegion`` It's the default implementation. +``Doctrine\ORM\Cache\Region\DefaultRegion`` is the default implementation. A simplest cache region compatible with all doctrine-cache drivers but does not support locking. - ``Doctrine\ORM\Cache\Region`` and ``Doctrine\ORM\Cache\ConcurrentRegion`` -Defines contracts that should be implemented by a cache provider. +define contracts that should be implemented by a cache provider. It allows you to provide your own cache implementation that might take advantage of specific cache driver. @@ -91,11 +90,8 @@ If you want to support locking for ``READ_WRITE`` strategies you should implemen Cache region ~~~~~~~~~~~~ -Defines a contract for accessing a particular region. - -``Doctrine\ORM\Cache\Region`` - -Defines a contract for accessing a particular cache region. +``Doctrine\ORM\Cache\Region`` defines a contract for accessing a particular +cache region. `See API Doc `_. @@ -107,9 +103,7 @@ By default, Doctrine provides a very simple implementation based on file locks ` If you want to use an ``READ_WRITE`` cache, you should consider providing your own cache region. -``Doctrine\ORM\Cache\ConcurrentRegion`` - -Defines contract for concurrently managed data region. +``Doctrine\ORM\Cache\ConcurrentRegion`` defines a contract for concurrently managed data region. `See API Doc `_. @@ -177,7 +171,7 @@ Doctrine allows you to specify configurations and some points of extension for t Enable Second Level Cache ~~~~~~~~~~~~~~~~~~~~~~~~~ -To enable the second-level-cache, you should provide a cache factory +To enable the second-level-cache, you should provide a cache factory. ``\Doctrine\ORM\Cache\DefaultCacheFactory`` is the default implementation. .. code-block:: php @@ -203,11 +197,16 @@ Cache Factory is the main point of extension. It allows you to provide a specific implementation of the following components : -* ``QueryCache`` Store and retrieve query cache results. -* ``CachedEntityPersister`` Store and retrieve entity results. -* ``CachedCollectionPersister`` Store and retrieve query results. -* ``EntityHydrator`` Transform an entity into a cache entry and cache entry into entities -* ``CollectionHydrator`` Transform a collection into a cache entry and cache entry into collection +``QueryCache`` + stores and retrieves query cache results. +``CachedEntityPersister`` + stores and retrieves entity results. +``CachedCollectionPersister`` + stores and retrieves query results. +``EntityHydrator`` + transforms entities into a cache entries and cache entries into entities +``CollectionHydrator`` + transforms collections into cache entries and cache entries into collections `See API Doc `_. @@ -225,8 +224,8 @@ To specify a default lifetime for all regions or specify a different lifetime fo $regionConfig = $cacheConfig->getRegionsConfiguration(); // Cache Region lifetime - $regionConfig->setLifetime('my_entity_region', 3600); // Time to live for a specific region; In seconds - $regionConfig->setDefaultLifetime(7200); // Default time to live; In seconds + $regionConfig->setLifetime('my_entity_region', 3600); // Time to live for a specific region (in seconds) + $regionConfig->setDefaultLifetime(7200); // Default time to live (in seconds) Cache Log @@ -267,8 +266,9 @@ By providing a cache logger you should be able to get information about all cach // Get the total number of cached entries *not* found in all regions. $logger->getMissCount(); -If you want to get more information you should implement ``\Doctrine\ORM\Cache\Logging\CacheLogger``. -and collect all information you want. +If you want to get more information you should implement +``\Doctrine\ORM\Cache\Logging\CacheLogger`` and collect +all the information you want. `See API Doc `_. @@ -277,8 +277,11 @@ Entity cache definition ----------------------- * Entity cache configuration allows you to define the caching strategy and region for an entity. - * ``usage`` Specifies the caching strategy: ``READ_ONLY``, ``NONSTRICT_READ_WRITE``, ``READ_WRITE``. see :ref:`reference-second-level-cache-mode` - * ``region`` Optional value that specifies the name of the second level cache region. + * ``usage`` specifies the caching strategy: ``READ_ONLY``, +`NONSTRICT_READ_WRITE``, ``READ_WRITE``. +See :ref:`reference-second-level-cache-mode`. + * ``region`` is an optional value that specifies the name of the second +level cache region. .. configuration-block:: @@ -579,7 +582,8 @@ The Cache Mode controls how a particular query interacts with the second-level c DELETE / UPDATE queries ~~~~~~~~~~~~~~~~~~~~~~~ -DQL UPDATE / DELETE statements are ported directly into a database and bypass the second-level cache, +DQL UPDATE / DELETE statements are ported directly into a database and bypass +the second-level cache. Entities that are already cached will NOT be invalidated. However the cached data could be evicted using the cache API or an special query hint. @@ -622,7 +626,7 @@ Using the repository query cache -------------------------------- As well as ``Query Cache`` all persister queries store only identifier values for an individual query. -All persister use a single timestamps cache region keeps track of the last update for each persister, +All persisters use a single timestamp cache region to keep track of the last update for each persister, When a query is loaded from cache, the timestamp region is checked for the last update for that persister. Using the last update timestamps as part of the query key invalidate the cache key when an update occurs. @@ -641,7 +645,7 @@ Using the last update timestamps as part of the query key invalidate the cache k $em->clear(); // Reload from database. - // At this point the query cache key if not logger valid, the select goes straight + // At this point the query cache key is no longer valid, the select goes straight to the database $entities = $em->getRepository('Entity\Country')->findAll(); Cache API @@ -728,4 +732,5 @@ Paginator ~~~~~~~~~ Count queries generated by ``Doctrine\ORM\Tools\Pagination\Paginator`` are not cached by second-level cache. -Although entities and query result are cached count queries will hit the database every time. +Although entities and query result are cached, count queries will hit the +database every time. From ca27cc3f72c9a8c149ac5195687c1cc2474ff96d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Sat, 17 Oct 2020 19:04:42 +0200 Subject: [PATCH 126/136] Fix EOL of text files (#8310) --- bin/doctrine.bat | 18 +- docs/bin/generate-docs.sh | 2 +- docs/bin/install-dependencies.sh | 2 +- docs/en/make.bat | 226 +++++++++--------- .../ORM/Query/AST/ParenthesisExpression.php | 2 +- .../Performance/Mock/NonLoadingPersister.php | 2 +- .../Mock/NonProxyLoadingEntityManager.php | 2 +- .../Tests/Models/CMS/CmsAddressDTO.php | 2 +- .../Tests/Models/CMS/CmsAddressListener.php | 2 +- tests/Doctrine/Tests/Models/CMS/CmsEmail.php | 2 +- .../Doctrine/Tests/Models/CMS/CmsUserDTO.php | 2 +- .../Tests/Models/Company/CompanyCar.php | 2 +- .../Tests/Models/Company/CompanyEvent.php | 2 +- .../Tests/Models/Company/CompanyRaffle.php | 2 +- .../Models/DDC117/DDC117ApproveChanges.php | 2 +- .../Models/DDC117/DDC117ArticleDetails.php | 2 +- .../Tests/Models/DDC117/DDC117Editor.php | 2 +- .../Tests/Models/DDC1872/DDC1872Bar.php | 2 +- .../Tests/Models/DDC2372/DDC2372Address.php | 2 +- .../Tests/Models/DDC2372/DDC2372Admin.php | 2 +- .../Tests/Models/DDC2372/DDC2372User.php | 2 +- .../DDC2372/Traits/DDC2372AddressTrait.php | 2 +- .../DDC3597/Embeddable/DDC3597Dimension.php | 2 +- .../Tests/Models/DDC964/DDC964Address.php | 2 +- .../Tests/Models/Forum/ForumAdministrator.php | 2 +- .../Tests/Models/Generic/BooleanModel.php | 2 +- .../Tests/Models/Generic/DecimalModel.php | 2 +- .../Models/Generic/NonAlphaColumnsEntity.php | 2 +- .../Models/Generic/SerializationModel.php | 2 +- .../Models/Global/GlobalNamespaceModel.php | 2 +- .../AnotherChildClass.php | 2 +- .../JoinedInheritanceType/ChildClass.php | 2 +- .../JoinedInheritanceType/RootClass.php | 2 +- .../Tests/Models/Navigation/NavCountry.php | 2 +- .../Tests/Models/Navigation/NavPhotos.php | 2 +- .../Tests/Models/Navigation/NavTour.php | 2 +- .../Tests/Models/Quote/NumericEntity.php | 2 +- .../Tests/Models/Routing/RoutingLeg.php | 2 +- .../Tests/Models/Routing/RoutingLocation.php | 2 +- .../Models/Routing/RoutingRouteBooking.php | 2 +- .../Tests/Models/StockExchange/Bond.php | 2 +- .../Tests/Models/StockExchange/Market.php | 2 +- .../Tests/Models/StockExchange/Stock.php | 2 +- .../Mapping/EntityListenerResolverTest.php | 2 +- ...trine.Tests.Models.DDC889.DDC889Entity.php | 2 +- .../ORM/Mapping/xml/DDC2429Novel.orm.xml | 2 +- ...ctrine.Tests.Models.CMS.CmsAddress.dcm.xml | 2 +- .../Doctrine.Tests.Models.Cache.City.dcm.xml | 2 +- ...sts.Models.Company.CompanyContract.dcm.xml | 2 +- ....Models.Company.CompanyFixContract.dcm.xml | 2 +- ...Models.Company.CompanyFlexContract.dcm.xml | 2 +- ...s.Company.CompanyFlexUltraContract.dcm.xml | 2 +- ...Tests.Models.Company.CompanyPerson.dcm.xml | 2 +- ...ts.Models.DDC117.DDC117Translation.dcm.xml | 2 +- ....DDC1476EntityWithDefaultFieldType.dcm.xml | 2 +- ....Models.DDC869.DDC869ChequePayment.dcm.xml | 2 +- ...els.DDC869.DDC869CreditCardPayment.dcm.xml | 2 +- ....Tests.Models.DDC869.DDC869Payment.dcm.xml | 2 +- ...ne.Tests.Models.DDC889.DDC889Class.dcm.xml | 2 +- ...e.Tests.Models.DDC889.DDC889Entity.dcm.xml | 2 +- ...sts.Models.DDC889.DDC889SuperClass.dcm.xml | 2 +- ...ne.Tests.Models.DDC964.DDC964Admin.dcm.xml | 2 +- ...ne.Tests.Models.DDC964.DDC964Guest.dcm.xml | 2 +- ...ine.Tests.Models.DDC964.DDC964User.dcm.xml | 2 +- ....Models.Generic.SerializationModel.dcm.xml | 2 +- .../Doctrine.Tests.ORM.Mapping.CTI.dcm.xml | 2 +- ...ne.Tests.ORM.Mapping.DDC1170Entity.dcm.xml | 2 +- ...ine.Tests.ORM.Mapping.DDC807Entity.dcm.xml | 2 +- ...completeDiscriminatorColumnMapping.dcm.xml | 2 +- ...EntityNoDiscriminatorColumnMapping.dcm.xml | 2 +- .../Doctrine.Tests.Models.Cache.City.dcm.yml | 2 +- ...sts.Models.Company.CompanyContract.dcm.yml | 2 +- ....Models.Company.CompanyFixContract.dcm.yml | 2 +- ...Models.Company.CompanyFlexContract.dcm.yml | 2 +- ...s.Company.CompanyFlexUltraContract.dcm.yml | 2 +- ...ests.Models.DDC3711.DDC3711EntityA.dcm.yml | 2 +- ....Models.DDC869.DDC869ChequePayment.dcm.yml | 2 +- ...els.DDC869.DDC869CreditCardPayment.dcm.yml | 2 +- ....Tests.Models.DDC869.DDC869Payment.dcm.yml | 2 +- ...ne.Tests.Models.DDC889.DDC889Class.dcm.yml | 2 +- ...e.Tests.Models.DDC889.DDC889Entity.dcm.yml | 2 +- ...sts.Models.DDC889.DDC889SuperClass.dcm.yml | 2 +- ...ne.Tests.Models.DDC964.DDC964Admin.dcm.yml | 2 +- ...ne.Tests.Models.DDC964.DDC964Guest.dcm.yml | 2 +- ...ine.Tests.Models.DDC964.DDC964User.dcm.yml | 2 +- ....Models.Generic.SerializationModel.dcm.yml | 2 +- ...ne.Tests.ORM.Mapping.DDC1170Entity.dcm.yml | 2 +- ...ine.Tests.ORM.Mapping.DDC807Entity.dcm.yml | 2 +- ...completeDiscriminatorColumnMapping.dcm.yml | 2 +- ...EntityNoDiscriminatorColumnMapping.dcm.yml | 2 +- .../ORM/Tools/doctrine1schema/schema.yml | 2 +- tools/sandbox/Entities/Address.php | 2 +- tools/sandbox/Entities/User.php | 2 +- tools/sandbox/xml/Entities.Address.dcm.xml | 2 +- tools/sandbox/yaml/Entities.Address.dcm.yml | 2 +- 95 files changed, 215 insertions(+), 215 deletions(-) diff --git a/bin/doctrine.bat b/bin/doctrine.bat index a9e8ceefd9..a91645cc45 100644 --- a/bin/doctrine.bat +++ b/bin/doctrine.bat @@ -1,9 +1,9 @@ -@echo off - -if "%PHPBIN%" == "" set PHPBIN=@php_bin@ -if not exist "%PHPBIN%" if "%PHP_PEAR_PHP_BIN%" neq "" goto USE_PEAR_PATH -GOTO RUN -:USE_PEAR_PATH -set PHPBIN=%PHP_PEAR_PHP_BIN% -:RUN -"%PHPBIN%" "@bin_dir@\doctrine" %* +@echo off + +if "%PHPBIN%" == "" set PHPBIN=@php_bin@ +if not exist "%PHPBIN%" if "%PHP_PEAR_PHP_BIN%" neq "" goto USE_PEAR_PATH +GOTO RUN +:USE_PEAR_PATH +set PHPBIN=%PHP_PEAR_PHP_BIN% +:RUN +"%PHPBIN%" "@bin_dir@\doctrine" %* diff --git a/docs/bin/generate-docs.sh b/docs/bin/generate-docs.sh index 7d06d2a8dd..27b8c807a6 100755 --- a/docs/bin/generate-docs.sh +++ b/docs/bin/generate-docs.sh @@ -7,4 +7,4 @@ rm build -Rf sphinx-build en build sphinx-build -b latex en build/pdf -rubber --into build/pdf --pdf build/pdf/Doctrine2ORM.tex \ No newline at end of file +rubber --into build/pdf --pdf build/pdf/Doctrine2ORM.tex diff --git a/docs/bin/install-dependencies.sh b/docs/bin/install-dependencies.sh index 9ee43bd07a..d9cc076356 100644 --- a/docs/bin/install-dependencies.sh +++ b/docs/bin/install-dependencies.sh @@ -1,2 +1,2 @@ #!/bin/bash -sudo apt-get update && sudo apt-get install -y python2.7 python-sphinx python-pygments \ No newline at end of file +sudo apt-get update && sudo apt-get install -y python2.7 python-sphinx python-pygments diff --git a/docs/en/make.bat b/docs/en/make.bat index 53c40c9129..38fcba6007 100644 --- a/docs/en/make.bat +++ b/docs/en/make.bat @@ -1,113 +1,113 @@ -@ECHO OFF - -REM Command file for Sphinx documentation - -set SPHINXBUILD=sphinx-build -set BUILDDIR=_build -set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% . -if NOT "%PAPER%" == "" ( - set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS% -) - -if "%1" == "" goto help - -if "%1" == "help" ( - :help - echo.Please use `make ^` where ^ is one of - echo. html to make standalone HTML files - echo. dirhtml to make HTML files named index.html in directories - echo. pickle to make pickle files - echo. json to make JSON files - echo. htmlhelp to make HTML files and a HTML help project - echo. qthelp to make HTML files and a qthelp project - echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter - echo. changes to make an overview over all changed/added/deprecated items - echo. linkcheck to check all external links for integrity - echo. doctest to run all doctests embedded in the documentation if enabled - goto end -) - -if "%1" == "clean" ( - for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i - del /q /s %BUILDDIR%\* - goto end -) - -if "%1" == "html" ( - %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html - echo. - echo.Build finished. The HTML pages are in %BUILDDIR%/html. - goto end -) - -if "%1" == "dirhtml" ( - %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml - echo. - echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml. - goto end -) - -if "%1" == "pickle" ( - %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle - echo. - echo.Build finished; now you can process the pickle files. - goto end -) - -if "%1" == "json" ( - %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json - echo. - echo.Build finished; now you can process the JSON files. - goto end -) - -if "%1" == "htmlhelp" ( - %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp - echo. - echo.Build finished; now you can run HTML Help Workshop with the ^ -.hhp project file in %BUILDDIR%/htmlhelp. - goto end -) - -if "%1" == "qthelp" ( - %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp - echo. - echo.Build finished; now you can run "qcollectiongenerator" with the ^ -.qhcp project file in %BUILDDIR%/qthelp, like this: - echo.^> qcollectiongenerator %BUILDDIR%\qthelp\Doctrine2ORM.qhcp - echo.To view the help file: - echo.^> assistant -collectionFile %BUILDDIR%\qthelp\Doctrine2ORM.ghc - goto end -) - -if "%1" == "latex" ( - %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex - echo. - echo.Build finished; the LaTeX files are in %BUILDDIR%/latex. - goto end -) - -if "%1" == "changes" ( - %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes - echo. - echo.The overview file is in %BUILDDIR%/changes. - goto end -) - -if "%1" == "linkcheck" ( - %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck - echo. - echo.Link check complete; look for any errors in the above output ^ -or in %BUILDDIR%/linkcheck/output.txt. - goto end -) - -if "%1" == "doctest" ( - %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest - echo. - echo.Testing of doctests in the sources finished, look at the ^ -results in %BUILDDIR%/doctest/output.txt. - goto end -) - -:end +@ECHO OFF + +REM Command file for Sphinx documentation + +set SPHINXBUILD=sphinx-build +set BUILDDIR=_build +set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% . +if NOT "%PAPER%" == "" ( + set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS% +) + +if "%1" == "" goto help + +if "%1" == "help" ( + :help + echo.Please use `make ^` where ^ is one of + echo. html to make standalone HTML files + echo. dirhtml to make HTML files named index.html in directories + echo. pickle to make pickle files + echo. json to make JSON files + echo. htmlhelp to make HTML files and a HTML help project + echo. qthelp to make HTML files and a qthelp project + echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter + echo. changes to make an overview over all changed/added/deprecated items + echo. linkcheck to check all external links for integrity + echo. doctest to run all doctests embedded in the documentation if enabled + goto end +) + +if "%1" == "clean" ( + for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i + del /q /s %BUILDDIR%\* + goto end +) + +if "%1" == "html" ( + %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html + echo. + echo.Build finished. The HTML pages are in %BUILDDIR%/html. + goto end +) + +if "%1" == "dirhtml" ( + %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml + echo. + echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml. + goto end +) + +if "%1" == "pickle" ( + %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle + echo. + echo.Build finished; now you can process the pickle files. + goto end +) + +if "%1" == "json" ( + %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json + echo. + echo.Build finished; now you can process the JSON files. + goto end +) + +if "%1" == "htmlhelp" ( + %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp + echo. + echo.Build finished; now you can run HTML Help Workshop with the ^ +.hhp project file in %BUILDDIR%/htmlhelp. + goto end +) + +if "%1" == "qthelp" ( + %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp + echo. + echo.Build finished; now you can run "qcollectiongenerator" with the ^ +.qhcp project file in %BUILDDIR%/qthelp, like this: + echo.^> qcollectiongenerator %BUILDDIR%\qthelp\Doctrine2ORM.qhcp + echo.To view the help file: + echo.^> assistant -collectionFile %BUILDDIR%\qthelp\Doctrine2ORM.ghc + goto end +) + +if "%1" == "latex" ( + %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex + echo. + echo.Build finished; the LaTeX files are in %BUILDDIR%/latex. + goto end +) + +if "%1" == "changes" ( + %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes + echo. + echo.The overview file is in %BUILDDIR%/changes. + goto end +) + +if "%1" == "linkcheck" ( + %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck + echo. + echo.Link check complete; look for any errors in the above output ^ +or in %BUILDDIR%/linkcheck/output.txt. + goto end +) + +if "%1" == "doctest" ( + %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest + echo. + echo.Testing of doctests in the sources finished, look at the ^ +results in %BUILDDIR%/doctest/output.txt. + goto end +) + +:end diff --git a/lib/Doctrine/ORM/Query/AST/ParenthesisExpression.php b/lib/Doctrine/ORM/Query/AST/ParenthesisExpression.php index f16db0eb74..307a5cce39 100644 --- a/lib/Doctrine/ORM/Query/AST/ParenthesisExpression.php +++ b/lib/Doctrine/ORM/Query/AST/ParenthesisExpression.php @@ -48,4 +48,4 @@ public function dispatch($walker) { return $walker->walkParenthesisExpression($this); } -} \ No newline at end of file +} diff --git a/tests/Doctrine/Performance/Mock/NonLoadingPersister.php b/tests/Doctrine/Performance/Mock/NonLoadingPersister.php index 35881c5a94..390beb5457 100644 --- a/tests/Doctrine/Performance/Mock/NonLoadingPersister.php +++ b/tests/Doctrine/Performance/Mock/NonLoadingPersister.php @@ -28,4 +28,4 @@ public function load( ) { return $entity; } -} \ No newline at end of file +} diff --git a/tests/Doctrine/Performance/Mock/NonProxyLoadingEntityManager.php b/tests/Doctrine/Performance/Mock/NonProxyLoadingEntityManager.php index e25224ec2b..b00dd06cc7 100644 --- a/tests/Doctrine/Performance/Mock/NonProxyLoadingEntityManager.php +++ b/tests/Doctrine/Performance/Mock/NonProxyLoadingEntityManager.php @@ -349,4 +349,4 @@ public function contains($object) { return $this->realEntityManager->contains($object); } -} \ No newline at end of file +} diff --git a/tests/Doctrine/Tests/Models/CMS/CmsAddressDTO.php b/tests/Doctrine/Tests/Models/CMS/CmsAddressDTO.php index 2a4f220f8c..d01f1c90be 100644 --- a/tests/Doctrine/Tests/Models/CMS/CmsAddressDTO.php +++ b/tests/Doctrine/Tests/Models/CMS/CmsAddressDTO.php @@ -14,4 +14,4 @@ public function __construct($country = null, $city = null, $zip = null) $this->city = $city; $this->zip = $zip; } -} \ No newline at end of file +} diff --git a/tests/Doctrine/Tests/Models/CMS/CmsAddressListener.php b/tests/Doctrine/Tests/Models/CMS/CmsAddressListener.php index 9c9db89eb1..75bdf86099 100644 --- a/tests/Doctrine/Tests/Models/CMS/CmsAddressListener.php +++ b/tests/Doctrine/Tests/Models/CMS/CmsAddressListener.php @@ -55,4 +55,4 @@ protected function prePersistHandler() { throw new \BadMethodCallException("This is not a valid callback"); } -} \ No newline at end of file +} diff --git a/tests/Doctrine/Tests/Models/CMS/CmsEmail.php b/tests/Doctrine/Tests/Models/CMS/CmsEmail.php index c79c30036a..e72a597d88 100644 --- a/tests/Doctrine/Tests/Models/CMS/CmsEmail.php +++ b/tests/Doctrine/Tests/Models/CMS/CmsEmail.php @@ -45,4 +45,4 @@ public function getUser() { public function setUser(CmsUser $user) { $this->user = $user; } -} \ No newline at end of file +} diff --git a/tests/Doctrine/Tests/Models/CMS/CmsUserDTO.php b/tests/Doctrine/Tests/Models/CMS/CmsUserDTO.php index 0a07d26c16..ba9fb379e0 100644 --- a/tests/Doctrine/Tests/Models/CMS/CmsUserDTO.php +++ b/tests/Doctrine/Tests/Models/CMS/CmsUserDTO.php @@ -16,4 +16,4 @@ public function __construct($name = null, $email = null, $address = null, $phone $this->address = $address; $this->phonenumbers = $phonenumbers; } -} \ No newline at end of file +} diff --git a/tests/Doctrine/Tests/Models/Company/CompanyCar.php b/tests/Doctrine/Tests/Models/Company/CompanyCar.php index 5af89b2a32..9c7b7286aa 100644 --- a/tests/Doctrine/Tests/Models/Company/CompanyCar.php +++ b/tests/Doctrine/Tests/Models/Company/CompanyCar.php @@ -30,4 +30,4 @@ public function getId() { public function getBrand() { return $this->title; } -} \ No newline at end of file +} diff --git a/tests/Doctrine/Tests/Models/Company/CompanyEvent.php b/tests/Doctrine/Tests/Models/Company/CompanyEvent.php index bb320aa91a..bf6620e472 100644 --- a/tests/Doctrine/Tests/Models/Company/CompanyEvent.php +++ b/tests/Doctrine/Tests/Models/Company/CompanyEvent.php @@ -33,4 +33,4 @@ public function setOrganization(CompanyOrganization $org) { $this->organization = $org; } -} \ No newline at end of file +} diff --git a/tests/Doctrine/Tests/Models/Company/CompanyRaffle.php b/tests/Doctrine/Tests/Models/Company/CompanyRaffle.php index 733190d584..f893c0db9a 100644 --- a/tests/Doctrine/Tests/Models/Company/CompanyRaffle.php +++ b/tests/Doctrine/Tests/Models/Company/CompanyRaffle.php @@ -14,4 +14,4 @@ public function setData($data) { public function getData() { return $this->data; } -} \ No newline at end of file +} diff --git a/tests/Doctrine/Tests/Models/DDC117/DDC117ApproveChanges.php b/tests/Doctrine/Tests/Models/DDC117/DDC117ApproveChanges.php index 0a65b62fab..f0cd028ae0 100644 --- a/tests/Doctrine/Tests/Models/DDC117/DDC117ApproveChanges.php +++ b/tests/Doctrine/Tests/Models/DDC117/DDC117ApproveChanges.php @@ -62,4 +62,4 @@ public function getTranslation() { return $this->translation; } -} \ No newline at end of file +} diff --git a/tests/Doctrine/Tests/Models/DDC117/DDC117ArticleDetails.php b/tests/Doctrine/Tests/Models/DDC117/DDC117ArticleDetails.php index ae13df036f..ab1d4bfb9f 100644 --- a/tests/Doctrine/Tests/Models/DDC117/DDC117ArticleDetails.php +++ b/tests/Doctrine/Tests/Models/DDC117/DDC117ArticleDetails.php @@ -36,4 +36,4 @@ public function getText() { return $this->text; } -} \ No newline at end of file +} diff --git a/tests/Doctrine/Tests/Models/DDC117/DDC117Editor.php b/tests/Doctrine/Tests/Models/DDC117/DDC117Editor.php index a323bb3045..2b1c502d6f 100644 --- a/tests/Doctrine/Tests/Models/DDC117/DDC117Editor.php +++ b/tests/Doctrine/Tests/Models/DDC117/DDC117Editor.php @@ -51,4 +51,4 @@ public function addLastTranslation(DDC117Translation $t) $this->lastTranslation = $t; $t->lastTranslatedBy[] = $this; } -} \ No newline at end of file +} diff --git a/tests/Doctrine/Tests/Models/DDC1872/DDC1872Bar.php b/tests/Doctrine/Tests/Models/DDC1872/DDC1872Bar.php index ea170aeff6..5b049ccde0 100644 --- a/tests/Doctrine/Tests/Models/DDC1872/DDC1872Bar.php +++ b/tests/Doctrine/Tests/Models/DDC1872/DDC1872Bar.php @@ -9,4 +9,4 @@ class DDC1872Bar { /** @Id @Column(type="string") */ private $id; -} \ No newline at end of file +} diff --git a/tests/Doctrine/Tests/Models/DDC2372/DDC2372Address.php b/tests/Doctrine/Tests/Models/DDC2372/DDC2372Address.php index 26144c61d5..15f4786a62 100644 --- a/tests/Doctrine/Tests/Models/DDC2372/DDC2372Address.php +++ b/tests/Doctrine/Tests/Models/DDC2372/DDC2372Address.php @@ -42,4 +42,4 @@ public function setUser(User $user) $user->setAddress($this); } } -} \ No newline at end of file +} diff --git a/tests/Doctrine/Tests/Models/DDC2372/DDC2372Admin.php b/tests/Doctrine/Tests/Models/DDC2372/DDC2372Admin.php index 604e919f75..ca620513ef 100644 --- a/tests/Doctrine/Tests/Models/DDC2372/DDC2372Admin.php +++ b/tests/Doctrine/Tests/Models/DDC2372/DDC2372Admin.php @@ -5,4 +5,4 @@ /** @Entity @Table(name="admins") */ class DDC2372Admin extends DDC2372User { -} \ No newline at end of file +} diff --git a/tests/Doctrine/Tests/Models/DDC2372/DDC2372User.php b/tests/Doctrine/Tests/Models/DDC2372/DDC2372User.php index 4df0df6a56..e90350a0a4 100644 --- a/tests/Doctrine/Tests/Models/DDC2372/DDC2372User.php +++ b/tests/Doctrine/Tests/Models/DDC2372/DDC2372User.php @@ -31,4 +31,4 @@ public function setName($name) { $this->name = $name; } -} \ No newline at end of file +} diff --git a/tests/Doctrine/Tests/Models/DDC2372/Traits/DDC2372AddressTrait.php b/tests/Doctrine/Tests/Models/DDC2372/Traits/DDC2372AddressTrait.php index 66ca174461..2253f25812 100644 --- a/tests/Doctrine/Tests/Models/DDC2372/Traits/DDC2372AddressTrait.php +++ b/tests/Doctrine/Tests/Models/DDC2372/Traits/DDC2372AddressTrait.php @@ -22,4 +22,4 @@ public function setAddress(Address $address) $address->setUser($this); } } -} \ No newline at end of file +} diff --git a/tests/Doctrine/Tests/Models/DDC3597/Embeddable/DDC3597Dimension.php b/tests/Doctrine/Tests/Models/DDC3597/Embeddable/DDC3597Dimension.php index cd5dc70a23..5bff5b5407 100644 --- a/tests/Doctrine/Tests/Models/DDC3597/Embeddable/DDC3597Dimension.php +++ b/tests/Doctrine/Tests/Models/DDC3597/Embeddable/DDC3597Dimension.php @@ -53,4 +53,4 @@ public function getHeight() { public function setHeight($height) { $this->height = (int)$height; } -} \ No newline at end of file +} diff --git a/tests/Doctrine/Tests/Models/DDC964/DDC964Address.php b/tests/Doctrine/Tests/Models/DDC964/DDC964Address.php index a549dc98ce..d5aced9222 100644 --- a/tests/Doctrine/Tests/Models/DDC964/DDC964Address.php +++ b/tests/Doctrine/Tests/Models/DDC964/DDC964Address.php @@ -120,4 +120,4 @@ public function setStreet($street) $this->street = $street; } -} \ No newline at end of file +} diff --git a/tests/Doctrine/Tests/Models/Forum/ForumAdministrator.php b/tests/Doctrine/Tests/Models/Forum/ForumAdministrator.php index 13d78ab643..63d08be4a4 100644 --- a/tests/Doctrine/Tests/Models/Forum/ForumAdministrator.php +++ b/tests/Doctrine/Tests/Models/Forum/ForumAdministrator.php @@ -11,4 +11,4 @@ class ForumAdministrator extends ForumUser * @Column(type="integer", name="access_level") */ public $accessLevel; -} \ No newline at end of file +} diff --git a/tests/Doctrine/Tests/Models/Generic/BooleanModel.php b/tests/Doctrine/Tests/Models/Generic/BooleanModel.php index 2c931563ee..48b84deb56 100644 --- a/tests/Doctrine/Tests/Models/Generic/BooleanModel.php +++ b/tests/Doctrine/Tests/Models/Generic/BooleanModel.php @@ -17,4 +17,4 @@ class BooleanModel * @Column(type="boolean") */ public $booleanField; -} \ No newline at end of file +} diff --git a/tests/Doctrine/Tests/Models/Generic/DecimalModel.php b/tests/Doctrine/Tests/Models/Generic/DecimalModel.php index 6a3654b03e..cbfd7ea1b6 100644 --- a/tests/Doctrine/Tests/Models/Generic/DecimalModel.php +++ b/tests/Doctrine/Tests/Models/Generic/DecimalModel.php @@ -22,4 +22,4 @@ class DecimalModel * @Column(name="`high_scale`", type="decimal", scale=4, precision=14) */ public $highScale; -} \ No newline at end of file +} diff --git a/tests/Doctrine/Tests/Models/Generic/NonAlphaColumnsEntity.php b/tests/Doctrine/Tests/Models/Generic/NonAlphaColumnsEntity.php index 7c2b888fc9..3ca9f3f039 100644 --- a/tests/Doctrine/Tests/Models/Generic/NonAlphaColumnsEntity.php +++ b/tests/Doctrine/Tests/Models/Generic/NonAlphaColumnsEntity.php @@ -27,4 +27,4 @@ public function __construct($value) { $this->value = $value; } -} \ No newline at end of file +} diff --git a/tests/Doctrine/Tests/Models/Generic/SerializationModel.php b/tests/Doctrine/Tests/Models/Generic/SerializationModel.php index 4f07d427aa..19a05cc284 100644 --- a/tests/Doctrine/Tests/Models/Generic/SerializationModel.php +++ b/tests/Doctrine/Tests/Models/Generic/SerializationModel.php @@ -22,4 +22,4 @@ class SerializationModel * @Column(name="the_obj", type="object", nullable=true) */ public $object; -} \ No newline at end of file +} diff --git a/tests/Doctrine/Tests/Models/Global/GlobalNamespaceModel.php b/tests/Doctrine/Tests/Models/Global/GlobalNamespaceModel.php index b661d78be2..defbc4c6af 100644 --- a/tests/Doctrine/Tests/Models/Global/GlobalNamespaceModel.php +++ b/tests/Doctrine/Tests/Models/Global/GlobalNamespaceModel.php @@ -68,4 +68,4 @@ class DoctrineGlobal_User * @var string */ private $email; -} \ No newline at end of file +} diff --git a/tests/Doctrine/Tests/Models/JoinedInheritanceType/AnotherChildClass.php b/tests/Doctrine/Tests/Models/JoinedInheritanceType/AnotherChildClass.php index e49d898073..11a542b5ad 100644 --- a/tests/Doctrine/Tests/Models/JoinedInheritanceType/AnotherChildClass.php +++ b/tests/Doctrine/Tests/Models/JoinedInheritanceType/AnotherChildClass.php @@ -7,4 +7,4 @@ */ class AnotherChildClass extends ChildClass { -} \ No newline at end of file +} diff --git a/tests/Doctrine/Tests/Models/JoinedInheritanceType/ChildClass.php b/tests/Doctrine/Tests/Models/JoinedInheritanceType/ChildClass.php index 35887c7687..09c6273e6d 100644 --- a/tests/Doctrine/Tests/Models/JoinedInheritanceType/ChildClass.php +++ b/tests/Doctrine/Tests/Models/JoinedInheritanceType/ChildClass.php @@ -7,4 +7,4 @@ */ abstract class ChildClass extends RootClass { -} \ No newline at end of file +} diff --git a/tests/Doctrine/Tests/Models/JoinedInheritanceType/RootClass.php b/tests/Doctrine/Tests/Models/JoinedInheritanceType/RootClass.php index e8b643a82e..08830bc5dc 100644 --- a/tests/Doctrine/Tests/Models/JoinedInheritanceType/RootClass.php +++ b/tests/Doctrine/Tests/Models/JoinedInheritanceType/RootClass.php @@ -13,4 +13,4 @@ class RootClass * @Id @GeneratedValue */ public $id; -} \ No newline at end of file +} diff --git a/tests/Doctrine/Tests/Models/Navigation/NavCountry.php b/tests/Doctrine/Tests/Models/Navigation/NavCountry.php index fd37552600..af6332ace2 100644 --- a/tests/Doctrine/Tests/Models/Navigation/NavCountry.php +++ b/tests/Doctrine/Tests/Models/Navigation/NavCountry.php @@ -36,4 +36,4 @@ public function getId() { public function getName() { return $this->name; } -} \ No newline at end of file +} diff --git a/tests/Doctrine/Tests/Models/Navigation/NavPhotos.php b/tests/Doctrine/Tests/Models/Navigation/NavPhotos.php index 25858d0b3e..173aaa3fb0 100644 --- a/tests/Doctrine/Tests/Models/Navigation/NavPhotos.php +++ b/tests/Doctrine/Tests/Models/Navigation/NavPhotos.php @@ -45,4 +45,4 @@ public function getPointOfInterest() { public function getFile() { return $this->file; } -} \ No newline at end of file +} diff --git a/tests/Doctrine/Tests/Models/Navigation/NavTour.php b/tests/Doctrine/Tests/Models/Navigation/NavTour.php index 5a58017aa3..d54bd2283c 100644 --- a/tests/Doctrine/Tests/Models/Navigation/NavTour.php +++ b/tests/Doctrine/Tests/Models/Navigation/NavTour.php @@ -58,4 +58,4 @@ public function getId() { return $this->id; } -} \ No newline at end of file +} diff --git a/tests/Doctrine/Tests/Models/Quote/NumericEntity.php b/tests/Doctrine/Tests/Models/Quote/NumericEntity.php index f1186cbcc1..45ed7a901c 100644 --- a/tests/Doctrine/Tests/Models/Quote/NumericEntity.php +++ b/tests/Doctrine/Tests/Models/Quote/NumericEntity.php @@ -28,4 +28,4 @@ public function __construct($value) $this->value = $value; } -} \ No newline at end of file +} diff --git a/tests/Doctrine/Tests/Models/Routing/RoutingLeg.php b/tests/Doctrine/Tests/Models/Routing/RoutingLeg.php index a130e7b0c4..959c0c5682 100644 --- a/tests/Doctrine/Tests/Models/Routing/RoutingLeg.php +++ b/tests/Doctrine/Tests/Models/Routing/RoutingLeg.php @@ -34,4 +34,4 @@ class RoutingLeg * @Column(type="datetime") */ public $arrivalDate; -} \ No newline at end of file +} diff --git a/tests/Doctrine/Tests/Models/Routing/RoutingLocation.php b/tests/Doctrine/Tests/Models/Routing/RoutingLocation.php index ea1ba55f78..b939a02f31 100644 --- a/tests/Doctrine/Tests/Models/Routing/RoutingLocation.php +++ b/tests/Doctrine/Tests/Models/Routing/RoutingLocation.php @@ -22,4 +22,4 @@ public function getName() { return $this->name; } -} \ No newline at end of file +} diff --git a/tests/Doctrine/Tests/Models/Routing/RoutingRouteBooking.php b/tests/Doctrine/Tests/Models/Routing/RoutingRouteBooking.php index 9b862fc391..549ee9de09 100644 --- a/tests/Doctrine/Tests/Models/Routing/RoutingRouteBooking.php +++ b/tests/Doctrine/Tests/Models/Routing/RoutingRouteBooking.php @@ -29,4 +29,4 @@ public function getPassengerName() { return $this->passengerName; } -} \ No newline at end of file +} diff --git a/tests/Doctrine/Tests/Models/StockExchange/Bond.php b/tests/Doctrine/Tests/Models/StockExchange/Bond.php index a0d37bfe85..9b4437f1db 100644 --- a/tests/Doctrine/Tests/Models/StockExchange/Bond.php +++ b/tests/Doctrine/Tests/Models/StockExchange/Bond.php @@ -44,4 +44,4 @@ public function addStock(Stock $stock) { $this->stocks[$stock->getSymbol()] = $stock; } -} \ No newline at end of file +} diff --git a/tests/Doctrine/Tests/Models/StockExchange/Market.php b/tests/Doctrine/Tests/Models/StockExchange/Market.php index 87e12cab65..71e0a0cd72 100644 --- a/tests/Doctrine/Tests/Models/StockExchange/Market.php +++ b/tests/Doctrine/Tests/Models/StockExchange/Market.php @@ -53,4 +53,4 @@ public function getStock($symbol) { return $this->stocks[$symbol]; } -} \ No newline at end of file +} diff --git a/tests/Doctrine/Tests/Models/StockExchange/Stock.php b/tests/Doctrine/Tests/Models/StockExchange/Stock.php index 00e14e12ea..25a938721f 100644 --- a/tests/Doctrine/Tests/Models/StockExchange/Stock.php +++ b/tests/Doctrine/Tests/Models/StockExchange/Stock.php @@ -44,4 +44,4 @@ public function getSymbol() { return $this->symbol; } -} \ No newline at end of file +} diff --git a/tests/Doctrine/Tests/ORM/Mapping/EntityListenerResolverTest.php b/tests/Doctrine/Tests/ORM/Mapping/EntityListenerResolverTest.php index bef03b9ba1..cca629b940 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/EntityListenerResolverTest.php +++ b/tests/Doctrine/Tests/ORM/Mapping/EntityListenerResolverTest.php @@ -95,4 +95,4 @@ public function testRegisterStringException() { $this->resolver->register('CompanyContractListener'); } -} \ No newline at end of file +} diff --git a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC889.DDC889Entity.php b/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC889.DDC889Entity.php index a14f3e7ea1..4ab21f9ce3 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC889.DDC889Entity.php +++ b/tests/Doctrine/Tests/ORM/Mapping/php/Doctrine.Tests.Models.DDC889.DDC889Entity.php @@ -1,3 +1,3 @@ - \ No newline at end of file + diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.CMS.CmsAddress.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.CMS.CmsAddress.dcm.xml index e4b80346c4..fb8bdb4049 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.CMS.CmsAddress.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.CMS.CmsAddress.dcm.xml @@ -55,4 +55,4 @@ - \ No newline at end of file + diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.Cache.City.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.Cache.City.dcm.xml index 415302d0a8..62a6fd8568 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.Cache.City.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.Cache.City.dcm.xml @@ -20,4 +20,4 @@ - \ No newline at end of file + diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.Company.CompanyContract.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.Company.CompanyContract.dcm.xml index b775e3ccc7..be1aa103f5 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.Company.CompanyContract.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.Company.CompanyContract.dcm.xml @@ -38,4 +38,4 @@ - \ No newline at end of file + diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.Company.CompanyFixContract.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.Company.CompanyFixContract.dcm.xml index bfa5431fc2..75e98adcb8 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.Company.CompanyFixContract.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.Company.CompanyFixContract.dcm.xml @@ -13,4 +13,4 @@ - \ No newline at end of file + diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.Company.CompanyFlexContract.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.Company.CompanyFlexContract.dcm.xml index 21ca4238d1..e0a74771ab 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.Company.CompanyFlexContract.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.Company.CompanyFlexContract.dcm.xml @@ -13,4 +13,4 @@ - \ No newline at end of file + diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.Company.CompanyFlexUltraContract.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.Company.CompanyFlexUltraContract.dcm.xml index 381e67571f..0a03200c90 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.Company.CompanyFlexUltraContract.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.Company.CompanyFlexUltraContract.dcm.xml @@ -33,4 +33,4 @@ - \ No newline at end of file + diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.Company.CompanyPerson.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.Company.CompanyPerson.dcm.xml index d8db510734..daa94cd2ce 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.Company.CompanyPerson.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.Company.CompanyPerson.dcm.xml @@ -54,4 +54,4 @@ - \ No newline at end of file + diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC117.DDC117Translation.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC117.DDC117Translation.dcm.xml index 019f201b04..f3f3cf816b 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC117.DDC117Translation.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC117.DDC117Translation.dcm.xml @@ -20,4 +20,4 @@ - \ No newline at end of file + diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC1476.DDC1476EntityWithDefaultFieldType.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC1476.DDC1476EntityWithDefaultFieldType.dcm.xml index fedfeada50..e1bde2351d 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC1476.DDC1476EntityWithDefaultFieldType.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC1476.DDC1476EntityWithDefaultFieldType.dcm.xml @@ -12,4 +12,4 @@ - \ No newline at end of file + diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC869.DDC869ChequePayment.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC869.DDC869ChequePayment.dcm.xml index fcc022f793..fb5f7acc61 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC869.DDC869ChequePayment.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC869.DDC869ChequePayment.dcm.xml @@ -8,4 +8,4 @@ - \ No newline at end of file + diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC869.DDC869CreditCardPayment.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC869.DDC869CreditCardPayment.dcm.xml index bcd02647ec..8b8260c9c2 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC869.DDC869CreditCardPayment.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC869.DDC869CreditCardPayment.dcm.xml @@ -8,4 +8,4 @@ - \ No newline at end of file + diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC869.DDC869Payment.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC869.DDC869Payment.dcm.xml index 90426f1b09..9e3f957ac9 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC869.DDC869Payment.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC869.DDC869Payment.dcm.xml @@ -12,4 +12,4 @@ - \ No newline at end of file + diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC889.DDC889Class.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC889.DDC889Class.dcm.xml index 86e0411216..ea069f8eb4 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC889.DDC889Class.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC889.DDC889Class.dcm.xml @@ -10,4 +10,4 @@ - \ No newline at end of file + diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC889.DDC889Entity.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC889.DDC889Entity.dcm.xml index b366cbb606..7fc72bb0ea 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC889.DDC889Entity.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC889.DDC889Entity.dcm.xml @@ -7,4 +7,4 @@ - \ No newline at end of file + diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC889.DDC889SuperClass.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC889.DDC889SuperClass.dcm.xml index 4b174a393e..c204e8651d 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC889.DDC889SuperClass.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC889.DDC889SuperClass.dcm.xml @@ -8,4 +8,4 @@ - \ No newline at end of file + diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC964.DDC964Admin.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC964.DDC964Admin.dcm.xml index ea6e22fdbd..00eb75bef6 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC964.DDC964Admin.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC964.DDC964Admin.dcm.xml @@ -24,4 +24,4 @@ - \ No newline at end of file + diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC964.DDC964Guest.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC964.DDC964Guest.dcm.xml index 5ad7a1e148..c48f50a06f 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC964.DDC964Guest.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC964.DDC964Guest.dcm.xml @@ -15,4 +15,4 @@ - \ No newline at end of file + diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC964.DDC964User.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC964.DDC964User.dcm.xml index 83b878840a..3e6a91f39e 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC964.DDC964User.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.DDC964.DDC964User.dcm.xml @@ -36,4 +36,4 @@ - \ No newline at end of file + diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.Generic.SerializationModel.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.Generic.SerializationModel.dcm.xml index 5974da2640..6e42bce75a 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.Generic.SerializationModel.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.Models.Generic.SerializationModel.dcm.xml @@ -14,4 +14,4 @@ - \ No newline at end of file + diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.CTI.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.CTI.dcm.xml index b26ca1089c..29dcbc126d 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.CTI.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.CTI.dcm.xml @@ -14,4 +14,4 @@ - \ No newline at end of file + diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.DDC1170Entity.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.DDC1170Entity.dcm.xml index a77f2e1bc4..057c864756 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.DDC1170Entity.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.DDC1170Entity.dcm.xml @@ -12,4 +12,4 @@ - \ No newline at end of file + diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.DDC807Entity.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.DDC807Entity.dcm.xml index 9a33752340..e1e93e63f6 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.DDC807Entity.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.DDC807Entity.dcm.xml @@ -17,4 +17,4 @@ - \ No newline at end of file + diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.SingleTableEntityIncompleteDiscriminatorColumnMapping.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.SingleTableEntityIncompleteDiscriminatorColumnMapping.dcm.xml index af274cdafd..5e34ee5fe4 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.SingleTableEntityIncompleteDiscriminatorColumnMapping.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.SingleTableEntityIncompleteDiscriminatorColumnMapping.dcm.xml @@ -17,4 +17,4 @@ - \ No newline at end of file + diff --git a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.SingleTableEntityNoDiscriminatorColumnMapping.dcm.xml b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.SingleTableEntityNoDiscriminatorColumnMapping.dcm.xml index 8f2854550e..2c82e81531 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.SingleTableEntityNoDiscriminatorColumnMapping.dcm.xml +++ b/tests/Doctrine/Tests/ORM/Mapping/xml/Doctrine.Tests.ORM.Mapping.SingleTableEntityNoDiscriminatorColumnMapping.dcm.xml @@ -15,4 +15,4 @@ - \ No newline at end of file + diff --git a/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.Cache.City.dcm.yml b/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.Cache.City.dcm.yml index 05286e0df5..7bc5e7db17 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.Cache.City.dcm.yml +++ b/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.Cache.City.dcm.yml @@ -33,4 +33,4 @@ Doctrine\Tests\Models\Cache\City: cache: usage : READ_ONLY orderBy: - name: ASC \ No newline at end of file + name: ASC diff --git a/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.Company.CompanyContract.dcm.yml b/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.Company.CompanyContract.dcm.yml index 03b9d3bede..34ea8a4611 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.Company.CompanyContract.dcm.yml +++ b/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.Company.CompanyContract.dcm.yml @@ -29,4 +29,4 @@ Doctrine\Tests\Models\Company\CompanyContract: strategy: AUTO fields: completed: - type: boolean \ No newline at end of file + type: boolean diff --git a/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.Company.CompanyFixContract.dcm.yml b/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.Company.CompanyFixContract.dcm.yml index 83d0c75be1..99dc79d050 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.Company.CompanyFixContract.dcm.yml +++ b/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.Company.CompanyFixContract.dcm.yml @@ -2,4 +2,4 @@ Doctrine\Tests\Models\Company\CompanyFixContract: type: entity fields: fixPrice: - type: integer \ No newline at end of file + type: integer diff --git a/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.Company.CompanyFlexContract.dcm.yml b/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.Company.CompanyFlexContract.dcm.yml index ef1d263063..ada071a83e 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.Company.CompanyFlexContract.dcm.yml +++ b/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.Company.CompanyFlexContract.dcm.yml @@ -4,4 +4,4 @@ Doctrine\Tests\Models\Company\CompanyFlexContract: hoursWorked: type: integer pricePerHour: - type: integer \ No newline at end of file + type: integer diff --git a/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.Company.CompanyFlexUltraContract.dcm.yml b/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.Company.CompanyFlexUltraContract.dcm.yml index 26ce8f3d5f..aecdafe500 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.Company.CompanyFlexUltraContract.dcm.yml +++ b/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.Company.CompanyFlexUltraContract.dcm.yml @@ -22,4 +22,4 @@ Doctrine\Tests\Models\Company\CompanyFlexUltraContract: fields: maxPrice: - type: integer \ No newline at end of file + type: integer diff --git a/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.DDC3711.DDC3711EntityA.dcm.yml b/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.DDC3711.DDC3711EntityA.dcm.yml index c8a87331dc..1907bcc112 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.DDC3711.DDC3711EntityA.dcm.yml +++ b/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.DDC3711.DDC3711EntityA.dcm.yml @@ -20,4 +20,4 @@ Doctrine\Tests\Models\DDC3711\DDC3711EntityA: link_b_id1: referencedColumnName: id1 link_b_id2: - referencedColumnName: id2 \ No newline at end of file + referencedColumnName: id2 diff --git a/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.DDC869.DDC869ChequePayment.dcm.yml b/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.DDC869.DDC869ChequePayment.dcm.yml index 94f2698175..04eca65740 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.DDC869.DDC869ChequePayment.dcm.yml +++ b/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.DDC869.DDC869ChequePayment.dcm.yml @@ -2,4 +2,4 @@ Doctrine\Tests\Models\DDC869\DDC869ChequePayment: type: entity fields: serialNumber: - type: string \ No newline at end of file + type: string diff --git a/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.DDC869.DDC869CreditCardPayment.dcm.yml b/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.DDC869.DDC869CreditCardPayment.dcm.yml index 153a99fa7e..3da249e5c9 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.DDC869.DDC869CreditCardPayment.dcm.yml +++ b/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.DDC869.DDC869CreditCardPayment.dcm.yml @@ -2,4 +2,4 @@ Doctrine\Tests\Models\DDC869\DDC869CreditCardPayment: type: entity fields: creditCardNumber: - type: string \ No newline at end of file + type: string diff --git a/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.DDC869.DDC869Payment.dcm.yml b/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.DDC869.DDC869Payment.dcm.yml index b776664e1d..fb219451b3 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.DDC869.DDC869Payment.dcm.yml +++ b/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.DDC869.DDC869Payment.dcm.yml @@ -9,4 +9,4 @@ Doctrine\Tests\Models\DDC869\DDC869Payment: strategy: AUTO fields: value: - type: float \ No newline at end of file + type: float diff --git a/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.DDC889.DDC889Class.dcm.yml b/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.DDC889.DDC889Class.dcm.yml index 567e5d585c..ed94b14c55 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.DDC889.DDC889Class.dcm.yml +++ b/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.DDC889.DDC889Class.dcm.yml @@ -5,4 +5,4 @@ Doctrine\Tests\Models\DDC889\DDC889Class: type: integer unsigned: true generator: - strategy: AUTO \ No newline at end of file + strategy: AUTO diff --git a/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.DDC889.DDC889Entity.dcm.yml b/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.DDC889.DDC889Entity.dcm.yml index aa932db214..404d4a538f 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.DDC889.DDC889Entity.dcm.yml +++ b/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.DDC889.DDC889Entity.dcm.yml @@ -1,2 +1,2 @@ Doctrine\Tests\Models\DDC889\DDC889Entity: - type: entity \ No newline at end of file + type: entity diff --git a/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.DDC889.DDC889SuperClass.dcm.yml b/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.DDC889.DDC889SuperClass.dcm.yml index 7974d552d0..aceada9a98 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.DDC889.DDC889SuperClass.dcm.yml +++ b/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.DDC889.DDC889SuperClass.dcm.yml @@ -2,4 +2,4 @@ Doctrine\Tests\Models\DDC889\DDC889SuperClass: type: mappedSuperclass fields: name: - type: string \ No newline at end of file + type: string diff --git a/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.DDC964.DDC964Admin.dcm.yml b/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.DDC964.DDC964Admin.dcm.yml index 0b8051d964..77823f2922 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.DDC964.DDC964Admin.dcm.yml +++ b/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.DDC964.DDC964Admin.dcm.yml @@ -14,4 +14,4 @@ Doctrine\Tests\Models\DDC964\DDC964Admin: referencedColumnName: id inverseJoinColumns: admingroup_id: - referencedColumnName: id \ No newline at end of file + referencedColumnName: id diff --git a/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.DDC964.DDC964Guest.dcm.yml b/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.DDC964.DDC964Guest.dcm.yml index ec7936f4a7..5c4130e6e5 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.DDC964.DDC964Guest.dcm.yml +++ b/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.DDC964.DDC964Guest.dcm.yml @@ -10,4 +10,4 @@ Doctrine\Tests\Models\DDC964\DDC964Guest: type: string length: 240 nullable: false - unique: true \ No newline at end of file + unique: true diff --git a/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.DDC964.DDC964User.dcm.yml b/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.DDC964.DDC964User.dcm.yml index 3a9ebbf9d7..459b642928 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.DDC964.DDC964User.dcm.yml +++ b/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.DDC964.DDC964User.dcm.yml @@ -32,4 +32,4 @@ Doctrine\Tests\Models\DDC964\DDC964User: inverseJoinColumns: group_id: referencedColumnName: id - cascade: [ persist, merge, detach ] \ No newline at end of file + cascade: [ persist, merge, detach ] diff --git a/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.Generic.SerializationModel.dcm.yml b/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.Generic.SerializationModel.dcm.yml index 64f74b55f9..a20b572593 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.Generic.SerializationModel.dcm.yml +++ b/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.Models.Generic.SerializationModel.dcm.yml @@ -10,4 +10,4 @@ array: type: array object: - type: object \ No newline at end of file + type: object diff --git a/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.ORM.Mapping.DDC1170Entity.dcm.yml b/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.ORM.Mapping.DDC1170Entity.dcm.yml index 8b2ac518bc..e42305d4fd 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.ORM.Mapping.DDC1170Entity.dcm.yml +++ b/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.ORM.Mapping.DDC1170Entity.dcm.yml @@ -7,4 +7,4 @@ Doctrine\Tests\ORM\Mapping\DDC1170Entity: strategy: NONE fields: value: - columnDefinition: VARCHAR(255) NOT NULL \ No newline at end of file + columnDefinition: VARCHAR(255) NOT NULL diff --git a/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.ORM.Mapping.DDC807Entity.dcm.yml b/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.ORM.Mapping.DDC807Entity.dcm.yml index 20db3c328e..624fb54a9b 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.ORM.Mapping.DDC807Entity.dcm.yml +++ b/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.ORM.Mapping.DDC807Entity.dcm.yml @@ -10,4 +10,4 @@ Doctrine\Tests\ORM\Mapping\DDC807Entity: id: id: generator: - strategy: NONE \ No newline at end of file + strategy: NONE diff --git a/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.ORM.Mapping.SingleTableEntityIncompleteDiscriminatorColumnMapping.dcm.yml b/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.ORM.Mapping.SingleTableEntityIncompleteDiscriminatorColumnMapping.dcm.yml index 8c71ef7091..d81bc7a6ae 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.ORM.Mapping.SingleTableEntityIncompleteDiscriminatorColumnMapping.dcm.yml +++ b/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.ORM.Mapping.SingleTableEntityIncompleteDiscriminatorColumnMapping.dcm.yml @@ -9,4 +9,4 @@ Doctrine\Tests\ORM\Mapping\SingleTableEntityIncompleteDiscriminatorColumnMapping id: id: generator: - strategy: NONE \ No newline at end of file + strategy: NONE diff --git a/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.ORM.Mapping.SingleTableEntityNoDiscriminatorColumnMapping.dcm.yml b/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.ORM.Mapping.SingleTableEntityNoDiscriminatorColumnMapping.dcm.yml index 5cab520d1c..25ec79eb9d 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.ORM.Mapping.SingleTableEntityNoDiscriminatorColumnMapping.dcm.yml +++ b/tests/Doctrine/Tests/ORM/Mapping/yaml/Doctrine.Tests.ORM.Mapping.SingleTableEntityNoDiscriminatorColumnMapping.dcm.yml @@ -7,4 +7,4 @@ Doctrine\Tests\ORM\Mapping\SingleTableEntityNoDiscriminatorColumnMapping: id: id: generator: - strategy: NONE \ No newline at end of file + strategy: NONE diff --git a/tests/Doctrine/Tests/ORM/Tools/doctrine1schema/schema.yml b/tests/Doctrine/Tests/ORM/Tools/doctrine1schema/schema.yml index efa24c7916..65433d6ee8 100644 --- a/tests/Doctrine/Tests/ORM/Tools/doctrine1schema/schema.yml +++ b/tests/Doctrine/Tests/ORM/Tools/doctrine1schema/schema.yml @@ -25,4 +25,4 @@ Profile: User: onDelete: CASCADE foreignType: one - type: one \ No newline at end of file + type: one diff --git a/tools/sandbox/Entities/Address.php b/tools/sandbox/Entities/Address.php index 717ea63a10..0dda78f953 100644 --- a/tools/sandbox/Entities/Address.php +++ b/tools/sandbox/Entities/Address.php @@ -42,4 +42,4 @@ public function setUser(User $user) $user->setAddress($this); } } -} \ No newline at end of file +} diff --git a/tools/sandbox/Entities/User.php b/tools/sandbox/Entities/User.php index cd184212c0..394686c846 100644 --- a/tools/sandbox/Entities/User.php +++ b/tools/sandbox/Entities/User.php @@ -45,4 +45,4 @@ public function setAddress(Address $address) $address->setUser($this); } } -} \ No newline at end of file +} diff --git a/tools/sandbox/xml/Entities.Address.dcm.xml b/tools/sandbox/xml/Entities.Address.dcm.xml index 92475ed233..40b54b909a 100644 --- a/tools/sandbox/xml/Entities.Address.dcm.xml +++ b/tools/sandbox/xml/Entities.Address.dcm.xml @@ -12,4 +12,4 @@ - \ No newline at end of file + diff --git a/tools/sandbox/yaml/Entities.Address.dcm.yml b/tools/sandbox/yaml/Entities.Address.dcm.yml index 140e90224b..04d35078ae 100644 --- a/tools/sandbox/yaml/Entities.Address.dcm.yml +++ b/tools/sandbox/yaml/Entities.Address.dcm.yml @@ -13,4 +13,4 @@ Entities\Address: oneToOne: user: targetEntity: User - mappedBy: address \ No newline at end of file + mappedBy: address From b13b2e8bab810641cf5fa5a19d285545b53a4a45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Paris?= Date: Wed, 28 Oct 2020 11:14:10 +0100 Subject: [PATCH 127/136] Upgrade doctrine/coding-standard (#8321) * Use a classname that exists Doctrine\ORM\Mapping\TableGenerator does not exist, only Doctrine\ORM\Id\TableGenerator does. * Upgrade doctrine/coding-standard That library has a dependency on another library that requires composer plugin API v1. Updating both libs allow to use Composer v2. * Account for doctrine/reflection deprecation --- composer.json | 4 +- composer.lock | 1143 ++++++++++++----- .../ORM/Mapping/Driver/AnnotationDriver.php | 2 +- phpcs.xml.dist | 4 - .../Tests/ORM/Functional/ValueObjectsTest.php | 12 +- .../ORM/Mapping/AnnotationDriverTest.php | 2 +- 6 files changed, 863 insertions(+), 304 deletions(-) diff --git a/composer.json b/composer.json index 069d19fb94..fc8e435886 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,7 @@ "php": "^7.1", "ext-pdo": "*", "composer/package-versions-deprecated": "^1.8", - "doctrine/annotations": "^1.8", + "doctrine/annotations": "^1.11.1", "doctrine/cache": "^1.9.1", "doctrine/collections": "^1.5", "doctrine/common": "^2.11 || ^3.0", @@ -35,7 +35,7 @@ "symfony/console": "^3.0|^4.0|^5.0" }, "require-dev": { - "doctrine/coding-standard": "^5.0", + "doctrine/coding-standard": "^6.0", "phpstan/phpstan": "^0.12.18", "phpunit/phpunit": "^7.5", "symfony/yaml": "^3.4|^4.0|^5.0", diff --git a/composer.lock b/composer.lock index 5e2c2c2515..f3e3abdced 100644 --- a/composer.lock +++ b/composer.lock @@ -4,28 +4,28 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "8f74f1ed98af4508fc136e982596658b", + "content-hash": "af1ac1c1f3d9f37caa71b6e5add59928", "packages": [ { "name": "composer/package-versions-deprecated", - "version": "1.8.0", + "version": "1.11.99", "source": { "type": "git", "url": "https://github.com/composer/package-versions-deprecated.git", - "reference": "98df7f1b293c0550bd5b1ce6b60b59bdda23aa47" + "reference": "c8c9aa8a14cc3d3bec86d0a8c3fa52ea79936855" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/package-versions-deprecated/zipball/98df7f1b293c0550bd5b1ce6b60b59bdda23aa47", - "reference": "98df7f1b293c0550bd5b1ce6b60b59bdda23aa47", + "url": "https://api.github.com/repos/composer/package-versions-deprecated/zipball/c8c9aa8a14cc3d3bec86d0a8c3fa52ea79936855", + "reference": "c8c9aa8a14cc3d3bec86d0a8c3fa52ea79936855", "shasum": "" }, "require": { "composer-plugin-api": "^1.1.0 || ^2.0", - "php": "^7" + "php": "^7 || ^8" }, "replace": { - "ocramius/package-versions": "1.2 - 1.8.99" + "ocramius/package-versions": "1.11.99" }, "require-dev": { "composer/composer": "^1.9.3 || ^2.0@dev", @@ -59,30 +59,38 @@ } ], "description": "Composer plugin that provides efficient querying for installed package versions (no runtime IO)", + "support": { + "issues": "https://github.com/composer/package-versions-deprecated/issues", + "source": "https://github.com/composer/package-versions-deprecated/tree/master" + }, "funding": [ { "url": "https://packagist.com", "type": "custom" }, + { + "url": "https://github.com/composer", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/composer/composer", "type": "tidelift" } ], - "time": "2020-04-23T11:49:37+00:00" + "time": "2020-08-25T05:50:16+00:00" }, { "name": "doctrine/annotations", - "version": "1.10.3", + "version": "1.11.1", "source": { "type": "git", "url": "https://github.com/doctrine/annotations.git", - "reference": "5db60a4969eba0e0c197a19c077780aadbc43c5d" + "reference": "ce77a7ba1770462cd705a91a151b6c3746f9c6ad" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/annotations/zipball/5db60a4969eba0e0c197a19c077780aadbc43c5d", - "reference": "5db60a4969eba0e0c197a19c077780aadbc43c5d", + "url": "https://api.github.com/repos/doctrine/annotations/zipball/ce77a7ba1770462cd705a91a151b6c3746f9c6ad", + "reference": "ce77a7ba1770462cd705a91a151b6c3746f9c6ad", "shasum": "" }, "require": { @@ -92,12 +100,14 @@ }, "require-dev": { "doctrine/cache": "1.*", - "phpunit/phpunit": "^7.5" + "doctrine/coding-standard": "^6.0 || ^8.1", + "phpstan/phpstan": "^0.12.20", + "phpunit/phpunit": "^7.5 || ^9.1.5" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.9.x-dev" + "dev-master": "1.11.x-dev" } }, "autoload": { @@ -132,30 +142,34 @@ } ], "description": "Docblock Annotations Parser", - "homepage": "http://www.doctrine-project.org", + "homepage": "https://www.doctrine-project.org/projects/annotations.html", "keywords": [ "annotations", "docblock", "parser" ], - "time": "2020-05-25T17:24:27+00:00" + "support": { + "issues": "https://github.com/doctrine/annotations/issues", + "source": "https://github.com/doctrine/annotations/tree/1.11.1" + }, + "time": "2020-10-26T10:28:16+00:00" }, { "name": "doctrine/cache", - "version": "1.10.0", + "version": "1.10.2", "source": { "type": "git", "url": "https://github.com/doctrine/cache.git", - "reference": "382e7f4db9a12dc6c19431743a2b096041bcdd62" + "reference": "13e3381b25847283a91948d04640543941309727" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/cache/zipball/382e7f4db9a12dc6c19431743a2b096041bcdd62", - "reference": "382e7f4db9a12dc6c19431743a2b096041bcdd62", + "url": "https://api.github.com/repos/doctrine/cache/zipball/13e3381b25847283a91948d04640543941309727", + "reference": "13e3381b25847283a91948d04640543941309727", "shasum": "" }, "require": { - "php": "~7.1" + "php": "~7.1 || ^8.0" }, "conflict": { "doctrine/common": ">2.2,<2.4" @@ -220,20 +234,38 @@ "redis", "xcache" ], - "time": "2019-11-29T15:36:20+00:00" + "support": { + "issues": "https://github.com/doctrine/cache/issues", + "source": "https://github.com/doctrine/cache/tree/1.10.x" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Fcache", + "type": "tidelift" + } + ], + "time": "2020-07-07T18:54:01+00:00" }, { "name": "doctrine/collections", - "version": "1.6.5", + "version": "1.6.7", "source": { "type": "git", "url": "https://github.com/doctrine/collections.git", - "reference": "fc0206348e17e530d09463fef07ba8968406cd6d" + "reference": "55f8b799269a1a472457bd1a41b4f379d4cfba4a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/collections/zipball/fc0206348e17e530d09463fef07ba8968406cd6d", - "reference": "fc0206348e17e530d09463fef07ba8968406cd6d", + "url": "https://api.github.com/repos/doctrine/collections/zipball/55f8b799269a1a472457bd1a41b4f379d4cfba4a", + "reference": "55f8b799269a1a472457bd1a41b4f379d4cfba4a", "shasum": "" }, "require": { @@ -285,20 +317,24 @@ "iterators", "php" ], - "time": "2020-05-25T19:24:35+00:00" + "support": { + "issues": "https://github.com/doctrine/collections/issues", + "source": "https://github.com/doctrine/collections/tree/1.6.7" + }, + "time": "2020-07-27T17:53:49+00:00" }, { "name": "doctrine/common", - "version": "3.0.0", + "version": "3.0.2", "source": { "type": "git", "url": "https://github.com/doctrine/common.git", - "reference": "05ab20457d332cc0eef880b17cdbbffcd6af526f" + "reference": "a3c6479858989e242a2465972b4f7a8642baf0d4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/common/zipball/05ab20457d332cc0eef880b17cdbbffcd6af526f", - "reference": "05ab20457d332cc0eef880b17cdbbffcd6af526f", + "url": "https://api.github.com/repos/doctrine/common/zipball/a3c6479858989e242a2465972b4f7a8642baf0d4", + "reference": "a3c6479858989e242a2465972b4f7a8642baf0d4", "shasum": "" }, "require": { @@ -361,7 +397,25 @@ "doctrine", "php" ], - "time": "2020-05-25T20:38:25+00:00" + "support": { + "issues": "https://github.com/doctrine/common/issues", + "source": "https://github.com/doctrine/common/tree/3.0.2" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Fcommon", + "type": "tidelift" + } + ], + "time": "2020-06-05T16:59:53+00:00" }, { "name": "doctrine/dbal", @@ -443,24 +497,28 @@ "php", "queryobject" ], + "support": { + "issues": "https://github.com/doctrine/dbal/issues", + "source": "https://github.com/doctrine/dbal/tree/2.9" + }, "time": "2019-11-02T22:19:34+00:00" }, { "name": "doctrine/event-manager", - "version": "1.1.0", + "version": "1.1.1", "source": { "type": "git", "url": "https://github.com/doctrine/event-manager.git", - "reference": "629572819973f13486371cb611386eb17851e85c" + "reference": "41370af6a30faa9dc0368c4a6814d596e81aba7f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/event-manager/zipball/629572819973f13486371cb611386eb17851e85c", - "reference": "629572819973f13486371cb611386eb17851e85c", + "url": "https://api.github.com/repos/doctrine/event-manager/zipball/41370af6a30faa9dc0368c4a6814d596e81aba7f", + "reference": "41370af6a30faa9dc0368c4a6814d596e81aba7f", "shasum": "" }, "require": { - "php": "^7.1" + "php": "^7.1 || ^8.0" }, "conflict": { "doctrine/common": "<2.9@dev" @@ -519,7 +577,25 @@ "event system", "events" ], - "time": "2019-11-10T09:48:07+00:00" + "support": { + "issues": "https://github.com/doctrine/event-manager/issues", + "source": "https://github.com/doctrine/event-manager/tree/1.1.x" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Fevent-manager", + "type": "tidelift" + } + ], + "time": "2020-05-29T18:28:51+00:00" }, { "name": "doctrine/inflector", @@ -586,24 +662,28 @@ "singularize", "string" ], + "support": { + "issues": "https://github.com/doctrine/inflector/issues", + "source": "https://github.com/doctrine/inflector/tree/1.3.1" + }, "time": "2019-10-30T19:59:35+00:00" }, { "name": "doctrine/instantiator", - "version": "1.3.0", + "version": "1.3.1", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", - "reference": "ae466f726242e637cebdd526a7d991b9433bacf1" + "reference": "f350df0268e904597e3bd9c4685c53e0e333feea" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/ae466f726242e637cebdd526a7d991b9433bacf1", - "reference": "ae466f726242e637cebdd526a7d991b9433bacf1", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/f350df0268e904597e3bd9c4685c53e0e333feea", + "reference": "f350df0268e904597e3bd9c4685c53e0e333feea", "shasum": "" }, "require": { - "php": "^7.1" + "php": "^7.1 || ^8.0" }, "require-dev": { "doctrine/coding-standard": "^6.0", @@ -642,7 +722,25 @@ "constructor", "instantiate" ], - "time": "2019-10-21T16:45:58+00:00" + "support": { + "issues": "https://github.com/doctrine/instantiator/issues", + "source": "https://github.com/doctrine/instantiator/tree/1.3.x" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator", + "type": "tidelift" + } + ], + "time": "2020-05-29T17:27:14+00:00" }, { "name": "doctrine/lexer", @@ -702,20 +800,24 @@ "parser", "php" ], + "support": { + "issues": "https://github.com/doctrine/lexer/issues", + "source": "https://github.com/doctrine/lexer/tree/1.0.2" + }, "time": "2019-06-08T11:03:04+00:00" }, { "name": "doctrine/persistence", - "version": "2.0.0", + "version": "2.1.0", "source": { "type": "git", "url": "https://github.com/doctrine/persistence.git", - "reference": "1dee036f22cd5dc0bc12132f1d1c38415907be55" + "reference": "9899c16934053880876b920a3b8b02ed2337ac1d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/persistence/zipball/1dee036f22cd5dc0bc12132f1d1c38415907be55", - "reference": "1dee036f22cd5dc0bc12132f1d1c38415907be55", + "url": "https://api.github.com/repos/doctrine/persistence/zipball/9899c16934053880876b920a3b8b02ed2337ac1d", + "reference": "9899c16934053880876b920a3b8b02ed2337ac1d", "shasum": "" }, "require": { @@ -723,24 +825,20 @@ "doctrine/cache": "^1.0", "doctrine/collections": "^1.0", "doctrine/event-manager": "^1.0", - "doctrine/reflection": "^1.2", - "php": "^7.1" + "php": "^7.1 || ^8.0" }, "conflict": { "doctrine/common": "<2.10@dev" }, "require-dev": { - "doctrine/coding-standard": "^6.0", - "phpstan/phpstan": "^0.11", - "phpunit/phpunit": "^7.0", + "composer/package-versions-deprecated": "^1.11", + "doctrine/coding-standard": "^6.0 || ^8.0", + "doctrine/common": "^3.0", + "phpstan/phpstan": "^0.12", + "phpunit/phpunit": "^7.5.20 || ^8.0 || ^9.0", "vimeo/psalm": "^3.11" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.x-dev" - } - }, "autoload": { "psr-4": { "Doctrine\\Common\\": "lib/Doctrine/Common", @@ -786,85 +884,11 @@ "orm", "persistence" ], - "time": "2020-05-12T19:32:44+00:00" - }, - { - "name": "doctrine/reflection", - "version": "1.2.1", - "source": { - "type": "git", - "url": "https://github.com/doctrine/reflection.git", - "reference": "55e71912dfcd824b2fdd16f2d9afe15684cfce79" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/reflection/zipball/55e71912dfcd824b2fdd16f2d9afe15684cfce79", - "reference": "55e71912dfcd824b2fdd16f2d9afe15684cfce79", - "shasum": "" - }, - "require": { - "doctrine/annotations": "^1.0", - "ext-tokenizer": "*", - "php": "^7.1" - }, - "conflict": { - "doctrine/common": "<2.9" - }, - "require-dev": { - "doctrine/coding-standard": "^5.0", - "doctrine/common": "^2.10", - "phpstan/phpstan": "^0.11.0", - "phpstan/phpstan-phpunit": "^0.11.0", - "phpunit/phpunit": "^7.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2.x-dev" - } - }, - "autoload": { - "psr-4": { - "Doctrine\\Common\\": "lib/Doctrine/Common" - } + "support": { + "issues": "https://github.com/doctrine/persistence/issues", + "source": "https://github.com/doctrine/persistence/tree/2.1.0" }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" - }, - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com" - } - ], - "description": "The Doctrine Reflection project is a simple library used by the various Doctrine projects which adds some additional functionality on top of the reflection functionality that comes with PHP. It allows you to get the reflection information about classes, methods and properties statically.", - "homepage": "https://www.doctrine-project.org/projects/reflection.html", - "keywords": [ - "reflection", - "static" - ], - "time": "2020-03-27T11:06:43+00:00" + "time": "2020-10-24T22:13:54+00:00" }, { "name": "psr/container", @@ -913,26 +937,31 @@ "container-interop", "psr" ], + "support": { + "issues": "https://github.com/php-fig/container/issues", + "source": "https://github.com/php-fig/container/tree/master" + }, "time": "2017-02-14T16:28:37+00:00" }, { "name": "symfony/console", - "version": "v4.4.8", + "version": "v4.4.16", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "10bb3ee3c97308869d53b3e3d03f6ac23ff985f7" + "reference": "20f73dd143a5815d475e0838ff867bce1eebd9d5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/10bb3ee3c97308869d53b3e3d03f6ac23ff985f7", - "reference": "10bb3ee3c97308869d53b3e3d03f6ac23ff985f7", + "url": "https://api.github.com/repos/symfony/console/zipball/20f73dd143a5815d475e0838ff867bce1eebd9d5", + "reference": "20f73dd143a5815d475e0838ff867bce1eebd9d5", "shasum": "" }, "require": { - "php": "^7.1.3", + "php": ">=7.1.3", "symfony/polyfill-mbstring": "~1.0", "symfony/polyfill-php73": "^1.8", + "symfony/polyfill-php80": "^1.15", "symfony/service-contracts": "^1.1|^2" }, "conflict": { @@ -960,11 +989,6 @@ "symfony/process": "" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.4-dev" - } - }, "autoload": { "psr-4": { "Symfony\\Component\\Console\\": "" @@ -989,24 +1013,41 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2020-03-30T11:41:10+00:00" + "support": { + "source": "https://github.com/symfony/console/tree/v4.4.16" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-10-24T11:50:19+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.17.0", + "version": "v1.20.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "fa79b11539418b02fc5e1897267673ba2c19419c" + "reference": "39d483bdf39be819deabf04ec872eb0b2410b531" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/fa79b11539418b02fc5e1897267673ba2c19419c", - "reference": "fa79b11539418b02fc5e1897267673ba2c19419c", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/39d483bdf39be819deabf04ec872eb0b2410b531", + "reference": "39d483bdf39be819deabf04ec872eb0b2410b531", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=7.1" }, "suggest": { "ext-mbstring": "For best performance" @@ -1014,7 +1055,11 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.17-dev" + "dev-main": "1.20-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } }, "autoload": { @@ -1048,29 +1093,50 @@ "portable", "shim" ], - "time": "2020-05-12T16:47:27+00:00" + "support": { + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.20.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-10-23T14:02:19+00:00" }, { "name": "symfony/polyfill-php73", - "version": "v1.17.0", + "version": "v1.20.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "a760d8964ff79ab9bf057613a5808284ec852ccc" + "reference": "8ff431c517be11c78c48a39a66d37431e26a6bed" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/a760d8964ff79ab9bf057613a5808284ec852ccc", - "reference": "a760d8964ff79ab9bf057613a5808284ec852ccc", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/8ff431c517be11c78c48a39a66d37431e26a6bed", + "reference": "8ff431c517be11c78c48a39a66d37431e26a6bed", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=7.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.17-dev" + "dev-main": "1.20-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } }, "autoload": { @@ -1106,24 +1172,124 @@ "portable", "shim" ], - "time": "2020-05-12T16:47:27+00:00" + "support": { + "source": "https://github.com/symfony/polyfill-php73/tree/v1.20.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-10-23T14:02:19+00:00" + }, + { + "name": "symfony/polyfill-php80", + "version": "v1.20.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "e70aa8b064c5b72d3df2abd5ab1e90464ad009de" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/e70aa8b064c5b72d3df2abd5ab1e90464ad009de", + "reference": "e70aa8b064c5b72d3df2abd5ab1e90464ad009de", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.20-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" + }, + "files": [ + "bootstrap.php" + ], + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" + }, + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php80/tree/v1.20.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-10-23T14:02:19+00:00" }, { "name": "symfony/service-contracts", - "version": "v1.1.8", + "version": "v1.1.9", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "ffc7f5692092df31515df2a5ecf3b7302b3ddacf" + "reference": "b776d18b303a39f56c63747bcb977ad4b27aca26" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/ffc7f5692092df31515df2a5ecf3b7302b3ddacf", - "reference": "ffc7f5692092df31515df2a5ecf3b7302b3ddacf", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/b776d18b303a39f56c63747bcb977ad4b27aca26", + "reference": "b776d18b303a39f56c63747bcb977ad4b27aca26", "shasum": "" }, "require": { - "php": "^7.1.3", + "php": ">=7.1.3", "psr/container": "^1.0" }, "suggest": { @@ -1133,6 +1299,10 @@ "extra": { "branch-alias": { "dev-master": "1.1-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" } }, "autoload": { @@ -1164,22 +1334,39 @@ "interoperability", "standards" ], - "time": "2019-10-14T12:27:06+00:00" + "support": { + "source": "https://github.com/symfony/service-contracts/tree/v1.1.9" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-07-06T13:19:58+00:00" } ], "packages-dev": [ { "name": "amphp/amp", - "version": "v2.4.4", + "version": "v2.5.0", "source": { "type": "git", "url": "https://github.com/amphp/amp.git", - "reference": "1e58d53e4af390efc7813e36cd215bd82cba4b06" + "reference": "f220a51458bf4dd0dedebb171ac3457813c72bbc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/amphp/amp/zipball/1e58d53e4af390efc7813e36cd215bd82cba4b06", - "reference": "1e58d53e4af390efc7813e36cd215bd82cba4b06", + "url": "https://api.github.com/repos/amphp/amp/zipball/f220a51458bf4dd0dedebb171ac3457813c72bbc", + "reference": "f220a51458bf4dd0dedebb171ac3457813c72bbc", "shasum": "" }, "require": { @@ -1191,8 +1378,8 @@ "ext-json": "*", "jetbrains/phpstorm-stubs": "^2019.3", "phpunit/phpunit": "^6.0.9 | ^7", - "react/promise": "^2", - "vimeo/psalm": "^3.11@dev" + "psalm/phar": "^3.11@dev", + "react/promise": "^2" }, "type": "library", "extra": { @@ -1244,32 +1431,44 @@ "non-blocking", "promise" ], - "time": "2020-04-30T04:54:50+00:00" + "support": { + "irc": "irc://irc.freenode.org/amphp", + "issues": "https://github.com/amphp/amp/issues", + "source": "https://github.com/amphp/amp/tree/master" + }, + "funding": [ + { + "url": "https://github.com/amphp", + "type": "github" + } + ], + "time": "2020-07-14T21:47:18+00:00" }, { "name": "amphp/byte-stream", - "version": "v1.7.3", + "version": "v1.8.0", "source": { "type": "git", "url": "https://github.com/amphp/byte-stream.git", - "reference": "b867505edb79dda8f253ca3c3a2bbadae4b16592" + "reference": "f0c20cf598a958ba2aa8c6e5a71c697d652c7088" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/amphp/byte-stream/zipball/b867505edb79dda8f253ca3c3a2bbadae4b16592", - "reference": "b867505edb79dda8f253ca3c3a2bbadae4b16592", + "url": "https://api.github.com/repos/amphp/byte-stream/zipball/f0c20cf598a958ba2aa8c6e5a71c697d652c7088", + "reference": "f0c20cf598a958ba2aa8c6e5a71c697d652c7088", "shasum": "" }, "require": { - "amphp/amp": "^2" + "amphp/amp": "^2", + "php": ">=7.1" }, "require-dev": { "amphp/php-cs-fixer-config": "dev-master", - "amphp/phpunit-util": "^1", + "amphp/phpunit-util": "^1.4", "friendsofphp/php-cs-fixer": "^2.3", "jetbrains/phpstorm-stubs": "^2019.3", "phpunit/phpunit": "^6 || ^7 || ^8", - "vimeo/psalm": "^3.9@dev" + "psalm/phar": "^3.11.4" }, "type": "library", "extra": { @@ -1309,32 +1508,38 @@ "non-blocking", "stream" ], - "time": "2020-04-04T16:56:54+00:00" + "support": { + "irc": "irc://irc.freenode.org/amphp", + "issues": "https://github.com/amphp/byte-stream/issues", + "source": "https://github.com/amphp/byte-stream/tree/master" + }, + "time": "2020-06-29T18:35:05+00:00" }, { "name": "composer/semver", - "version": "1.5.1", + "version": "3.2.2", "source": { "type": "git", "url": "https://github.com/composer/semver.git", - "reference": "c6bea70230ef4dd483e6bbcab6005f682ed3a8de" + "reference": "4089fddb67bcf6bf860d91b979e95be303835002" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/c6bea70230ef4dd483e6bbcab6005f682ed3a8de", - "reference": "c6bea70230ef4dd483e6bbcab6005f682ed3a8de", + "url": "https://api.github.com/repos/composer/semver/zipball/4089fddb67bcf6bf860d91b979e95be303835002", + "reference": "4089fddb67bcf6bf860d91b979e95be303835002", "shasum": "" }, "require": { - "php": "^5.3.2 || ^7.0" + "php": "^5.3.2 || ^7.0 || ^8.0" }, "require-dev": { - "phpunit/phpunit": "^4.5 || ^5.0.5" + "phpstan/phpstan": "^0.12.19", + "symfony/phpunit-bridge": "^4.2 || ^5" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.x-dev" + "dev-main": "3.x-dev" } }, "autoload": { @@ -1370,20 +1575,39 @@ "validation", "versioning" ], - "time": "2020-01-13T12:06:48+00:00" + "support": { + "irc": "irc://irc.freenode.org/composer", + "issues": "https://github.com/composer/semver/issues", + "source": "https://github.com/composer/semver/tree/3.2.2" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2020-10-14T08:51:15+00:00" }, { "name": "composer/xdebug-handler", - "version": "1.4.1", + "version": "1.4.4", "source": { "type": "git", "url": "https://github.com/composer/xdebug-handler.git", - "reference": "1ab9842d69e64fb3a01be6b656501032d1b78cb7" + "reference": "6e076a124f7ee146f2487554a94b6a19a74887ba" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/1ab9842d69e64fb3a01be6b656501032d1b78cb7", - "reference": "1ab9842d69e64fb3a01be6b656501032d1b78cb7", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/6e076a124f7ee146f2487554a94b6a19a74887ba", + "reference": "6e076a124f7ee146f2487554a94b6a19a74887ba", "shasum": "" }, "require": { @@ -1414,26 +1638,45 @@ "Xdebug", "performance" ], - "time": "2020-03-01T12:26:26+00:00" + "support": { + "irc": "irc://irc.freenode.org/composer", + "issues": "https://github.com/composer/xdebug-handler/issues", + "source": "https://github.com/composer/xdebug-handler/tree/1.4.4" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2020-10-24T12:39:10+00:00" }, { "name": "dealerdirect/phpcodesniffer-composer-installer", - "version": "v0.5.0", + "version": "v0.7.0", "source": { "type": "git", "url": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer.git", - "reference": "e749410375ff6fb7a040a68878c656c2e610b132" + "reference": "e8d808670b8f882188368faaf1144448c169c0b7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Dealerdirect/phpcodesniffer-composer-installer/zipball/e749410375ff6fb7a040a68878c656c2e610b132", - "reference": "e749410375ff6fb7a040a68878c656c2e610b132", + "url": "https://api.github.com/repos/Dealerdirect/phpcodesniffer-composer-installer/zipball/e8d808670b8f882188368faaf1144448c169c0b7", + "reference": "e8d808670b8f882188368faaf1144448c169c0b7", "shasum": "" }, "require": { - "composer-plugin-api": "^1.0", - "php": "^5.3|^7", - "squizlabs/php_codesniffer": "^2|^3" + "composer-plugin-api": "^1.0 || ^2.0", + "php": ">=5.3", + "squizlabs/php_codesniffer": "^2 || ^3 || 4.0.x-dev" }, "require-dev": { "composer/composer": "*", @@ -1480,32 +1723,73 @@ "stylecheck", "tests" ], - "time": "2018-10-26T13:21:45+00:00" + "support": { + "issues": "https://github.com/dealerdirect/phpcodesniffer-composer-installer/issues", + "source": "https://github.com/dealerdirect/phpcodesniffer-composer-installer" + }, + "time": "2020-06-25T14:57:39+00:00" + }, + { + "name": "dnoegel/php-xdg-base-dir", + "version": "v0.1.1", + "source": { + "type": "git", + "url": "https://github.com/dnoegel/php-xdg-base-dir.git", + "reference": "8f8a6e48c5ecb0f991c2fdcf5f154a47d85f9ffd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/dnoegel/php-xdg-base-dir/zipball/8f8a6e48c5ecb0f991c2fdcf5f154a47d85f9ffd", + "reference": "8f8a6e48c5ecb0f991c2fdcf5f154a47d85f9ffd", + "shasum": "" + }, + "require": { + "php": ">=5.3.2" + }, + "require-dev": { + "phpunit/phpunit": "~7.0|~6.0|~5.0|~4.8.35" + }, + "type": "library", + "autoload": { + "psr-4": { + "XdgBaseDir\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "implementation of xdg base directory specification for php", + "support": { + "issues": "https://github.com/dnoegel/php-xdg-base-dir/issues", + "source": "https://github.com/dnoegel/php-xdg-base-dir/tree/v0.1.1" + }, + "time": "2019-12-04T15:06:13+00:00" }, { "name": "doctrine/coding-standard", - "version": "5.0.1", + "version": "6.0.1", "source": { "type": "git", "url": "https://github.com/doctrine/coding-standard.git", - "reference": "9017efe98b47329cbd895d43f596747c8ef27307" + "reference": "0639b3814c4e59986a0f6b277d1c7e15ed04e28d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/coding-standard/zipball/9017efe98b47329cbd895d43f596747c8ef27307", - "reference": "9017efe98b47329cbd895d43f596747c8ef27307", + "url": "https://api.github.com/repos/doctrine/coding-standard/zipball/0639b3814c4e59986a0f6b277d1c7e15ed04e28d", + "reference": "0639b3814c4e59986a0f6b277d1c7e15ed04e28d", "shasum": "" }, "require": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.5.0", + "dealerdirect/phpcodesniffer-composer-installer": "^0.5.0 | ^0.6.2 | ^0.7", "php": "^7.1", - "slevomat/coding-standard": "^4.8.0", - "squizlabs/php_codesniffer": "^3.3.2" + "slevomat/coding-standard": "^5.0", + "squizlabs/php_codesniffer": "^3.4.0" }, "type": "phpcodesniffer-standard", "extra": { "branch-alias": { - "dev-master": "5.0.x-dev" + "dev-master": "6.0.x-dev" } }, "autoload": { @@ -1541,7 +1825,11 @@ "standard", "style" ], - "time": "2019-01-31T13:22:30+00:00" + "support": { + "issues": "https://github.com/doctrine/coding-standard/issues", + "source": "https://github.com/doctrine/coding-standard/tree/6.0.1" + }, + "time": "2020-10-25T17:26:29+00:00" }, { "name": "felixfbecker/advanced-json-rpc", @@ -1582,31 +1870,40 @@ } ], "description": "A more advanced JSONRPC implementation", + "support": { + "issues": "https://github.com/felixfbecker/php-advanced-json-rpc/issues", + "source": "https://github.com/felixfbecker/php-advanced-json-rpc/tree/master" + }, "time": "2020-03-11T15:21:41+00:00" }, { "name": "felixfbecker/language-server-protocol", - "version": "v1.4.0", + "version": "v1.5.0", "source": { "type": "git", "url": "https://github.com/felixfbecker/php-language-server-protocol.git", - "reference": "378801f6139bb74ac215d81cca1272af61df9a9f" + "reference": "85e83cacd2ed573238678c6875f8f0d7ec699541" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/felixfbecker/php-language-server-protocol/zipball/378801f6139bb74ac215d81cca1272af61df9a9f", - "reference": "378801f6139bb74ac215d81cca1272af61df9a9f", + "url": "https://api.github.com/repos/felixfbecker/php-language-server-protocol/zipball/85e83cacd2ed573238678c6875f8f0d7ec699541", + "reference": "85e83cacd2ed573238678c6875f8f0d7ec699541", "shasum": "" }, "require": { - "php": "^7.0" + "php": ">=7.1" }, "require-dev": { "phpstan/phpstan": "*", - "phpunit/phpunit": "^6.3", - "squizlabs/php_codesniffer": "^3.1" + "squizlabs/php_codesniffer": "^3.1", + "vimeo/psalm": "^4.0" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, "autoload": { "psr-4": { "LanguageServerProtocol\\": "src/" @@ -1629,24 +1926,28 @@ "php", "server" ], - "time": "2019-06-23T21:03:50+00:00" + "support": { + "issues": "https://github.com/felixfbecker/php-language-server-protocol/issues", + "source": "https://github.com/felixfbecker/php-language-server-protocol/tree/v1.5.0" + }, + "time": "2020-10-23T13:55:30+00:00" }, { "name": "myclabs/deep-copy", - "version": "1.9.5", + "version": "1.10.1", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "b2c28789e80a97badd14145fda39b545d83ca3ef" + "reference": "969b211f9a51aa1f6c01d1d2aef56d3bd91598e5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/b2c28789e80a97badd14145fda39b545d83ca3ef", - "reference": "b2c28789e80a97badd14145fda39b545d83ca3ef", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/969b211f9a51aa1f6c01d1d2aef56d3bd91598e5", + "reference": "969b211f9a51aa1f6c01d1d2aef56d3bd91598e5", "shasum": "" }, "require": { - "php": "^7.1" + "php": "^7.1 || ^8.0" }, "replace": { "myclabs/deep-copy": "self.version" @@ -1677,7 +1978,17 @@ "object", "object graph" ], - "time": "2020-01-17T21:11:47+00:00" + "support": { + "issues": "https://github.com/myclabs/DeepCopy/issues", + "source": "https://github.com/myclabs/DeepCopy/tree/1.x" + }, + "funding": [ + { + "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", + "type": "tidelift" + } + ], + "time": "2020-06-29T13:22:24+00:00" }, { "name": "netresearch/jsonmapper", @@ -1723,20 +2034,25 @@ } ], "description": "Map nested JSON structures onto PHP classes", + "support": { + "email": "cweiske@cweiske.de", + "issues": "https://github.com/cweiske/jsonmapper/issues", + "source": "https://github.com/cweiske/jsonmapper/tree/master" + }, "time": "2020-04-16T18:48:43+00:00" }, { "name": "nikic/php-parser", - "version": "v4.4.0", + "version": "v4.10.2", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "bd43ec7152eaaab3bd8c6d0aa95ceeb1df8ee120" + "reference": "658f1be311a230e0907f5dfe0213742aff0596de" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/bd43ec7152eaaab3bd8c6d0aa95ceeb1df8ee120", - "reference": "bd43ec7152eaaab3bd8c6d0aa95ceeb1df8ee120", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/658f1be311a230e0907f5dfe0213742aff0596de", + "reference": "658f1be311a230e0907f5dfe0213742aff0596de", "shasum": "" }, "require": { @@ -1744,8 +2060,8 @@ "php": ">=7.0" }, "require-dev": { - "ircmaxell/php-yacc": "0.0.5", - "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0" + "ircmaxell/php-yacc": "^0.0.7", + "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0" }, "bin": [ "bin/php-parse" @@ -1753,7 +2069,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.3-dev" + "dev-master": "4.9-dev" } }, "autoload": { @@ -1775,7 +2091,11 @@ "parser", "php" ], - "time": "2020-04-10T16:34:50+00:00" + "support": { + "issues": "https://github.com/nikic/PHP-Parser/issues", + "source": "https://github.com/nikic/PHP-Parser/tree/v4.10.2" + }, + "time": "2020-09-26T10:30:38+00:00" }, { "name": "openlss/lib-array2xml", @@ -1824,6 +2144,10 @@ "xml", "xml conversion" ], + "support": { + "issues": "https://github.com/nullivex/lib-array2xml/issues", + "source": "https://github.com/nullivex/lib-array2xml/tree/master" + }, "time": "2019-03-29T20:06:56+00:00" }, { @@ -1879,6 +2203,10 @@ } ], "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", + "support": { + "issues": "https://github.com/phar-io/manifest/issues", + "source": "https://github.com/phar-io/manifest/tree/master" + }, "time": "2018-07-08T19:23:20+00:00" }, { @@ -1926,6 +2254,10 @@ } ], "description": "Library for handling version information and constraints", + "support": { + "issues": "https://github.com/phar-io/version/issues", + "source": "https://github.com/phar-io/version/tree/master" + }, "time": "2018-07-08T19:19:57+00:00" }, { @@ -1975,6 +2307,10 @@ "reflection", "static analysis" ], + "support": { + "issues": "https://github.com/phpDocumentor/ReflectionCommon/issues", + "source": "https://github.com/phpDocumentor/ReflectionCommon/tree/master" + }, "time": "2020-04-27T09:25:28+00:00" }, { @@ -2027,6 +2363,10 @@ } ], "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", + "support": { + "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", + "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/release/4.x" + }, "time": "2019-12-28T18:55:12+00:00" }, { @@ -2074,6 +2414,10 @@ } ], "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", + "support": { + "issues": "https://github.com/phpDocumentor/TypeResolver/issues", + "source": "https://github.com/phpDocumentor/TypeResolver/tree/0.7.2" + }, "time": "2019-08-22T18:11:29+00:00" }, { @@ -2137,24 +2481,79 @@ "spy", "stub" ], + "support": { + "issues": "https://github.com/phpspec/prophecy/issues", + "source": "https://github.com/phpspec/prophecy/tree/v1.10.3" + }, "time": "2020-03-05T15:02:03+00:00" }, + { + "name": "phpstan/phpdoc-parser", + "version": "0.3.5", + "source": { + "type": "git", + "url": "https://github.com/phpstan/phpdoc-parser.git", + "reference": "8c4ef2aefd9788238897b678a985e1d5c8df6db4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/8c4ef2aefd9788238897b678a985e1d5c8df6db4", + "reference": "8c4ef2aefd9788238897b678a985e1d5c8df6db4", + "shasum": "" + }, + "require": { + "php": "~7.1" + }, + "require-dev": { + "consistence/coding-standard": "^3.5", + "jakub-onderka/php-parallel-lint": "^0.9.2", + "phing/phing": "^2.16.0", + "phpstan/phpstan": "^0.10", + "phpunit/phpunit": "^6.3", + "slevomat/coding-standard": "^4.7.2", + "squizlabs/php_codesniffer": "^3.3.2", + "symfony/process": "^3.4 || ^4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "0.3-dev" + } + }, + "autoload": { + "psr-4": { + "PHPStan\\PhpDocParser\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "PHPDoc parser with support for nullable, intersection and generic types", + "support": { + "issues": "https://github.com/phpstan/phpdoc-parser/issues", + "source": "https://github.com/phpstan/phpdoc-parser/tree/master" + }, + "time": "2019-06-07T19:13:52+00:00" + }, { "name": "phpstan/phpstan", - "version": "0.12.25", + "version": "0.12.52", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "9619551d68b2d4c0d681a8df73f3c847c798ee64" + "reference": "e96dd5e7ae9aefed663bc7e285ad96792b67eadc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/9619551d68b2d4c0d681a8df73f3c847c798ee64", - "reference": "9619551d68b2d4c0d681a8df73f3c847c798ee64", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/e96dd5e7ae9aefed663bc7e285ad96792b67eadc", + "reference": "e96dd5e7ae9aefed663bc7e285ad96792b67eadc", "shasum": "" }, "require": { - "php": "^7.1" + "php": "^7.1|^8.0" }, "conflict": { "phpstan/phpstan-shim": "*" @@ -2179,7 +2578,25 @@ "MIT" ], "description": "PHPStan - PHP Static Analysis Tool", - "time": "2020-05-10T20:36:16+00:00" + "support": { + "issues": "https://github.com/phpstan/phpstan/issues", + "source": "https://github.com/phpstan/phpstan/tree/0.12.52" + }, + "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-10-25T07:23:44+00:00" }, { "name": "phpunit/php-code-coverage", @@ -2242,6 +2659,10 @@ "testing", "xunit" ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/master" + }, "time": "2018-10-31T16:06:48+00:00" }, { @@ -2292,6 +2713,10 @@ "filesystem", "iterator" ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/2.0.2" + }, "time": "2018-09-13T20:33:42+00:00" }, { @@ -2333,6 +2758,10 @@ "keywords": [ "template" ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-text-template/issues", + "source": "https://github.com/sebastianbergmann/php-text-template/tree/1.2.1" + }, "time": "2015-06-21T13:50:34+00:00" }, { @@ -2382,6 +2811,10 @@ "keywords": [ "timer" ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-timer/issues", + "source": "https://github.com/sebastianbergmann/php-timer/tree/master" + }, "time": "2019-06-07T04:22:29+00:00" }, { @@ -2431,6 +2864,11 @@ "keywords": [ "tokenizer" ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-token-stream/issues", + "source": "https://github.com/sebastianbergmann/php-token-stream/tree/3.1.1" + }, + "abandoned": true, "time": "2019-09-17T06:23:10+00:00" }, { @@ -2515,6 +2953,10 @@ "testing", "xunit" ], + "support": { + "issues": "https://github.com/sebastianbergmann/phpunit/issues", + "source": "https://github.com/sebastianbergmann/phpunit/tree/7.5.20" + }, "time": "2020-01-08T08:45:45+00:00" }, { @@ -2562,6 +3004,9 @@ "psr", "psr-3" ], + "support": { + "source": "https://github.com/php-fig/log/tree/1.1.3" + }, "time": "2020-03-23T09:12:05+00:00" }, { @@ -2607,6 +3052,10 @@ ], "description": "Looks up which function or method a line of code belongs to", "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", + "support": { + "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", + "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/master" + }, "time": "2017-03-04T06:30:41+00:00" }, { @@ -2671,6 +3120,10 @@ "compare", "equality" ], + "support": { + "issues": "https://github.com/sebastianbergmann/comparator/issues", + "source": "https://github.com/sebastianbergmann/comparator/tree/master" + }, "time": "2018-07-12T15:12:46+00:00" }, { @@ -2727,6 +3180,10 @@ "unidiff", "unified diff" ], + "support": { + "issues": "https://github.com/sebastianbergmann/diff/issues", + "source": "https://github.com/sebastianbergmann/diff/tree/master" + }, "time": "2019-02-04T06:01:07+00:00" }, { @@ -2780,6 +3237,10 @@ "environment", "hhvm" ], + "support": { + "issues": "https://github.com/sebastianbergmann/environment/issues", + "source": "https://github.com/sebastianbergmann/environment/tree/4.2.3" + }, "time": "2019-11-20T08:46:58+00:00" }, { @@ -2847,6 +3308,10 @@ "export", "exporter" ], + "support": { + "issues": "https://github.com/sebastianbergmann/exporter/issues", + "source": "https://github.com/sebastianbergmann/exporter/tree/master" + }, "time": "2019-09-14T09:02:43+00:00" }, { @@ -2898,6 +3363,10 @@ "keywords": [ "global state" ], + "support": { + "issues": "https://github.com/sebastianbergmann/global-state/issues", + "source": "https://github.com/sebastianbergmann/global-state/tree/2.0.0" + }, "time": "2017-04-27T15:39:26+00:00" }, { @@ -2945,6 +3414,10 @@ ], "description": "Traverses array structures and object graphs to enumerate all referenced objects", "homepage": "https://github.com/sebastianbergmann/object-enumerator/", + "support": { + "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", + "source": "https://github.com/sebastianbergmann/object-enumerator/tree/master" + }, "time": "2017-08-03T12:35:26+00:00" }, { @@ -2990,6 +3463,10 @@ ], "description": "Allows reflection of object attributes, including inherited and non-public ones", "homepage": "https://github.com/sebastianbergmann/object-reflector/", + "support": { + "issues": "https://github.com/sebastianbergmann/object-reflector/issues", + "source": "https://github.com/sebastianbergmann/object-reflector/tree/master" + }, "time": "2017-03-29T09:07:27+00:00" }, { @@ -3043,6 +3520,10 @@ ], "description": "Provides functionality to recursively process PHP variables", "homepage": "http://www.github.com/sebastianbergmann/recursion-context", + "support": { + "issues": "https://github.com/sebastianbergmann/recursion-context/issues", + "source": "https://github.com/sebastianbergmann/recursion-context/tree/master" + }, "time": "2017-03-03T06:23:57+00:00" }, { @@ -3085,6 +3566,10 @@ ], "description": "Provides a list of PHP built-in functions that operate on resources", "homepage": "https://www.github.com/sebastianbergmann/resource-operations", + "support": { + "issues": "https://github.com/sebastianbergmann/resource-operations/issues", + "source": "https://github.com/sebastianbergmann/resource-operations/tree/master" + }, "time": "2018-10-04T04:07:39+00:00" }, { @@ -3128,33 +3613,38 @@ ], "description": "Library that helps with managing the version number of Git-hosted PHP projects", "homepage": "https://github.com/sebastianbergmann/version", + "support": { + "issues": "https://github.com/sebastianbergmann/version/issues", + "source": "https://github.com/sebastianbergmann/version/tree/master" + }, "time": "2016-10-03T07:35:21+00:00" }, { "name": "slevomat/coding-standard", - "version": "4.8.7", + "version": "5.0.4", "source": { "type": "git", "url": "https://github.com/slevomat/coding-standard.git", - "reference": "bff96313d8c7c2ba57a4edb13c1c141df8988c58" + "reference": "287ac3347c47918c0bf5e10335e36197ea10894c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/slevomat/coding-standard/zipball/bff96313d8c7c2ba57a4edb13c1c141df8988c58", - "reference": "bff96313d8c7c2ba57a4edb13c1c141df8988c58", + "url": "https://api.github.com/repos/slevomat/coding-standard/zipball/287ac3347c47918c0bf5e10335e36197ea10894c", + "reference": "287ac3347c47918c0bf5e10335e36197ea10894c", "shasum": "" }, "require": { "php": "^7.1", - "squizlabs/php_codesniffer": "^3.4.0" + "phpstan/phpdoc-parser": "^0.3.1", + "squizlabs/php_codesniffer": "^3.4.1" }, "require-dev": { "jakub-onderka/php-parallel-lint": "1.0.0", "phing/phing": "2.16.1", - "phpstan/phpstan": "0.9.2", - "phpstan/phpstan-phpunit": "0.9.4", - "phpstan/phpstan-strict-rules": "0.9", - "phpunit/phpunit": "7.5.1" + "phpstan/phpstan": "0.11.4", + "phpstan/phpstan-phpunit": "0.11", + "phpstan/phpstan-strict-rules": "0.11", + "phpunit/phpunit": "8.0.5" }, "type": "phpcodesniffer-standard", "autoload": { @@ -3167,20 +3657,24 @@ "MIT" ], "description": "Slevomat Coding Standard for PHP_CodeSniffer complements Consistence Coding Standard by providing sniffs with additional checks.", - "time": "2019-01-03T13:15:50+00:00" + "support": { + "issues": "https://github.com/slevomat/coding-standard/issues", + "source": "https://github.com/slevomat/coding-standard/tree/master" + }, + "time": "2019-03-22T19:10:53+00:00" }, { "name": "squizlabs/php_codesniffer", - "version": "3.5.5", + "version": "3.5.8", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "73e2e7f57d958e7228fce50dc0c61f58f017f9f6" + "reference": "9d583721a7157ee997f235f327de038e7ea6dac4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/73e2e7f57d958e7228fce50dc0c61f58f017f9f6", - "reference": "73e2e7f57d958e7228fce50dc0c61f58f017f9f6", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/9d583721a7157ee997f235f327de038e7ea6dac4", + "reference": "9d583721a7157ee997f235f327de038e7ea6dac4", "shasum": "" }, "require": { @@ -3218,24 +3712,29 @@ "phpcs", "standards" ], - "time": "2020-04-17T01:09:41+00:00" + "support": { + "issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues", + "source": "https://github.com/squizlabs/PHP_CodeSniffer", + "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki" + }, + "time": "2020-10-23T02:01:07+00:00" }, { "name": "symfony/polyfill-ctype", - "version": "v1.17.0", + "version": "v1.20.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "e94c8b1bbe2bc77507a1056cdb06451c75b427f9" + "reference": "f4ba089a5b6366e453971d3aad5fe8e897b37f41" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/e94c8b1bbe2bc77507a1056cdb06451c75b427f9", - "reference": "e94c8b1bbe2bc77507a1056cdb06451c75b427f9", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/f4ba089a5b6366e453971d3aad5fe8e897b37f41", + "reference": "f4ba089a5b6366e453971d3aad5fe8e897b37f41", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=7.1" }, "suggest": { "ext-ctype": "For best performance" @@ -3243,7 +3742,11 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.17-dev" + "dev-main": "1.20-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } }, "autoload": { @@ -3276,24 +3779,41 @@ "polyfill", "portable" ], - "time": "2020-05-12T16:14:59+00:00" + "support": { + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.20.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-10-23T14:02:19+00:00" }, { "name": "symfony/yaml", - "version": "v4.4.8", + "version": "v4.4.16", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "b385dce1c0e9f839b384af90188638819433e252" + "reference": "543cb4dbd45ed803f08a9a65f27fb149b5dd20c2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/b385dce1c0e9f839b384af90188638819433e252", - "reference": "b385dce1c0e9f839b384af90188638819433e252", + "url": "https://api.github.com/repos/symfony/yaml/zipball/543cb4dbd45ed803f08a9a65f27fb149b5dd20c2", + "reference": "543cb4dbd45ed803f08a9a65f27fb149b5dd20c2", "shasum": "" }, "require": { - "php": "^7.1.3", + "php": ">=7.1.3", "symfony/polyfill-ctype": "~1.8" }, "conflict": { @@ -3306,11 +3826,6 @@ "symfony/console": "For validating YAML files using the lint command" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.4-dev" - } - }, "autoload": { "psr-4": { "Symfony\\Component\\Yaml\\": "" @@ -3335,7 +3850,24 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2020-04-28T17:55:16+00:00" + "support": { + "source": "https://github.com/symfony/yaml/tree/v4.4.16" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-10-24T11:50:19+00:00" }, { "name": "theseer/tokenizer", @@ -3375,37 +3907,43 @@ } ], "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", + "support": { + "issues": "https://github.com/theseer/tokenizer/issues", + "source": "https://github.com/theseer/tokenizer/tree/master" + }, "time": "2019-06-13T22:48:21+00:00" }, { "name": "vimeo/psalm", - "version": "3.11.4", + "version": "3.18.2", "source": { "type": "git", "url": "https://github.com/vimeo/psalm.git", - "reference": "58e1d8e68e5098bf4fbfdfb420c38d563f882549" + "reference": "19aa905f7c3c7350569999a93c40ae91ae4e1626" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vimeo/psalm/zipball/58e1d8e68e5098bf4fbfdfb420c38d563f882549", - "reference": "58e1d8e68e5098bf4fbfdfb420c38d563f882549", + "url": "https://api.github.com/repos/vimeo/psalm/zipball/19aa905f7c3c7350569999a93c40ae91ae4e1626", + "reference": "19aa905f7c3c7350569999a93c40ae91ae4e1626", "shasum": "" }, "require": { "amphp/amp": "^2.1", "amphp/byte-stream": "^1.5", - "composer/semver": "^1.4", + "composer/package-versions-deprecated": "^1.8.0", + "composer/semver": "^1.4 || ^2.0 || ^3.0", "composer/xdebug-handler": "^1.1", + "dnoegel/php-xdg-base-dir": "^0.1.1", "ext-dom": "*", "ext-json": "*", "ext-libxml": "*", + "ext-mbstring": "*", "ext-simplexml": "*", "ext-tokenizer": "*", "felixfbecker/advanced-json-rpc": "^3.0.3", "felixfbecker/language-server-protocol": "^1.4", - "netresearch/jsonmapper": "^1.0 || ^2.0", - "nikic/php-parser": "^4.3", - "ocramius/package-versions": "^1.2", + "netresearch/jsonmapper": "^1.0 || ^2.0 || ^3.0", + "nikic/php-parser": "4.3.* || 4.4.* || 4.5.* || 4.6.* || ^4.8", "openlss/lib-array2xml": "^1.0", "php": "^7.1.3|^8", "sebastian/diff": "^3.0 || ^4.0", @@ -3421,14 +3959,15 @@ "bamarni/composer-bin-plugin": "^1.2", "brianium/paratest": "^4.0.0", "ext-curl": "*", - "php-coveralls/php-coveralls": "^2.2", + "phpdocumentor/reflection-docblock": "^4.3.4 || ^5", "phpmyadmin/sql-parser": "5.1.0", "phpspec/prophecy": ">=1.9.0", "phpunit/phpunit": "^7.5.16 || ^8.5 || ^9.0", - "psalm/plugin-phpunit": "^0.10", + "psalm/plugin-phpunit": "^0.11", "slevomat/coding-standard": "^5.0", "squizlabs/php_codesniffer": "^3.5", - "symfony/process": "^4.3" + "symfony/process": "^4.3", + "weirdan/prophecy-shim": "^1.0 || ^2.0" }, "suggest": { "ext-igbinary": "^2.0.5" @@ -3450,8 +3989,7 @@ }, "autoload": { "psr-4": { - "Psalm\\Plugin\\": "src/Psalm/Plugin", - "Psalm\\": "src/Psalm" + "Psalm\\": "src/Psalm/" }, "files": [ "src/functions.php", @@ -3473,27 +4011,32 @@ "inspection", "php" ], - "time": "2020-05-11T13:39:25+00:00" + "support": { + "issues": "https://github.com/vimeo/psalm/issues", + "source": "https://github.com/vimeo/psalm/tree/3.18.2" + }, + "time": "2020-10-20T13:48:22+00:00" }, { "name": "webmozart/assert", - "version": "1.8.0", + "version": "1.9.1", "source": { "type": "git", "url": "https://github.com/webmozart/assert.git", - "reference": "ab2cb0b3b559010b75981b1bdce728da3ee90ad6" + "reference": "bafc69caeb4d49c39fd0779086c03a3738cbb389" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozart/assert/zipball/ab2cb0b3b559010b75981b1bdce728da3ee90ad6", - "reference": "ab2cb0b3b559010b75981b1bdce728da3ee90ad6", + "url": "https://api.github.com/repos/webmozart/assert/zipball/bafc69caeb4d49c39fd0779086c03a3738cbb389", + "reference": "bafc69caeb4d49c39fd0779086c03a3738cbb389", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0", + "php": "^5.3.3 || ^7.0 || ^8.0", "symfony/polyfill-ctype": "^1.8" }, "conflict": { + "phpstan/phpstan": "<0.12.20", "vimeo/psalm": "<3.9.1" }, "require-dev": { @@ -3521,7 +4064,11 @@ "check", "validate" ], - "time": "2020-04-18T12:12:48+00:00" + "support": { + "issues": "https://github.com/webmozart/assert/issues", + "source": "https://github.com/webmozart/assert/tree/master" + }, + "time": "2020-07-08T17:02:28+00:00" }, { "name": "webmozart/glob", @@ -3568,6 +4115,10 @@ } ], "description": "A PHP implementation of Ant's glob.", + "support": { + "issues": "https://github.com/webmozart/glob/issues", + "source": "https://github.com/webmozart/glob/tree/master" + }, "time": "2015-12-29T11:14:33+00:00" }, { @@ -3614,6 +4165,10 @@ } ], "description": "A robust cross-platform utility for normalizing, comparing and modifying file paths.", + "support": { + "issues": "https://github.com/webmozart/path-util/issues", + "source": "https://github.com/webmozart/path-util/tree/2.3.0" + }, "time": "2015-12-17T08:42:14+00:00" } ], @@ -3630,5 +4185,5 @@ "platform-overrides": { "php": "7.1.3" }, - "plugin-api-version": "1.1.0" + "plugin-api-version": "2.0.0" } diff --git a/lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php b/lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php index de01a59d7c..4ac6eb8ac4 100644 --- a/lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php +++ b/lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php @@ -342,7 +342,7 @@ public function loadMetadataForClass($className, ClassMetadata $metadata) 'initialValue' => $seqGeneratorAnnot->initialValue ] ); - } else if ($this->reader->getPropertyAnnotation($property, 'Doctrine\ORM\Mapping\TableGenerator')) { + } elseif ($this->reader->getPropertyAnnotation($property, 'Doctrine\ORM\Id\TableGenerator')) { throw MappingException::tableIdGeneratorNotImplemented($className); } else if ($customGeneratorAnnot = $this->reader->getPropertyAnnotation($property, Mapping\CustomIdGenerator::class)) { $metadata->setCustomGeneratorDefinition( diff --git a/phpcs.xml.dist b/phpcs.xml.dist index 5aced8ad82..23c877cd55 100644 --- a/phpcs.xml.dist +++ b/phpcs.xml.dist @@ -41,10 +41,6 @@ lib/Doctrine/ORM/Annotation/* - - lib/Doctrine/ORM/Internal/Hydration/AbstractHydrator.php - - lib/Doctrine/ORM/Query/Parser.php diff --git a/tests/Doctrine/Tests/ORM/Functional/ValueObjectsTest.php b/tests/Doctrine/Tests/ORM/Functional/ValueObjectsTest.php index 7a483ebc78..19a63350a3 100644 --- a/tests/Doctrine/Tests/ORM/Functional/ValueObjectsTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/ValueObjectsTest.php @@ -1,11 +1,14 @@ _em->getClassMetadata(DDC93Person::class); - $this->assertInstanceOf(RuntimePublicReflectionProperty::class, $classMetadata->getReflectionProperty('address')); + $this->assertInstanceOf( + class_exists(RuntimePublicReflectionProperty::class) ? + RuntimePublicReflectionProperty::class : + LegacyRuntimePublicReflectionProperty::class, + $classMetadata->getReflectionProperty('address') + ); $this->assertInstanceOf(ReflectionEmbeddedProperty::class, $classMetadata->getReflectionProperty('address.street')); } diff --git a/tests/Doctrine/Tests/ORM/Mapping/AnnotationDriverTest.php b/tests/Doctrine/Tests/ORM/Mapping/AnnotationDriverTest.php index 1083143762..e25404348b 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/AnnotationDriverTest.php +++ b/tests/Doctrine/Tests/ORM/Mapping/AnnotationDriverTest.php @@ -238,7 +238,7 @@ public function testInvalidFetchOptionThrowsException() $factory->setEntityManager($em); $this->expectException(AnnotationException::class); - $this->expectExceptionMessage('[Enum Error] Attribute "fetch" of @Doctrine\ORM\Mapping\OneToMany declared on property Doctrine\Tests\ORM\Mapping\InvalidFetchOption::$collection accept only [LAZY, EAGER, EXTRA_LAZY], but got eager.'); + $this->expectExceptionMessage('[Enum Error] Attribute "fetch" of @Doctrine\ORM\Mapping\OneToMany declared on property Doctrine\Tests\ORM\Mapping\InvalidFetchOption::$collection accepts only [LAZY, EAGER, EXTRA_LAZY], but got eager.'); $factory->getMetadataFor(InvalidFetchOption::class); } From 2f0eb95c90b3bceda8cf88c2e98e20d3fa8204db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20K=C3=A4fer?= Date: Sat, 31 Oct 2020 12:13:48 +0100 Subject: [PATCH 128/136] Patch 1 (#8325) * Update outdated doc parts - The cache implementation moved from `Common` to `doctrine/cache` - APCu is mor appropiate nowadays I guess - AbstractQuery::useResultCache() is deprecated since 2.7 * Fix wrong argument * Fix wrong arguments and remove useless line --- docs/en/reference/caching.rst | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/docs/en/reference/caching.rst b/docs/en/reference/caching.rst index 04370bb4ca..a541604da4 100644 --- a/docs/en/reference/caching.rst +++ b/docs/en/reference/caching.rst @@ -1,8 +1,8 @@ Caching ======= -Doctrine provides cache drivers in the ``Common`` package for some -of the most popular caching implementations such as APC, Memcache +Doctrine provides cache drivers in the ``doctrine/cache`` package for some +of the most popular caching implementations such as APCu, Memcache and Xcache. We also provide an ``ArrayCache`` driver which stores the data in a PHP array. Obviously, when using ``ArrayCache``, the cache does not persist between requests, but this is useful for @@ -306,7 +306,7 @@ the result cache. createQuery('select u from \Entities\User u'); - $query->useResultCache(true); + $query->enableResultCache(); You can also configure an individual query to use a different result cache driver. @@ -317,19 +317,18 @@ result cache driver. $cacheDriver = new \Doctrine\Common\Cache\PhpFileCache( '/path/to/writable/directory' ); - $config = new \Doctrine\ORM\Configuration(); $query->setResultCacheDriver($cacheDriver); .. note:: Setting the result cache driver on the query will automatically enable the result cache for the query. If you want to - disable it pass false to ``useResultCache()``. + disable it use ``disableResultCache()``. :: useResultCache(false); + $query->disableResultCache(); If you want to set the time the cache has to live you can use the @@ -350,12 +349,12 @@ yourself with the ``setResultCacheId()`` method. $query->setResultCacheId('my_custom_id'); You can also set the lifetime and cache ID by passing the values as -the second and third argument to ``useResultCache()``. +the first and second argument to ``enableResultCache()``. .. code-block:: php useResultCache(true, 3600, 'my_custom_id'); + $query->enableResultCache(3600, 'my_custom_id'); Metadata Cache ~~~~~~~~~~~~~~ From c270eba6782ba0b99e86ceac9b2217e5983db84c Mon Sep 17 00:00:00 2001 From: Benjamin Eberlei Date: Sat, 7 Nov 2020 18:11:42 +0100 Subject: [PATCH 129/136] Start moving travis phpunit runs to Github actions. (#8317) * Move PHPUnit runs from Travis to Github Actions This removes all artifacts used for TravisCI testing and replaces them with the existing infrastructure for Github Actions from DBAL component. In addition some test changes were needed and triggered larger Coding Style cleanups in 3 test files. * Remove composer.lock and improve naming in CI workflow. --- .github/workflows/coding-standard.yml | 46 + .github/workflows/continuous-integration.yml | 232 + .../workflows/{ci.yml => static-analysis.yml} | 51 +- .travis.yml | 106 - ci/github/phpunit/mysqli.xml | 39 + ci/github/phpunit/pdo_mysql.xml | 39 + ci/github/phpunit/pdo_pgsql.xml | 39 + ci/github/phpunit/sqlite.xml | 33 + composer.json | 3 - composer.lock | 4189 ----------------- .../Tests/ORM/Functional/ValueObjectsTest.php | 157 +- .../ORM/Mapping/AnnotationDriverTest.php | 63 +- tests/travis/install-mysql-5.7.sh | 8 - tests/travis/mariadb.travis.xml | 44 - tests/travis/mysql.travis.xml | 44 - tests/travis/pgsql.travis.xml | 46 - tests/travis/sqlite.travis.xml | 30 - 17 files changed, 536 insertions(+), 4633 deletions(-) create mode 100644 .github/workflows/coding-standard.yml create mode 100644 .github/workflows/continuous-integration.yml rename .github/workflows/{ci.yml => static-analysis.yml} (53%) delete mode 100644 .travis.yml create mode 100644 ci/github/phpunit/mysqli.xml create mode 100644 ci/github/phpunit/pdo_mysql.xml create mode 100644 ci/github/phpunit/pdo_pgsql.xml create mode 100644 ci/github/phpunit/sqlite.xml delete mode 100644 composer.lock delete mode 100755 tests/travis/install-mysql-5.7.sh delete mode 100644 tests/travis/mariadb.travis.xml delete mode 100644 tests/travis/mysql.travis.xml delete mode 100644 tests/travis/pgsql.travis.xml delete mode 100644 tests/travis/sqlite.travis.xml diff --git a/.github/workflows/coding-standard.yml b/.github/workflows/coding-standard.yml new file mode 100644 index 0000000000..96e802c9b2 --- /dev/null +++ b/.github/workflows/coding-standard.yml @@ -0,0 +1,46 @@ +name: Static Analysis + +on: + pull_request: + +jobs: + coding-standards: + name: "Coding Standards" + runs-on: "ubuntu-latest" + + strategy: + matrix: + php-version: + - "7.4" + + steps: + - name: "Checkout" + uses: "actions/checkout@v2" + with: + fetch-depth: 10 + + - name: "Install PHP" + uses: "shivammathur/setup-php@v2" + with: + coverage: "none" + php-version: "${{ matrix.php-version }}" + tools: "cs2pr" + + - name: "Cache dependencies installed with composer" + uses: "actions/cache@v1" + with: + path: "~/.composer/cache" + key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}" + restore-keys: "php-${{ matrix.php-version }}-composer-locked-" + + - name: "Install dependencies with composer" + run: "composer update --no-interaction --no-progress --no-suggest" + + - name: "Install git-phpcs" + run: "wget https://github.com/diff-sniffer/git/releases/download/0.3.2/git-phpcs.phar" + + - name: "Fetch head branch" + run: "git remote set-branches --add origin $GITHUB_BASE_REF && git fetch origin $GITHUB_BASE_REF" + + - name: "Run git-phpcs" + run: "php git-phpcs.phar origin/$GITHUB_BASE_REF...$GITHUB_SHA --report=checkstyle | cs2pr" diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml new file mode 100644 index 0000000000..2a2d4c951e --- /dev/null +++ b/.github/workflows/continuous-integration.yml @@ -0,0 +1,232 @@ +name: "Continuous Integration" + +on: + pull_request: + push: + +env: + fail-fast: true + +jobs: + phpunit-smoke-check: + name: "PHPUnit with SQLite" + runs-on: "ubuntu-20.04" + + strategy: + matrix: + php-version: + - "7.2" + - "7.3" + - "7.4" + deps: + - "normal" + include: + - deps: "low" + php-version: "7.3" + + steps: + - name: "Checkout" + uses: "actions/checkout@v2" + with: + fetch-depth: 2 + + - name: "Install PHP" + uses: "shivammathur/setup-php@v2" + with: + php-version: "${{ matrix.php-version }}" + extensions: "pdo, pdo_sqlite" + coverage: "pcov" + ini-values: "zend.assertions=1" + + - name: "Cache dependencies installed with composer" + uses: "actions/cache@v2" + with: + path: "~/.composer/cache" + key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}" + restore-keys: "php-${{ matrix.php-version }}-composer-locked-" + + - name: "Install dependencies with composer" + run: "composer update --no-interaction --no-progress --no-suggest" + if: "${{ matrix.deps == 'normal' }}" + + - name: "Install lowest possible dependencies with composer" + run: "composer update --no-interaction --no-progress --no-suggest --prefer-dist --prefer-lowest" + if: "${{ matrix.deps == 'low' }}" + + - name: "Run PHPUnit" + run: "vendor/bin/phpunit -c ci/github/phpunit/sqlite.xml" + env: + ENABLE_SECOND_LEVEL_CACHE: 0 + + - name: "Run PHPUnit with Second Level Cache" + run: "vendor/bin/phpunit -c ci/github/phpunit/sqlite.xml --exclude-group performance,non-cacheable,locking_functional" + env: + ENABLE_SECOND_LEVEL_CACHE: 1 + + phpunit-postgres: + name: "PHPUnit with PostgreSQL" + runs-on: "ubuntu-20.04" + needs: "phpunit-smoke-check" + + strategy: + matrix: + php-version: + - "7.4" + postgres-version: + - "9.6" + - "13" + + services: + postgres: + image: "postgres:${{ matrix.postgres-version }}" + env: + POSTGRES_PASSWORD: "postgres" + + options: >- + --health-cmd "pg_isready" + + ports: + - "5432:5432" + + steps: + - name: "Checkout" + uses: "actions/checkout@v2" + with: + fetch-depth: 2 + + - name: "Install PHP" + uses: "shivammathur/setup-php@v2" + with: + php-version: "${{ matrix.php-version }}" + coverage: "pcov" + ini-values: "zend.assertions=1" + + - name: "Cache dependencies installed with composer" + uses: "actions/cache@v2" + with: + path: "~/.composer/cache" + key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}" + restore-keys: "php-${{ matrix.php-version }}-composer-locked-" + + - name: "Install dependencies with composer" + run: "composer update --no-interaction --no-progress --no-suggest" + + - name: "Run PHPUnit" + run: "vendor/bin/phpunit -c ci/github/phpunit/pdo_pgsql.xml" + + phpunit-mariadb: + name: "PHPUnit with MariaDB" + runs-on: "ubuntu-20.04" + needs: "phpunit-smoke-check" + + strategy: + matrix: + php-version: + - "7.4" + mariadb-version: + - "10.5" + extension: + - "mysqli" + - "pdo_mysql" + + services: + mariadb: + image: "mariadb:${{ matrix.mariadb-version }}" + env: + MYSQL_ALLOW_EMPTY_PASSWORD: yes + MYSQL_DATABASE: "doctrine_tests" + + options: >- + --health-cmd "mysqladmin ping --silent" + + ports: + - "3306:3306" + + steps: + - name: "Checkout" + uses: "actions/checkout@v2" + with: + fetch-depth: 2 + + - name: "Install PHP" + uses: "shivammathur/setup-php@v2" + with: + php-version: "${{ matrix.php-version }}" + coverage: "pcov" + ini-values: "zend.assertions=1" + extensions: "${{ matrix.extension }}" + + - name: "Cache dependencies installed with composer" + uses: "actions/cache@v2" + with: + path: "~/.composer/cache" + key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}" + restore-keys: "php-${{ matrix.php-version }}-composer-locked-" + + - name: "Install dependencies with composer" + run: "composer update --no-interaction --no-progress --no-suggest" + + - name: "Run PHPUnit" + run: "vendor/bin/phpunit -c ci/github/phpunit/${{ matrix.extension }}.xml" + + phpunit-mysql: + name: "PHPUnit with MySQL" + runs-on: "ubuntu-20.04" + needs: "phpunit-smoke-check" + + strategy: + matrix: + php-version: + - "7.4" + mysql-version: + - "5.7" + - "8.0" + extension: + - "mysqli" + - "pdo_mysql" + + services: + mysql: + image: "mysql:${{ matrix.mysql-version }}" + + options: >- + --health-cmd "mysqladmin ping --silent" + -e MYSQL_ALLOW_EMPTY_PASSWORD=yes + -e MYSQL_DATABASE=doctrine_tests + + ports: + - "3306:3306" + + steps: + - name: "Checkout" + uses: "actions/checkout@v2" + with: + fetch-depth: 2 + + - name: "Install PHP" + uses: "shivammathur/setup-php@v2" + with: + php-version: "${{ matrix.php-version }}" + coverage: "pcov" + ini-values: "zend.assertions=1" + extensions: "${{ matrix.extension }}" + + - name: "Cache dependencies installed with composer" + uses: "actions/cache@v2" + with: + path: "~/.composer/cache" + key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}" + restore-keys: "php-${{ matrix.php-version }}-composer-locked-" + + - name: "Install dependencies with composer" + run: "composer update --no-interaction --no-progress --no-suggest" + + - name: "Run PHPUnit" + run: "vendor/bin/phpunit -c ci/github/phpunit/${{ matrix.extension }}.xml" + env: + ENABLE_SECOND_LEVEL_CACHE: 0 + + - name: "Run PHPUnit with Second Level Cache" + run: "vendor/bin/phpunit -c ci/github/phpunit/${{ matrix.extension }}.xml --exclude-group performance,non-cacheable,locking_functional" + env: + ENABLE_SECOND_LEVEL_CACHE: 1 diff --git a/.github/workflows/ci.yml b/.github/workflows/static-analysis.yml similarity index 53% rename from .github/workflows/ci.yml rename to .github/workflows/static-analysis.yml index 9ef8c7c246..8e170d7217 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/static-analysis.yml @@ -1,11 +1,11 @@ -name: CI +name: Static Analysis on: pull_request: jobs: static-analysis-phpstan: - name: "Static Analysis with PHPStan" + name: "PHPStan" runs-on: "ubuntu-latest" strategy: @@ -32,13 +32,13 @@ jobs: restore-keys: "php-${{ matrix.php-version }}-composer-locked-" - name: "Install dependencies with composer" - run: "composer install --no-progress --no-suggest --no-interaction --prefer-dist" + run: "composer update --no-progress --no-suggest --no-interaction --prefer-dist" - name: "Run a static analysis with phpstan/phpstan" run: "php vendor/bin/phpstan analyse --error-format=checkstyle | cs2pr" static-analysis-psalm: - name: "Static Analysis with Psalm" + name: "Psalm" runs-on: "ubuntu-latest" strategy: @@ -64,48 +64,7 @@ jobs: restore-keys: "php-${{ matrix.php-version }}-composer-locked-" - name: "Install dependencies with composer" - run: "composer install --no-interaction --no-progress --no-suggest" + run: "composer update --no-interaction --no-progress --no-suggest" - name: "Run a static analysis with vimeo/psalm" run: "vendor/bin/psalm --show-info=false --stats --output-format=github --threads=$(nproc)" - - coding-standards: - name: "Coding Standards" - runs-on: "ubuntu-latest" - - strategy: - matrix: - php-version: - - "7.4" - - steps: - - name: "Checkout" - uses: "actions/checkout@v2" - with: - fetch-depth: 10 - - - name: "Install PHP" - uses: "shivammathur/setup-php@v2" - with: - coverage: "none" - php-version: "${{ matrix.php-version }}" - tools: "cs2pr" - - - name: "Cache dependencies installed with composer" - uses: "actions/cache@v1" - with: - path: "~/.composer/cache" - key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}" - restore-keys: "php-${{ matrix.php-version }}-composer-locked-" - - - name: "Install dependencies with composer" - run: "composer install --no-interaction --no-progress --no-suggest" - - - name: "Install git-phpcs" - run: "wget https://github.com/diff-sniffer/git/releases/download/0.3.2/git-phpcs.phar" - - - name: "Fetch head branch" - run: "git remote set-branches --add origin $GITHUB_BASE_REF && git fetch origin $GITHUB_BASE_REF" - - - name: "Run git-phpcs" - run: "php git-phpcs.phar origin/$GITHUB_BASE_REF...$GITHUB_SHA --report=checkstyle | cs2pr" diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 30bafb39ee..0000000000 --- a/.travis.yml +++ /dev/null @@ -1,106 +0,0 @@ -dist: trusty -sudo: false -language: php - -php: - - 7.1 - - 7.2 - - 7.3 - - 7.4 - -env: - - DB=sqlite - - DB=mysql - - DB=pgsql - -before_install: - - mv ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini{,.disabled} || echo "xdebug not available" - - composer self-update - -install: travis_retry composer validate --strict && composer update --prefer-dist - -script: - - if [[ "$DB" == "mysql" || "$DB" == "mariadb" ]]; then mysql -e "CREATE SCHEMA doctrine_tests; GRANT ALL PRIVILEGES ON doctrine_tests.* to travis@'%'"; fi - - ENABLE_SECOND_LEVEL_CACHE=0 ./vendor/bin/phpunit -v -c tests/travis/$DB.travis.xml - - ENABLE_SECOND_LEVEL_CACHE=1 ./vendor/bin/phpunit -v -c tests/travis/$DB.travis.xml --exclude-group performance,non-cacheable,locking_functional - -jobs: - include: - - stage: Test - env: DB=mariadb - addons: - mariadb: 10.1 - - - stage: Test - dist: xenial - env: DB=mysql MYSQL_VERSION=5.7 - php: 7.1 - services: - - mysql - before_script: - - ./tests/travis/install-mysql-$MYSQL_VERSION.sh - sudo: required - - - stage: Test - dist: xenial - env: DB=mysql MYSQL_VERSION=5.7 - php: 7.2 - services: - - mysql - before_script: - - ./tests/travis/install-mysql-$MYSQL_VERSION.sh - sudo: required - - - stage: Test - dist: xenial - env: DB=mysql MYSQL_VERSION=5.7 - php: 7.4 - services: - - mysql - before_script: - - ./tests/travis/install-mysql-$MYSQL_VERSION.sh - sudo: required - - - stage: Test - env: DB=sqlite DEPENDENCIES=low - install: travis_retry composer update --prefer-dist --prefer-lowest - - - stage: Test - if: type = cron - php: 7.3 - env: DB=sqlite DEV_DEPENDENCIES - install: - - composer config minimum-stability dev - - travis_retry composer update --prefer-dist - - - stage: Test - env: DB=sqlite COVERAGE - before_script: - - mv ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini{.disabled,} - - if [[ ! $(php -m | grep -si xdebug) ]]; then echo "xdebug required for coverage"; exit 1; fi - script: - - ENABLE_SECOND_LEVEL_CACHE=0 ./vendor/bin/phpunit -v -c tests/travis/$DB.travis.xml --coverage-clover ./build/logs/clover.xml - after_success: - - bash <(curl -s https://codecov.io/bash) -f ./build/logs/clover.xml - - - stage: Code Quality - env: DB=none BENCHMARK - php: 7.4 - before_script: wget https://phpbench.github.io/phpbench/phpbench.phar https://phpbench.github.io/phpbench/phpbench.phar.pubkey - script: php phpbench.phar run -l dots --report=default - - - stage: Code Quality - if: NOT type = pull_request - env: DB=none CODING_STANDARDS - php: 7.4 - install: travis_retry composer install --prefer-dist - script: - - ./vendor/bin/phpcs - - allow_failures: - - stage: Code Quality - env: DB=none CODING_STANDARDS - -cache: - directories: - - $HOME/.composer/cache diff --git a/ci/github/phpunit/mysqli.xml b/ci/github/phpunit/mysqli.xml new file mode 100644 index 0000000000..00b367117f --- /dev/null +++ b/ci/github/phpunit/mysqli.xml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + ../../../tests + + + + + + ../../../lib/Doctrine + + + + + + performance + locking_functional + + + diff --git a/ci/github/phpunit/pdo_mysql.xml b/ci/github/phpunit/pdo_mysql.xml new file mode 100644 index 0000000000..bb4ac109d9 --- /dev/null +++ b/ci/github/phpunit/pdo_mysql.xml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + ../../../tests + + + + + + ../../../lib/Doctrine + + + + + + performance + locking_functional + + + diff --git a/ci/github/phpunit/pdo_pgsql.xml b/ci/github/phpunit/pdo_pgsql.xml new file mode 100644 index 0000000000..cfa5a7c543 --- /dev/null +++ b/ci/github/phpunit/pdo_pgsql.xml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + ../../../tests + + + + + + ../../../lib/Doctrine + + + + + + performance + locking_functional + + + diff --git a/ci/github/phpunit/sqlite.xml b/ci/github/phpunit/sqlite.xml new file mode 100644 index 0000000000..9fe6392112 --- /dev/null +++ b/ci/github/phpunit/sqlite.xml @@ -0,0 +1,33 @@ + + + + + + + + + + ../../../tests + + + + + + ../../../lib/Doctrine + + + + + + performance + locking_functional + + + diff --git a/composer.json b/composer.json index fc8e435886..5e0d9197a8 100644 --- a/composer.json +++ b/composer.json @@ -13,9 +13,6 @@ {"name": "Marco Pivetta", "email": "ocramius@gmail.com"} ], "config": { - "platform": { - "php": "7.1.3" - }, "sort-packages": true }, "require": { diff --git a/composer.lock b/composer.lock deleted file mode 100644 index f3e3abdced..0000000000 --- a/composer.lock +++ /dev/null @@ -1,4189 +0,0 @@ -{ - "_readme": [ - "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", - "This file is @generated automatically" - ], - "content-hash": "af1ac1c1f3d9f37caa71b6e5add59928", - "packages": [ - { - "name": "composer/package-versions-deprecated", - "version": "1.11.99", - "source": { - "type": "git", - "url": "https://github.com/composer/package-versions-deprecated.git", - "reference": "c8c9aa8a14cc3d3bec86d0a8c3fa52ea79936855" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/package-versions-deprecated/zipball/c8c9aa8a14cc3d3bec86d0a8c3fa52ea79936855", - "reference": "c8c9aa8a14cc3d3bec86d0a8c3fa52ea79936855", - "shasum": "" - }, - "require": { - "composer-plugin-api": "^1.1.0 || ^2.0", - "php": "^7 || ^8" - }, - "replace": { - "ocramius/package-versions": "1.11.99" - }, - "require-dev": { - "composer/composer": "^1.9.3 || ^2.0@dev", - "ext-zip": "^1.13", - "phpunit/phpunit": "^6.5 || ^7" - }, - "type": "composer-plugin", - "extra": { - "class": "PackageVersions\\Installer", - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "PackageVersions\\": "src/PackageVersions" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com" - }, - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be" - } - ], - "description": "Composer plugin that provides efficient querying for installed package versions (no runtime IO)", - "support": { - "issues": "https://github.com/composer/package-versions-deprecated/issues", - "source": "https://github.com/composer/package-versions-deprecated/tree/master" - }, - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://github.com/composer", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" - } - ], - "time": "2020-08-25T05:50:16+00:00" - }, - { - "name": "doctrine/annotations", - "version": "1.11.1", - "source": { - "type": "git", - "url": "https://github.com/doctrine/annotations.git", - "reference": "ce77a7ba1770462cd705a91a151b6c3746f9c6ad" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/annotations/zipball/ce77a7ba1770462cd705a91a151b6c3746f9c6ad", - "reference": "ce77a7ba1770462cd705a91a151b6c3746f9c6ad", - "shasum": "" - }, - "require": { - "doctrine/lexer": "1.*", - "ext-tokenizer": "*", - "php": "^7.1 || ^8.0" - }, - "require-dev": { - "doctrine/cache": "1.*", - "doctrine/coding-standard": "^6.0 || ^8.1", - "phpstan/phpstan": "^0.12.20", - "phpunit/phpunit": "^7.5 || ^9.1.5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.11.x-dev" - } - }, - "autoload": { - "psr-4": { - "Doctrine\\Common\\Annotations\\": "lib/Doctrine/Common/Annotations" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "description": "Docblock Annotations Parser", - "homepage": "https://www.doctrine-project.org/projects/annotations.html", - "keywords": [ - "annotations", - "docblock", - "parser" - ], - "support": { - "issues": "https://github.com/doctrine/annotations/issues", - "source": "https://github.com/doctrine/annotations/tree/1.11.1" - }, - "time": "2020-10-26T10:28:16+00:00" - }, - { - "name": "doctrine/cache", - "version": "1.10.2", - "source": { - "type": "git", - "url": "https://github.com/doctrine/cache.git", - "reference": "13e3381b25847283a91948d04640543941309727" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/cache/zipball/13e3381b25847283a91948d04640543941309727", - "reference": "13e3381b25847283a91948d04640543941309727", - "shasum": "" - }, - "require": { - "php": "~7.1 || ^8.0" - }, - "conflict": { - "doctrine/common": ">2.2,<2.4" - }, - "require-dev": { - "alcaeus/mongo-php-adapter": "^1.1", - "doctrine/coding-standard": "^6.0", - "mongodb/mongodb": "^1.1", - "phpunit/phpunit": "^7.0", - "predis/predis": "~1.0" - }, - "suggest": { - "alcaeus/mongo-php-adapter": "Required to use legacy MongoDB driver" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.9.x-dev" - } - }, - "autoload": { - "psr-4": { - "Doctrine\\Common\\Cache\\": "lib/Doctrine/Common/Cache" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "description": "PHP Doctrine Cache library is a popular cache implementation that supports many different drivers such as redis, memcache, apc, mongodb and others.", - "homepage": "https://www.doctrine-project.org/projects/cache.html", - "keywords": [ - "abstraction", - "apcu", - "cache", - "caching", - "couchdb", - "memcached", - "php", - "redis", - "xcache" - ], - "support": { - "issues": "https://github.com/doctrine/cache/issues", - "source": "https://github.com/doctrine/cache/tree/1.10.x" - }, - "funding": [ - { - "url": "https://www.doctrine-project.org/sponsorship.html", - "type": "custom" - }, - { - "url": "https://www.patreon.com/phpdoctrine", - "type": "patreon" - }, - { - "url": "https://tidelift.com/funding/github/packagist/doctrine%2Fcache", - "type": "tidelift" - } - ], - "time": "2020-07-07T18:54:01+00:00" - }, - { - "name": "doctrine/collections", - "version": "1.6.7", - "source": { - "type": "git", - "url": "https://github.com/doctrine/collections.git", - "reference": "55f8b799269a1a472457bd1a41b4f379d4cfba4a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/collections/zipball/55f8b799269a1a472457bd1a41b4f379d4cfba4a", - "reference": "55f8b799269a1a472457bd1a41b4f379d4cfba4a", - "shasum": "" - }, - "require": { - "php": "^7.1.3 || ^8.0" - }, - "require-dev": { - "doctrine/coding-standard": "^6.0", - "phpstan/phpstan-shim": "^0.9.2", - "phpunit/phpunit": "^7.0", - "vimeo/psalm": "^3.8.1" - }, - "type": "library", - "autoload": { - "psr-4": { - "Doctrine\\Common\\Collections\\": "lib/Doctrine/Common/Collections" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "description": "PHP Doctrine Collections library that adds additional functionality on top of PHP arrays.", - "homepage": "https://www.doctrine-project.org/projects/collections.html", - "keywords": [ - "array", - "collections", - "iterators", - "php" - ], - "support": { - "issues": "https://github.com/doctrine/collections/issues", - "source": "https://github.com/doctrine/collections/tree/1.6.7" - }, - "time": "2020-07-27T17:53:49+00:00" - }, - { - "name": "doctrine/common", - "version": "3.0.2", - "source": { - "type": "git", - "url": "https://github.com/doctrine/common.git", - "reference": "a3c6479858989e242a2465972b4f7a8642baf0d4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/common/zipball/a3c6479858989e242a2465972b4f7a8642baf0d4", - "reference": "a3c6479858989e242a2465972b4f7a8642baf0d4", - "shasum": "" - }, - "require": { - "doctrine/persistence": "^2.0", - "php": "^7.1 || ^8.0" - }, - "require-dev": { - "doctrine/coding-standard": "^1.0", - "phpstan/phpstan": "^0.11", - "phpstan/phpstan-phpunit": "^0.11", - "phpunit/phpunit": "^7.0", - "squizlabs/php_codesniffer": "^3.0", - "symfony/phpunit-bridge": "^4.0.5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Doctrine\\Common\\": "lib/Doctrine/Common" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" - }, - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com" - } - ], - "description": "PHP Doctrine Common project is a library that provides additional functionality that other Doctrine projects depend on such as better reflection support, persistence interfaces, proxies, event system and much more.", - "homepage": "https://www.doctrine-project.org/projects/common.html", - "keywords": [ - "common", - "doctrine", - "php" - ], - "support": { - "issues": "https://github.com/doctrine/common/issues", - "source": "https://github.com/doctrine/common/tree/3.0.2" - }, - "funding": [ - { - "url": "https://www.doctrine-project.org/sponsorship.html", - "type": "custom" - }, - { - "url": "https://www.patreon.com/phpdoctrine", - "type": "patreon" - }, - { - "url": "https://tidelift.com/funding/github/packagist/doctrine%2Fcommon", - "type": "tidelift" - } - ], - "time": "2020-06-05T16:59:53+00:00" - }, - { - "name": "doctrine/dbal", - "version": "v2.9.3", - "source": { - "type": "git", - "url": "https://github.com/doctrine/dbal.git", - "reference": "7345cd59edfa2036eb0fa4264b77ae2576842035" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/dbal/zipball/7345cd59edfa2036eb0fa4264b77ae2576842035", - "reference": "7345cd59edfa2036eb0fa4264b77ae2576842035", - "shasum": "" - }, - "require": { - "doctrine/cache": "^1.0", - "doctrine/event-manager": "^1.0", - "ext-pdo": "*", - "php": "^7.1" - }, - "require-dev": { - "doctrine/coding-standard": "^5.0", - "jetbrains/phpstorm-stubs": "^2018.1.2", - "phpstan/phpstan": "^0.10.1", - "phpunit/phpunit": "^7.4", - "symfony/console": "^2.0.5|^3.0|^4.0", - "symfony/phpunit-bridge": "^3.4.5|^4.0.5" - }, - "suggest": { - "symfony/console": "For helpful console commands such as SQL execution and import of files." - }, - "bin": [ - "bin/doctrine-dbal" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.9.x-dev", - "dev-develop": "3.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Doctrine\\DBAL\\": "lib/Doctrine/DBAL" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com" - } - ], - "description": "Powerful PHP database abstraction layer (DBAL) with many features for database schema introspection and management.", - "homepage": "https://www.doctrine-project.org/projects/dbal.html", - "keywords": [ - "abstraction", - "database", - "dbal", - "mysql", - "persistence", - "pgsql", - "php", - "queryobject" - ], - "support": { - "issues": "https://github.com/doctrine/dbal/issues", - "source": "https://github.com/doctrine/dbal/tree/2.9" - }, - "time": "2019-11-02T22:19:34+00:00" - }, - { - "name": "doctrine/event-manager", - "version": "1.1.1", - "source": { - "type": "git", - "url": "https://github.com/doctrine/event-manager.git", - "reference": "41370af6a30faa9dc0368c4a6814d596e81aba7f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/event-manager/zipball/41370af6a30faa9dc0368c4a6814d596e81aba7f", - "reference": "41370af6a30faa9dc0368c4a6814d596e81aba7f", - "shasum": "" - }, - "require": { - "php": "^7.1 || ^8.0" - }, - "conflict": { - "doctrine/common": "<2.9@dev" - }, - "require-dev": { - "doctrine/coding-standard": "^6.0", - "phpunit/phpunit": "^7.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Doctrine\\Common\\": "lib/Doctrine/Common" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" - }, - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com" - } - ], - "description": "The Doctrine Event Manager is a simple PHP event system that was built to be used with the various Doctrine projects.", - "homepage": "https://www.doctrine-project.org/projects/event-manager.html", - "keywords": [ - "event", - "event dispatcher", - "event manager", - "event system", - "events" - ], - "support": { - "issues": "https://github.com/doctrine/event-manager/issues", - "source": "https://github.com/doctrine/event-manager/tree/1.1.x" - }, - "funding": [ - { - "url": "https://www.doctrine-project.org/sponsorship.html", - "type": "custom" - }, - { - "url": "https://www.patreon.com/phpdoctrine", - "type": "patreon" - }, - { - "url": "https://tidelift.com/funding/github/packagist/doctrine%2Fevent-manager", - "type": "tidelift" - } - ], - "time": "2020-05-29T18:28:51+00:00" - }, - { - "name": "doctrine/inflector", - "version": "1.3.1", - "source": { - "type": "git", - "url": "https://github.com/doctrine/inflector.git", - "reference": "ec3a55242203ffa6a4b27c58176da97ff0a7aec1" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/inflector/zipball/ec3a55242203ffa6a4b27c58176da97ff0a7aec1", - "reference": "ec3a55242203ffa6a4b27c58176da97ff0a7aec1", - "shasum": "" - }, - "require": { - "php": "^7.1" - }, - "require-dev": { - "phpunit/phpunit": "^6.2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.3.x-dev" - } - }, - "autoload": { - "psr-4": { - "Doctrine\\Common\\Inflector\\": "lib/Doctrine/Common/Inflector" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "description": "Common String Manipulations with regard to casing and singular/plural rules.", - "homepage": "http://www.doctrine-project.org", - "keywords": [ - "inflection", - "pluralize", - "singularize", - "string" - ], - "support": { - "issues": "https://github.com/doctrine/inflector/issues", - "source": "https://github.com/doctrine/inflector/tree/1.3.1" - }, - "time": "2019-10-30T19:59:35+00:00" - }, - { - "name": "doctrine/instantiator", - "version": "1.3.1", - "source": { - "type": "git", - "url": "https://github.com/doctrine/instantiator.git", - "reference": "f350df0268e904597e3bd9c4685c53e0e333feea" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/f350df0268e904597e3bd9c4685c53e0e333feea", - "reference": "f350df0268e904597e3bd9c4685c53e0e333feea", - "shasum": "" - }, - "require": { - "php": "^7.1 || ^8.0" - }, - "require-dev": { - "doctrine/coding-standard": "^6.0", - "ext-pdo": "*", - "ext-phar": "*", - "phpbench/phpbench": "^0.13", - "phpstan/phpstan-phpunit": "^0.11", - "phpstan/phpstan-shim": "^0.11", - "phpunit/phpunit": "^7.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2.x-dev" - } - }, - "autoload": { - "psr-4": { - "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com", - "homepage": "http://ocramius.github.com/" - } - ], - "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", - "homepage": "https://www.doctrine-project.org/projects/instantiator.html", - "keywords": [ - "constructor", - "instantiate" - ], - "support": { - "issues": "https://github.com/doctrine/instantiator/issues", - "source": "https://github.com/doctrine/instantiator/tree/1.3.x" - }, - "funding": [ - { - "url": "https://www.doctrine-project.org/sponsorship.html", - "type": "custom" - }, - { - "url": "https://www.patreon.com/phpdoctrine", - "type": "patreon" - }, - { - "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator", - "type": "tidelift" - } - ], - "time": "2020-05-29T17:27:14+00:00" - }, - { - "name": "doctrine/lexer", - "version": "1.0.2", - "source": { - "type": "git", - "url": "https://github.com/doctrine/lexer.git", - "reference": "1febd6c3ef84253d7c815bed85fc622ad207a9f8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/lexer/zipball/1febd6c3ef84253d7c815bed85fc622ad207a9f8", - "reference": "1febd6c3ef84253d7c815bed85fc622ad207a9f8", - "shasum": "" - }, - "require": { - "php": ">=5.3.2" - }, - "require-dev": { - "phpunit/phpunit": "^4.5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Doctrine\\Common\\Lexer\\": "lib/Doctrine/Common/Lexer" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "description": "PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.", - "homepage": "https://www.doctrine-project.org/projects/lexer.html", - "keywords": [ - "annotations", - "docblock", - "lexer", - "parser", - "php" - ], - "support": { - "issues": "https://github.com/doctrine/lexer/issues", - "source": "https://github.com/doctrine/lexer/tree/1.0.2" - }, - "time": "2019-06-08T11:03:04+00:00" - }, - { - "name": "doctrine/persistence", - "version": "2.1.0", - "source": { - "type": "git", - "url": "https://github.com/doctrine/persistence.git", - "reference": "9899c16934053880876b920a3b8b02ed2337ac1d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/persistence/zipball/9899c16934053880876b920a3b8b02ed2337ac1d", - "reference": "9899c16934053880876b920a3b8b02ed2337ac1d", - "shasum": "" - }, - "require": { - "doctrine/annotations": "^1.0", - "doctrine/cache": "^1.0", - "doctrine/collections": "^1.0", - "doctrine/event-manager": "^1.0", - "php": "^7.1 || ^8.0" - }, - "conflict": { - "doctrine/common": "<2.10@dev" - }, - "require-dev": { - "composer/package-versions-deprecated": "^1.11", - "doctrine/coding-standard": "^6.0 || ^8.0", - "doctrine/common": "^3.0", - "phpstan/phpstan": "^0.12", - "phpunit/phpunit": "^7.5.20 || ^8.0 || ^9.0", - "vimeo/psalm": "^3.11" - }, - "type": "library", - "autoload": { - "psr-4": { - "Doctrine\\Common\\": "lib/Doctrine/Common", - "Doctrine\\Persistence\\": "lib/Doctrine/Persistence" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" - }, - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com" - } - ], - "description": "The Doctrine Persistence project is a set of shared interfaces and functionality that the different Doctrine object mappers share.", - "homepage": "https://doctrine-project.org/projects/persistence.html", - "keywords": [ - "mapper", - "object", - "odm", - "orm", - "persistence" - ], - "support": { - "issues": "https://github.com/doctrine/persistence/issues", - "source": "https://github.com/doctrine/persistence/tree/2.1.0" - }, - "time": "2020-10-24T22:13:54+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" - ], - "support": { - "issues": "https://github.com/php-fig/container/issues", - "source": "https://github.com/php-fig/container/tree/master" - }, - "time": "2017-02-14T16:28:37+00:00" - }, - { - "name": "symfony/console", - "version": "v4.4.16", - "source": { - "type": "git", - "url": "https://github.com/symfony/console.git", - "reference": "20f73dd143a5815d475e0838ff867bce1eebd9d5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/20f73dd143a5815d475e0838ff867bce1eebd9d5", - "reference": "20f73dd143a5815d475e0838ff867bce1eebd9d5", - "shasum": "" - }, - "require": { - "php": ">=7.1.3", - "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php73": "^1.8", - "symfony/polyfill-php80": "^1.15", - "symfony/service-contracts": "^1.1|^2" - }, - "conflict": { - "symfony/dependency-injection": "<3.4", - "symfony/event-dispatcher": "<4.3|>=5", - "symfony/lock": "<4.4", - "symfony/process": "<3.3" - }, - "provide": { - "psr/log-implementation": "1.0" - }, - "require-dev": { - "psr/log": "~1.0", - "symfony/config": "^3.4|^4.0|^5.0", - "symfony/dependency-injection": "^3.4|^4.0|^5.0", - "symfony/event-dispatcher": "^4.3", - "symfony/lock": "^4.4|^5.0", - "symfony/process": "^3.4|^4.0|^5.0", - "symfony/var-dumper": "^4.3|^5.0" - }, - "suggest": { - "psr/log": "For using the console logger", - "symfony/event-dispatcher": "", - "symfony/lock": "", - "symfony/process": "" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Console\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Console Component", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/console/tree/v4.4.16" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2020-10-24T11:50:19+00:00" - }, - { - "name": "symfony/polyfill-mbstring", - "version": "v1.20.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "39d483bdf39be819deabf04ec872eb0b2410b531" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/39d483bdf39be819deabf04ec872eb0b2410b531", - "reference": "39d483bdf39be819deabf04ec872eb0b2410b531", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "suggest": { - "ext-mbstring": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.20-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" - }, - "files": [ - "bootstrap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for the Mbstring extension", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "mbstring", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.20.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2020-10-23T14:02:19+00:00" - }, - { - "name": "symfony/polyfill-php73", - "version": "v1.20.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "8ff431c517be11c78c48a39a66d37431e26a6bed" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/8ff431c517be11c78c48a39a66d37431e26a6bed", - "reference": "8ff431c517be11c78c48a39a66d37431e26a6bed", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.20-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Php73\\": "" - }, - "files": [ - "bootstrap.php" - ], - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-php73/tree/v1.20.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2020-10-23T14:02:19+00:00" - }, - { - "name": "symfony/polyfill-php80", - "version": "v1.20.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "e70aa8b064c5b72d3df2abd5ab1e90464ad009de" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/e70aa8b064c5b72d3df2abd5ab1e90464ad009de", - "reference": "e70aa8b064c5b72d3df2abd5ab1e90464ad009de", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.20-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Php80\\": "" - }, - "files": [ - "bootstrap.php" - ], - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Ion Bazan", - "email": "ion.bazan@gmail.com" - }, - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.20.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2020-10-23T14:02:19+00:00" - }, - { - "name": "symfony/service-contracts", - "version": "v1.1.9", - "source": { - "type": "git", - "url": "https://github.com/symfony/service-contracts.git", - "reference": "b776d18b303a39f56c63747bcb977ad4b27aca26" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/b776d18b303a39f56c63747bcb977ad4b27aca26", - "reference": "b776d18b303a39f56c63747bcb977ad4b27aca26", - "shasum": "" - }, - "require": { - "php": ">=7.1.3", - "psr/container": "^1.0" - }, - "suggest": { - "symfony/service-implementation": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Contracts\\Service\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Generic abstractions related to writing services", - "homepage": "https://symfony.com", - "keywords": [ - "abstractions", - "contracts", - "decoupling", - "interfaces", - "interoperability", - "standards" - ], - "support": { - "source": "https://github.com/symfony/service-contracts/tree/v1.1.9" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2020-07-06T13:19:58+00:00" - } - ], - "packages-dev": [ - { - "name": "amphp/amp", - "version": "v2.5.0", - "source": { - "type": "git", - "url": "https://github.com/amphp/amp.git", - "reference": "f220a51458bf4dd0dedebb171ac3457813c72bbc" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/amphp/amp/zipball/f220a51458bf4dd0dedebb171ac3457813c72bbc", - "reference": "f220a51458bf4dd0dedebb171ac3457813c72bbc", - "shasum": "" - }, - "require": { - "php": ">=7" - }, - "require-dev": { - "amphp/php-cs-fixer-config": "dev-master", - "amphp/phpunit-util": "^1", - "ext-json": "*", - "jetbrains/phpstorm-stubs": "^2019.3", - "phpunit/phpunit": "^6.0.9 | ^7", - "psalm/phar": "^3.11@dev", - "react/promise": "^2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.x-dev" - } - }, - "autoload": { - "psr-4": { - "Amp\\": "lib" - }, - "files": [ - "lib/functions.php", - "lib/Internal/functions.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Daniel Lowrey", - "email": "rdlowrey@php.net" - }, - { - "name": "Aaron Piotrowski", - "email": "aaron@trowski.com" - }, - { - "name": "Bob Weinand", - "email": "bobwei9@hotmail.com" - }, - { - "name": "Niklas Keller", - "email": "me@kelunik.com" - } - ], - "description": "A non-blocking concurrency framework for PHP applications.", - "homepage": "http://amphp.org/amp", - "keywords": [ - "async", - "asynchronous", - "awaitable", - "concurrency", - "event", - "event-loop", - "future", - "non-blocking", - "promise" - ], - "support": { - "irc": "irc://irc.freenode.org/amphp", - "issues": "https://github.com/amphp/amp/issues", - "source": "https://github.com/amphp/amp/tree/master" - }, - "funding": [ - { - "url": "https://github.com/amphp", - "type": "github" - } - ], - "time": "2020-07-14T21:47:18+00:00" - }, - { - "name": "amphp/byte-stream", - "version": "v1.8.0", - "source": { - "type": "git", - "url": "https://github.com/amphp/byte-stream.git", - "reference": "f0c20cf598a958ba2aa8c6e5a71c697d652c7088" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/amphp/byte-stream/zipball/f0c20cf598a958ba2aa8c6e5a71c697d652c7088", - "reference": "f0c20cf598a958ba2aa8c6e5a71c697d652c7088", - "shasum": "" - }, - "require": { - "amphp/amp": "^2", - "php": ">=7.1" - }, - "require-dev": { - "amphp/php-cs-fixer-config": "dev-master", - "amphp/phpunit-util": "^1.4", - "friendsofphp/php-cs-fixer": "^2.3", - "jetbrains/phpstorm-stubs": "^2019.3", - "phpunit/phpunit": "^6 || ^7 || ^8", - "psalm/phar": "^3.11.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Amp\\ByteStream\\": "lib" - }, - "files": [ - "lib/functions.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Aaron Piotrowski", - "email": "aaron@trowski.com" - }, - { - "name": "Niklas Keller", - "email": "me@kelunik.com" - } - ], - "description": "A stream abstraction to make working with non-blocking I/O simple.", - "homepage": "http://amphp.org/byte-stream", - "keywords": [ - "amp", - "amphp", - "async", - "io", - "non-blocking", - "stream" - ], - "support": { - "irc": "irc://irc.freenode.org/amphp", - "issues": "https://github.com/amphp/byte-stream/issues", - "source": "https://github.com/amphp/byte-stream/tree/master" - }, - "time": "2020-06-29T18:35:05+00:00" - }, - { - "name": "composer/semver", - "version": "3.2.2", - "source": { - "type": "git", - "url": "https://github.com/composer/semver.git", - "reference": "4089fddb67bcf6bf860d91b979e95be303835002" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/4089fddb67bcf6bf860d91b979e95be303835002", - "reference": "4089fddb67bcf6bf860d91b979e95be303835002", - "shasum": "" - }, - "require": { - "php": "^5.3.2 || ^7.0 || ^8.0" - }, - "require-dev": { - "phpstan/phpstan": "^0.12.19", - "symfony/phpunit-bridge": "^4.2 || ^5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "3.x-dev" - } - }, - "autoload": { - "psr-4": { - "Composer\\Semver\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nils Adermann", - "email": "naderman@naderman.de", - "homepage": "http://www.naderman.de" - }, - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - }, - { - "name": "Rob Bast", - "email": "rob.bast@gmail.com", - "homepage": "http://robbast.nl" - } - ], - "description": "Semver library that offers utilities, version constraint parsing and validation.", - "keywords": [ - "semantic", - "semver", - "validation", - "versioning" - ], - "support": { - "irc": "irc://irc.freenode.org/composer", - "issues": "https://github.com/composer/semver/issues", - "source": "https://github.com/composer/semver/tree/3.2.2" - }, - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://github.com/composer", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" - } - ], - "time": "2020-10-14T08:51:15+00:00" - }, - { - "name": "composer/xdebug-handler", - "version": "1.4.4", - "source": { - "type": "git", - "url": "https://github.com/composer/xdebug-handler.git", - "reference": "6e076a124f7ee146f2487554a94b6a19a74887ba" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/6e076a124f7ee146f2487554a94b6a19a74887ba", - "reference": "6e076a124f7ee146f2487554a94b6a19a74887ba", - "shasum": "" - }, - "require": { - "php": "^5.3.2 || ^7.0 || ^8.0", - "psr/log": "^1.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || 6.5 - 8" - }, - "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" - ], - "support": { - "irc": "irc://irc.freenode.org/composer", - "issues": "https://github.com/composer/xdebug-handler/issues", - "source": "https://github.com/composer/xdebug-handler/tree/1.4.4" - }, - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://github.com/composer", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" - } - ], - "time": "2020-10-24T12:39:10+00:00" - }, - { - "name": "dealerdirect/phpcodesniffer-composer-installer", - "version": "v0.7.0", - "source": { - "type": "git", - "url": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer.git", - "reference": "e8d808670b8f882188368faaf1144448c169c0b7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Dealerdirect/phpcodesniffer-composer-installer/zipball/e8d808670b8f882188368faaf1144448c169c0b7", - "reference": "e8d808670b8f882188368faaf1144448c169c0b7", - "shasum": "" - }, - "require": { - "composer-plugin-api": "^1.0 || ^2.0", - "php": ">=5.3", - "squizlabs/php_codesniffer": "^2 || ^3 || 4.0.x-dev" - }, - "require-dev": { - "composer/composer": "*", - "phpcompatibility/php-compatibility": "^9.0", - "sensiolabs/security-checker": "^4.1.0" - }, - "type": "composer-plugin", - "extra": { - "class": "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin" - }, - "autoload": { - "psr-4": { - "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Franck Nijhof", - "email": "franck.nijhof@dealerdirect.com", - "homepage": "http://www.frenck.nl", - "role": "Developer / IT Manager" - } - ], - "description": "PHP_CodeSniffer Standards Composer Installer Plugin", - "homepage": "http://www.dealerdirect.com", - "keywords": [ - "PHPCodeSniffer", - "PHP_CodeSniffer", - "code quality", - "codesniffer", - "composer", - "installer", - "phpcs", - "plugin", - "qa", - "quality", - "standard", - "standards", - "style guide", - "stylecheck", - "tests" - ], - "support": { - "issues": "https://github.com/dealerdirect/phpcodesniffer-composer-installer/issues", - "source": "https://github.com/dealerdirect/phpcodesniffer-composer-installer" - }, - "time": "2020-06-25T14:57:39+00:00" - }, - { - "name": "dnoegel/php-xdg-base-dir", - "version": "v0.1.1", - "source": { - "type": "git", - "url": "https://github.com/dnoegel/php-xdg-base-dir.git", - "reference": "8f8a6e48c5ecb0f991c2fdcf5f154a47d85f9ffd" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/dnoegel/php-xdg-base-dir/zipball/8f8a6e48c5ecb0f991c2fdcf5f154a47d85f9ffd", - "reference": "8f8a6e48c5ecb0f991c2fdcf5f154a47d85f9ffd", - "shasum": "" - }, - "require": { - "php": ">=5.3.2" - }, - "require-dev": { - "phpunit/phpunit": "~7.0|~6.0|~5.0|~4.8.35" - }, - "type": "library", - "autoload": { - "psr-4": { - "XdgBaseDir\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "implementation of xdg base directory specification for php", - "support": { - "issues": "https://github.com/dnoegel/php-xdg-base-dir/issues", - "source": "https://github.com/dnoegel/php-xdg-base-dir/tree/v0.1.1" - }, - "time": "2019-12-04T15:06:13+00:00" - }, - { - "name": "doctrine/coding-standard", - "version": "6.0.1", - "source": { - "type": "git", - "url": "https://github.com/doctrine/coding-standard.git", - "reference": "0639b3814c4e59986a0f6b277d1c7e15ed04e28d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/coding-standard/zipball/0639b3814c4e59986a0f6b277d1c7e15ed04e28d", - "reference": "0639b3814c4e59986a0f6b277d1c7e15ed04e28d", - "shasum": "" - }, - "require": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.5.0 | ^0.6.2 | ^0.7", - "php": "^7.1", - "slevomat/coding-standard": "^5.0", - "squizlabs/php_codesniffer": "^3.4.0" - }, - "type": "phpcodesniffer-standard", - "extra": { - "branch-alias": { - "dev-master": "6.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Doctrine\\Sniffs\\": "lib/Doctrine/Sniffs" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Steve Müller", - "email": "st.mueller@dzh-online.de" - } - ], - "description": "The Doctrine Coding Standard is a set of PHPCS rules applied to all Doctrine projects.", - "homepage": "https://www.doctrine-project.org/projects/coding-standard.html", - "keywords": [ - "checks", - "code", - "coding", - "cs", - "doctrine", - "rules", - "sniffer", - "sniffs", - "standard", - "style" - ], - "support": { - "issues": "https://github.com/doctrine/coding-standard/issues", - "source": "https://github.com/doctrine/coding-standard/tree/6.0.1" - }, - "time": "2020-10-25T17:26:29+00:00" - }, - { - "name": "felixfbecker/advanced-json-rpc", - "version": "v3.1.1", - "source": { - "type": "git", - "url": "https://github.com/felixfbecker/php-advanced-json-rpc.git", - "reference": "0ed363f8de17d284d479ec813c9ad3f6834b5c40" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/felixfbecker/php-advanced-json-rpc/zipball/0ed363f8de17d284d479ec813c9ad3f6834b5c40", - "reference": "0ed363f8de17d284d479ec813c9ad3f6834b5c40", - "shasum": "" - }, - "require": { - "netresearch/jsonmapper": "^1.0 || ^2.0", - "php": ">=7.0", - "phpdocumentor/reflection-docblock": "^4.0.0 || ^5.0.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.0.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "AdvancedJsonRpc\\": "lib/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "ISC" - ], - "authors": [ - { - "name": "Felix Becker", - "email": "felix.b@outlook.com" - } - ], - "description": "A more advanced JSONRPC implementation", - "support": { - "issues": "https://github.com/felixfbecker/php-advanced-json-rpc/issues", - "source": "https://github.com/felixfbecker/php-advanced-json-rpc/tree/master" - }, - "time": "2020-03-11T15:21:41+00:00" - }, - { - "name": "felixfbecker/language-server-protocol", - "version": "v1.5.0", - "source": { - "type": "git", - "url": "https://github.com/felixfbecker/php-language-server-protocol.git", - "reference": "85e83cacd2ed573238678c6875f8f0d7ec699541" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/felixfbecker/php-language-server-protocol/zipball/85e83cacd2ed573238678c6875f8f0d7ec699541", - "reference": "85e83cacd2ed573238678c6875f8f0d7ec699541", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "require-dev": { - "phpstan/phpstan": "*", - "squizlabs/php_codesniffer": "^3.1", - "vimeo/psalm": "^4.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "LanguageServerProtocol\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "ISC" - ], - "authors": [ - { - "name": "Felix Becker", - "email": "felix.b@outlook.com" - } - ], - "description": "PHP classes for the Language Server Protocol", - "keywords": [ - "language", - "microsoft", - "php", - "server" - ], - "support": { - "issues": "https://github.com/felixfbecker/php-language-server-protocol/issues", - "source": "https://github.com/felixfbecker/php-language-server-protocol/tree/v1.5.0" - }, - "time": "2020-10-23T13:55:30+00:00" - }, - { - "name": "myclabs/deep-copy", - "version": "1.10.1", - "source": { - "type": "git", - "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "969b211f9a51aa1f6c01d1d2aef56d3bd91598e5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/969b211f9a51aa1f6c01d1d2aef56d3bd91598e5", - "reference": "969b211f9a51aa1f6c01d1d2aef56d3bd91598e5", - "shasum": "" - }, - "require": { - "php": "^7.1 || ^8.0" - }, - "replace": { - "myclabs/deep-copy": "self.version" - }, - "require-dev": { - "doctrine/collections": "^1.0", - "doctrine/common": "^2.6", - "phpunit/phpunit": "^7.1" - }, - "type": "library", - "autoload": { - "psr-4": { - "DeepCopy\\": "src/DeepCopy/" - }, - "files": [ - "src/DeepCopy/deep_copy.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Create deep copies (clones) of your objects", - "keywords": [ - "clone", - "copy", - "duplicate", - "object", - "object graph" - ], - "support": { - "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.x" - }, - "funding": [ - { - "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", - "type": "tidelift" - } - ], - "time": "2020-06-29T13:22:24+00:00" - }, - { - "name": "netresearch/jsonmapper", - "version": "v2.1.0", - "source": { - "type": "git", - "url": "https://github.com/cweiske/jsonmapper.git", - "reference": "e0f1e33a71587aca81be5cffbb9746510e1fe04e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/cweiske/jsonmapper/zipball/e0f1e33a71587aca81be5cffbb9746510e1fe04e", - "reference": "e0f1e33a71587aca81be5cffbb9746510e1fe04e", - "shasum": "" - }, - "require": { - "ext-json": "*", - "ext-pcre": "*", - "ext-reflection": "*", - "ext-spl": "*", - "php": ">=5.6" - }, - "require-dev": { - "phpunit/phpunit": "~4.8.35 || ~5.7 || ~6.4 || ~7.0", - "squizlabs/php_codesniffer": "~3.5" - }, - "type": "library", - "autoload": { - "psr-0": { - "JsonMapper": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "OSL-3.0" - ], - "authors": [ - { - "name": "Christian Weiske", - "email": "cweiske@cweiske.de", - "homepage": "http://github.com/cweiske/jsonmapper/", - "role": "Developer" - } - ], - "description": "Map nested JSON structures onto PHP classes", - "support": { - "email": "cweiske@cweiske.de", - "issues": "https://github.com/cweiske/jsonmapper/issues", - "source": "https://github.com/cweiske/jsonmapper/tree/master" - }, - "time": "2020-04-16T18:48:43+00:00" - }, - { - "name": "nikic/php-parser", - "version": "v4.10.2", - "source": { - "type": "git", - "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "658f1be311a230e0907f5dfe0213742aff0596de" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/658f1be311a230e0907f5dfe0213742aff0596de", - "reference": "658f1be311a230e0907f5dfe0213742aff0596de", - "shasum": "" - }, - "require": { - "ext-tokenizer": "*", - "php": ">=7.0" - }, - "require-dev": { - "ircmaxell/php-yacc": "^0.0.7", - "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0" - }, - "bin": [ - "bin/php-parse" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.9-dev" - } - }, - "autoload": { - "psr-4": { - "PhpParser\\": "lib/PhpParser" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Nikita Popov" - } - ], - "description": "A PHP parser written in PHP", - "keywords": [ - "parser", - "php" - ], - "support": { - "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.10.2" - }, - "time": "2020-09-26T10:30:38+00:00" - }, - { - "name": "openlss/lib-array2xml", - "version": "1.0.0", - "source": { - "type": "git", - "url": "https://github.com/nullivex/lib-array2xml.git", - "reference": "a91f18a8dfc69ffabe5f9b068bc39bb202c81d90" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nullivex/lib-array2xml/zipball/a91f18a8dfc69ffabe5f9b068bc39bb202c81d90", - "reference": "a91f18a8dfc69ffabe5f9b068bc39bb202c81d90", - "shasum": "" - }, - "require": { - "php": ">=5.3.2" - }, - "type": "library", - "autoload": { - "psr-0": { - "LSS": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Apache-2.0" - ], - "authors": [ - { - "name": "Bryan Tong", - "email": "bryan@nullivex.com", - "homepage": "https://www.nullivex.com" - }, - { - "name": "Tony Butler", - "email": "spudz76@gmail.com", - "homepage": "https://www.nullivex.com" - } - ], - "description": "Array2XML conversion library credit to lalit.org", - "homepage": "https://www.nullivex.com", - "keywords": [ - "array", - "array conversion", - "xml", - "xml conversion" - ], - "support": { - "issues": "https://github.com/nullivex/lib-array2xml/issues", - "source": "https://github.com/nullivex/lib-array2xml/tree/master" - }, - "time": "2019-03-29T20:06:56+00:00" - }, - { - "name": "phar-io/manifest", - "version": "1.0.3", - "source": { - "type": "git", - "url": "https://github.com/phar-io/manifest.git", - "reference": "7761fcacf03b4d4f16e7ccb606d4879ca431fcf4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phar-io/manifest/zipball/7761fcacf03b4d4f16e7ccb606d4879ca431fcf4", - "reference": "7761fcacf03b4d4f16e7ccb606d4879ca431fcf4", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-phar": "*", - "phar-io/version": "^2.0", - "php": "^5.6 || ^7.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" - }, - { - "name": "Sebastian Heuer", - "email": "sebastian@phpeople.de", - "role": "Developer" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "Developer" - } - ], - "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", - "support": { - "issues": "https://github.com/phar-io/manifest/issues", - "source": "https://github.com/phar-io/manifest/tree/master" - }, - "time": "2018-07-08T19:23:20+00:00" - }, - { - "name": "phar-io/version", - "version": "2.0.1", - "source": { - "type": "git", - "url": "https://github.com/phar-io/version.git", - "reference": "45a2ec53a73c70ce41d55cedef9063630abaf1b6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phar-io/version/zipball/45a2ec53a73c70ce41d55cedef9063630abaf1b6", - "reference": "45a2ec53a73c70ce41d55cedef9063630abaf1b6", - "shasum": "" - }, - "require": { - "php": "^5.6 || ^7.0" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" - }, - { - "name": "Sebastian Heuer", - "email": "sebastian@phpeople.de", - "role": "Developer" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "Developer" - } - ], - "description": "Library for handling version information and constraints", - "support": { - "issues": "https://github.com/phar-io/version/issues", - "source": "https://github.com/phar-io/version/tree/master" - }, - "time": "2018-07-08T19:19:57+00:00" - }, - { - "name": "phpdocumentor/reflection-common", - "version": "2.1.0", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionCommon.git", - "reference": "6568f4687e5b41b054365f9ae03fcb1ed5f2069b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/6568f4687e5b41b054365f9ae03fcb1ed5f2069b", - "reference": "6568f4687e5b41b054365f9ae03fcb1ed5f2069b", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jaap van Otterdijk", - "email": "opensource@ijaap.nl" - } - ], - "description": "Common reflection classes used by phpdocumentor to reflect the code structure", - "homepage": "http://www.phpdoc.org", - "keywords": [ - "FQSEN", - "phpDocumentor", - "phpdoc", - "reflection", - "static analysis" - ], - "support": { - "issues": "https://github.com/phpDocumentor/ReflectionCommon/issues", - "source": "https://github.com/phpDocumentor/ReflectionCommon/tree/master" - }, - "time": "2020-04-27T09:25:28+00:00" - }, - { - "name": "phpdocumentor/reflection-docblock", - "version": "4.3.4", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "da3fd972d6bafd628114f7e7e036f45944b62e9c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/da3fd972d6bafd628114f7e7e036f45944b62e9c", - "reference": "da3fd972d6bafd628114f7e7e036f45944b62e9c", - "shasum": "" - }, - "require": { - "php": "^7.0", - "phpdocumentor/reflection-common": "^1.0.0 || ^2.0.0", - "phpdocumentor/type-resolver": "~0.4 || ^1.0.0", - "webmozart/assert": "^1.0" - }, - "require-dev": { - "doctrine/instantiator": "^1.0.5", - "mockery/mockery": "^1.0", - "phpdocumentor/type-resolver": "0.4.*", - "phpunit/phpunit": "^6.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": [ - "src/" - ] - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" - } - ], - "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "support": { - "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", - "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/release/4.x" - }, - "time": "2019-12-28T18:55:12+00:00" - }, - { - "name": "phpdocumentor/type-resolver", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "2e32a6d48972b2c1976ed5d8967145b6cec4a4a9" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/2e32a6d48972b2c1976ed5d8967145b6cec4a4a9", - "reference": "2e32a6d48972b2c1976ed5d8967145b6cec4a4a9", - "shasum": "" - }, - "require": { - "php": "^7.1", - "phpdocumentor/reflection-common": "^2.0" - }, - "require-dev": { - "ext-tokenizer": "^7.1", - "mockery/mockery": "~1", - "phpunit/phpunit": "^7.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" - } - ], - "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", - "support": { - "issues": "https://github.com/phpDocumentor/TypeResolver/issues", - "source": "https://github.com/phpDocumentor/TypeResolver/tree/0.7.2" - }, - "time": "2019-08-22T18:11:29+00:00" - }, - { - "name": "phpspec/prophecy", - "version": "v1.10.3", - "source": { - "type": "git", - "url": "https://github.com/phpspec/prophecy.git", - "reference": "451c3cd1418cf640de218914901e51b064abb093" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/451c3cd1418cf640de218914901e51b064abb093", - "reference": "451c3cd1418cf640de218914901e51b064abb093", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.0.2", - "php": "^5.3|^7.0", - "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0|^5.0", - "sebastian/comparator": "^1.2.3|^2.0|^3.0|^4.0", - "sebastian/recursion-context": "^1.0|^2.0|^3.0|^4.0" - }, - "require-dev": { - "phpspec/phpspec": "^2.5 || ^3.2", - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.10.x-dev" - } - }, - "autoload": { - "psr-4": { - "Prophecy\\": "src/Prophecy" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - }, - { - "name": "Marcello Duarte", - "email": "marcello.duarte@gmail.com" - } - ], - "description": "Highly opinionated mocking framework for PHP 5.3+", - "homepage": "https://github.com/phpspec/prophecy", - "keywords": [ - "Double", - "Dummy", - "fake", - "mock", - "spy", - "stub" - ], - "support": { - "issues": "https://github.com/phpspec/prophecy/issues", - "source": "https://github.com/phpspec/prophecy/tree/v1.10.3" - }, - "time": "2020-03-05T15:02:03+00:00" - }, - { - "name": "phpstan/phpdoc-parser", - "version": "0.3.5", - "source": { - "type": "git", - "url": "https://github.com/phpstan/phpdoc-parser.git", - "reference": "8c4ef2aefd9788238897b678a985e1d5c8df6db4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/8c4ef2aefd9788238897b678a985e1d5c8df6db4", - "reference": "8c4ef2aefd9788238897b678a985e1d5c8df6db4", - "shasum": "" - }, - "require": { - "php": "~7.1" - }, - "require-dev": { - "consistence/coding-standard": "^3.5", - "jakub-onderka/php-parallel-lint": "^0.9.2", - "phing/phing": "^2.16.0", - "phpstan/phpstan": "^0.10", - "phpunit/phpunit": "^6.3", - "slevomat/coding-standard": "^4.7.2", - "squizlabs/php_codesniffer": "^3.3.2", - "symfony/process": "^3.4 || ^4.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "0.3-dev" - } - }, - "autoload": { - "psr-4": { - "PHPStan\\PhpDocParser\\": [ - "src/" - ] - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "PHPDoc parser with support for nullable, intersection and generic types", - "support": { - "issues": "https://github.com/phpstan/phpdoc-parser/issues", - "source": "https://github.com/phpstan/phpdoc-parser/tree/master" - }, - "time": "2019-06-07T19:13:52+00:00" - }, - { - "name": "phpstan/phpstan", - "version": "0.12.52", - "source": { - "type": "git", - "url": "https://github.com/phpstan/phpstan.git", - "reference": "e96dd5e7ae9aefed663bc7e285ad96792b67eadc" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/e96dd5e7ae9aefed663bc7e285ad96792b67eadc", - "reference": "e96dd5e7ae9aefed663bc7e285ad96792b67eadc", - "shasum": "" - }, - "require": { - "php": "^7.1|^8.0" - }, - "conflict": { - "phpstan/phpstan-shim": "*" - }, - "bin": [ - "phpstan", - "phpstan.phar" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "0.12-dev" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "PHPStan - PHP Static Analysis Tool", - "support": { - "issues": "https://github.com/phpstan/phpstan/issues", - "source": "https://github.com/phpstan/phpstan/tree/0.12.52" - }, - "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-10-25T07:23:44+00:00" - }, - { - "name": "phpunit/php-code-coverage", - "version": "6.1.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "807e6013b00af69b6c5d9ceb4282d0393dbb9d8d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/807e6013b00af69b6c5d9ceb4282d0393dbb9d8d", - "reference": "807e6013b00af69b6c5d9ceb4282d0393dbb9d8d", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-xmlwriter": "*", - "php": "^7.1", - "phpunit/php-file-iterator": "^2.0", - "phpunit/php-text-template": "^1.2.1", - "phpunit/php-token-stream": "^3.0", - "sebastian/code-unit-reverse-lookup": "^1.0.1", - "sebastian/environment": "^3.1 || ^4.0", - "sebastian/version": "^2.0.1", - "theseer/tokenizer": "^1.1" - }, - "require-dev": { - "phpunit/phpunit": "^7.0" - }, - "suggest": { - "ext-xdebug": "^2.6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "6.1-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", - "homepage": "https://github.com/sebastianbergmann/php-code-coverage", - "keywords": [ - "coverage", - "testing", - "xunit" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/master" - }, - "time": "2018-10-31T16:06:48+00:00" - }, - { - "name": "phpunit/php-file-iterator", - "version": "2.0.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "050bedf145a257b1ff02746c31894800e5122946" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/050bedf145a257b1ff02746c31894800e5122946", - "reference": "050bedf145a257b1ff02746c31894800e5122946", - "shasum": "" - }, - "require": { - "php": "^7.1" - }, - "require-dev": { - "phpunit/phpunit": "^7.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "FilterIterator implementation that filters files based on a list of suffixes.", - "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", - "keywords": [ - "filesystem", - "iterator" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", - "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/2.0.2" - }, - "time": "2018-09-13T20:33:42+00:00" - }, - { - "name": "phpunit/php-text-template", - "version": "1.2.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Simple template engine.", - "homepage": "https://github.com/sebastianbergmann/php-text-template/", - "keywords": [ - "template" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-text-template/issues", - "source": "https://github.com/sebastianbergmann/php-text-template/tree/1.2.1" - }, - "time": "2015-06-21T13:50:34+00:00" - }, - { - "name": "phpunit/php-timer", - "version": "2.1.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "1038454804406b0b5f5f520358e78c1c2f71501e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/1038454804406b0b5f5f520358e78c1c2f71501e", - "reference": "1038454804406b0b5f5f520358e78c1c2f71501e", - "shasum": "" - }, - "require": { - "php": "^7.1" - }, - "require-dev": { - "phpunit/phpunit": "^7.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.1-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Utility class for timing", - "homepage": "https://github.com/sebastianbergmann/php-timer/", - "keywords": [ - "timer" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-timer/issues", - "source": "https://github.com/sebastianbergmann/php-timer/tree/master" - }, - "time": "2019-06-07T04:22:29+00:00" - }, - { - "name": "phpunit/php-token-stream", - "version": "3.1.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "995192df77f63a59e47f025390d2d1fdf8f425ff" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/995192df77f63a59e47f025390d2d1fdf8f425ff", - "reference": "995192df77f63a59e47f025390d2d1fdf8f425ff", - "shasum": "" - }, - "require": { - "ext-tokenizer": "*", - "php": "^7.1" - }, - "require-dev": { - "phpunit/phpunit": "^7.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.1-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Wrapper around PHP's tokenizer extension.", - "homepage": "https://github.com/sebastianbergmann/php-token-stream/", - "keywords": [ - "tokenizer" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-token-stream/issues", - "source": "https://github.com/sebastianbergmann/php-token-stream/tree/3.1.1" - }, - "abandoned": true, - "time": "2019-09-17T06:23:10+00:00" - }, - { - "name": "phpunit/phpunit", - "version": "7.5.20", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "9467db479d1b0487c99733bb1e7944d32deded2c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/9467db479d1b0487c99733bb1e7944d32deded2c", - "reference": "9467db479d1b0487c99733bb1e7944d32deded2c", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.1", - "ext-dom": "*", - "ext-json": "*", - "ext-libxml": "*", - "ext-mbstring": "*", - "ext-xml": "*", - "myclabs/deep-copy": "^1.7", - "phar-io/manifest": "^1.0.2", - "phar-io/version": "^2.0", - "php": "^7.1", - "phpspec/prophecy": "^1.7", - "phpunit/php-code-coverage": "^6.0.7", - "phpunit/php-file-iterator": "^2.0.1", - "phpunit/php-text-template": "^1.2.1", - "phpunit/php-timer": "^2.1", - "sebastian/comparator": "^3.0", - "sebastian/diff": "^3.0", - "sebastian/environment": "^4.0", - "sebastian/exporter": "^3.1", - "sebastian/global-state": "^2.0", - "sebastian/object-enumerator": "^3.0.3", - "sebastian/resource-operations": "^2.0", - "sebastian/version": "^2.0.1" - }, - "conflict": { - "phpunit/phpunit-mock-objects": "*" - }, - "require-dev": { - "ext-pdo": "*" - }, - "suggest": { - "ext-soap": "*", - "ext-xdebug": "*", - "phpunit/php-invoker": "^2.0" - }, - "bin": [ - "phpunit" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "7.5-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "The PHP Unit Testing framework.", - "homepage": "https://phpunit.de/", - "keywords": [ - "phpunit", - "testing", - "xunit" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/7.5.20" - }, - "time": "2020-01-08T08:45:45+00:00" - }, - { - "name": "psr/log", - "version": "1.1.3", - "source": { - "type": "git", - "url": "https://github.com/php-fig/log.git", - "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/0f73288fd15629204f9d42b7055f72dacbe811fc", - "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Log\\": "Psr/Log/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common interface for logging libraries", - "homepage": "https://github.com/php-fig/log", - "keywords": [ - "log", - "psr", - "psr-3" - ], - "support": { - "source": "https://github.com/php-fig/log/tree/1.1.3" - }, - "time": "2020-03-23T09:12:05+00:00" - }, - { - "name": "sebastian/code-unit-reverse-lookup", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", - "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", - "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", - "shasum": "" - }, - "require": { - "php": "^5.6 || ^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^5.7 || ^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Looks up which function or method a line of code belongs to", - "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", - "support": { - "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", - "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/master" - }, - "time": "2017-03-04T06:30:41+00:00" - }, - { - "name": "sebastian/comparator", - "version": "3.0.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "5de4fc177adf9bce8df98d8d141a7559d7ccf6da" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/5de4fc177adf9bce8df98d8d141a7559d7ccf6da", - "reference": "5de4fc177adf9bce8df98d8d141a7559d7ccf6da", - "shasum": "" - }, - "require": { - "php": "^7.1", - "sebastian/diff": "^3.0", - "sebastian/exporter": "^3.1" - }, - "require-dev": { - "phpunit/phpunit": "^7.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides the functionality to compare PHP values for equality", - "homepage": "https://github.com/sebastianbergmann/comparator", - "keywords": [ - "comparator", - "compare", - "equality" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/comparator/issues", - "source": "https://github.com/sebastianbergmann/comparator/tree/master" - }, - "time": "2018-07-12T15:12:46+00:00" - }, - { - "name": "sebastian/diff", - "version": "3.0.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "720fcc7e9b5cf384ea68d9d930d480907a0c1a29" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/720fcc7e9b5cf384ea68d9d930d480907a0c1a29", - "reference": "720fcc7e9b5cf384ea68d9d930d480907a0c1a29", - "shasum": "" - }, - "require": { - "php": "^7.1" - }, - "require-dev": { - "phpunit/phpunit": "^7.5 || ^8.0", - "symfony/process": "^2 || ^3.3 || ^4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Kore Nordmann", - "email": "mail@kore-nordmann.de" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Diff implementation", - "homepage": "https://github.com/sebastianbergmann/diff", - "keywords": [ - "diff", - "udiff", - "unidiff", - "unified diff" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/diff/issues", - "source": "https://github.com/sebastianbergmann/diff/tree/master" - }, - "time": "2019-02-04T06:01:07+00:00" - }, - { - "name": "sebastian/environment", - "version": "4.2.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "464c90d7bdf5ad4e8a6aea15c091fec0603d4368" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/464c90d7bdf5ad4e8a6aea15c091fec0603d4368", - "reference": "464c90d7bdf5ad4e8a6aea15c091fec0603d4368", - "shasum": "" - }, - "require": { - "php": "^7.1" - }, - "require-dev": { - "phpunit/phpunit": "^7.5" - }, - "suggest": { - "ext-posix": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.2-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides functionality to handle HHVM/PHP environments", - "homepage": "http://www.github.com/sebastianbergmann/environment", - "keywords": [ - "Xdebug", - "environment", - "hhvm" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/environment/issues", - "source": "https://github.com/sebastianbergmann/environment/tree/4.2.3" - }, - "time": "2019-11-20T08:46:58+00:00" - }, - { - "name": "sebastian/exporter", - "version": "3.1.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "68609e1261d215ea5b21b7987539cbfbe156ec3e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/68609e1261d215ea5b21b7987539cbfbe156ec3e", - "reference": "68609e1261d215ea5b21b7987539cbfbe156ec3e", - "shasum": "" - }, - "require": { - "php": "^7.0", - "sebastian/recursion-context": "^3.0" - }, - "require-dev": { - "ext-mbstring": "*", - "phpunit/phpunit": "^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.1.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" - } - ], - "description": "Provides the functionality to export PHP variables for visualization", - "homepage": "http://www.github.com/sebastianbergmann/exporter", - "keywords": [ - "export", - "exporter" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/exporter/issues", - "source": "https://github.com/sebastianbergmann/exporter/tree/master" - }, - "time": "2019-09-14T09:02:43+00:00" - }, - { - "name": "sebastian/global-state", - "version": "2.0.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", - "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", - "shasum": "" - }, - "require": { - "php": "^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.0" - }, - "suggest": { - "ext-uopz": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Snapshotting of global state", - "homepage": "http://www.github.com/sebastianbergmann/global-state", - "keywords": [ - "global state" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/global-state/issues", - "source": "https://github.com/sebastianbergmann/global-state/tree/2.0.0" - }, - "time": "2017-04-27T15:39:26+00:00" - }, - { - "name": "sebastian/object-enumerator", - "version": "3.0.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/7cfd9e65d11ffb5af41198476395774d4c8a84c5", - "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5", - "shasum": "" - }, - "require": { - "php": "^7.0", - "sebastian/object-reflector": "^1.1.1", - "sebastian/recursion-context": "^3.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Traverses array structures and object graphs to enumerate all referenced objects", - "homepage": "https://github.com/sebastianbergmann/object-enumerator/", - "support": { - "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", - "source": "https://github.com/sebastianbergmann/object-enumerator/tree/master" - }, - "time": "2017-08-03T12:35:26+00:00" - }, - { - "name": "sebastian/object-reflector", - "version": "1.1.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/object-reflector.git", - "reference": "773f97c67f28de00d397be301821b06708fca0be" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/773f97c67f28de00d397be301821b06708fca0be", - "reference": "773f97c67f28de00d397be301821b06708fca0be", - "shasum": "" - }, - "require": { - "php": "^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Allows reflection of object attributes, including inherited and non-public ones", - "homepage": "https://github.com/sebastianbergmann/object-reflector/", - "support": { - "issues": "https://github.com/sebastianbergmann/object-reflector/issues", - "source": "https://github.com/sebastianbergmann/object-reflector/tree/master" - }, - "time": "2017-03-29T09:07:27+00:00" - }, - { - "name": "sebastian/recursion-context", - "version": "3.0.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", - "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", - "shasum": "" - }, - "require": { - "php": "^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net" - } - ], - "description": "Provides functionality to recursively process PHP variables", - "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "support": { - "issues": "https://github.com/sebastianbergmann/recursion-context/issues", - "source": "https://github.com/sebastianbergmann/recursion-context/tree/master" - }, - "time": "2017-03-03T06:23:57+00:00" - }, - { - "name": "sebastian/resource-operations", - "version": "2.0.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/resource-operations.git", - "reference": "4d7a795d35b889bf80a0cc04e08d77cedfa917a9" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/4d7a795d35b889bf80a0cc04e08d77cedfa917a9", - "reference": "4d7a795d35b889bf80a0cc04e08d77cedfa917a9", - "shasum": "" - }, - "require": { - "php": "^7.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides a list of PHP built-in functions that operate on resources", - "homepage": "https://www.github.com/sebastianbergmann/resource-operations", - "support": { - "issues": "https://github.com/sebastianbergmann/resource-operations/issues", - "source": "https://github.com/sebastianbergmann/resource-operations/tree/master" - }, - "time": "2018-10-04T04:07:39+00:00" - }, - { - "name": "sebastian/version", - "version": "2.0.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/version.git", - "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019", - "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019", - "shasum": "" - }, - "require": { - "php": ">=5.6" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Library that helps with managing the version number of Git-hosted PHP projects", - "homepage": "https://github.com/sebastianbergmann/version", - "support": { - "issues": "https://github.com/sebastianbergmann/version/issues", - "source": "https://github.com/sebastianbergmann/version/tree/master" - }, - "time": "2016-10-03T07:35:21+00:00" - }, - { - "name": "slevomat/coding-standard", - "version": "5.0.4", - "source": { - "type": "git", - "url": "https://github.com/slevomat/coding-standard.git", - "reference": "287ac3347c47918c0bf5e10335e36197ea10894c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/slevomat/coding-standard/zipball/287ac3347c47918c0bf5e10335e36197ea10894c", - "reference": "287ac3347c47918c0bf5e10335e36197ea10894c", - "shasum": "" - }, - "require": { - "php": "^7.1", - "phpstan/phpdoc-parser": "^0.3.1", - "squizlabs/php_codesniffer": "^3.4.1" - }, - "require-dev": { - "jakub-onderka/php-parallel-lint": "1.0.0", - "phing/phing": "2.16.1", - "phpstan/phpstan": "0.11.4", - "phpstan/phpstan-phpunit": "0.11", - "phpstan/phpstan-strict-rules": "0.11", - "phpunit/phpunit": "8.0.5" - }, - "type": "phpcodesniffer-standard", - "autoload": { - "psr-4": { - "SlevomatCodingStandard\\": "SlevomatCodingStandard" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Slevomat Coding Standard for PHP_CodeSniffer complements Consistence Coding Standard by providing sniffs with additional checks.", - "support": { - "issues": "https://github.com/slevomat/coding-standard/issues", - "source": "https://github.com/slevomat/coding-standard/tree/master" - }, - "time": "2019-03-22T19:10:53+00:00" - }, - { - "name": "squizlabs/php_codesniffer", - "version": "3.5.8", - "source": { - "type": "git", - "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "9d583721a7157ee997f235f327de038e7ea6dac4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/9d583721a7157ee997f235f327de038e7ea6dac4", - "reference": "9d583721a7157ee997f235f327de038e7ea6dac4", - "shasum": "" - }, - "require": { - "ext-simplexml": "*", - "ext-tokenizer": "*", - "ext-xmlwriter": "*", - "php": ">=5.4.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" - }, - "bin": [ - "bin/phpcs", - "bin/phpcbf" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.x-dev" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Greg Sherwood", - "role": "lead" - } - ], - "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", - "homepage": "https://github.com/squizlabs/PHP_CodeSniffer", - "keywords": [ - "phpcs", - "standards" - ], - "support": { - "issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues", - "source": "https://github.com/squizlabs/PHP_CodeSniffer", - "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki" - }, - "time": "2020-10-23T02:01:07+00:00" - }, - { - "name": "symfony/polyfill-ctype", - "version": "v1.20.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "f4ba089a5b6366e453971d3aad5fe8e897b37f41" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/f4ba089a5b6366e453971d3aad5fe8e897b37f41", - "reference": "f4ba089a5b6366e453971d3aad5fe8e897b37f41", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "suggest": { - "ext-ctype": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.20-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Ctype\\": "" - }, - "files": [ - "bootstrap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Gert de Pagter", - "email": "BackEndTea@gmail.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for ctype functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "ctype", - "polyfill", - "portable" - ], - "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.20.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2020-10-23T14:02:19+00:00" - }, - { - "name": "symfony/yaml", - "version": "v4.4.16", - "source": { - "type": "git", - "url": "https://github.com/symfony/yaml.git", - "reference": "543cb4dbd45ed803f08a9a65f27fb149b5dd20c2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/543cb4dbd45ed803f08a9a65f27fb149b5dd20c2", - "reference": "543cb4dbd45ed803f08a9a65f27fb149b5dd20c2", - "shasum": "" - }, - "require": { - "php": ">=7.1.3", - "symfony/polyfill-ctype": "~1.8" - }, - "conflict": { - "symfony/console": "<3.4" - }, - "require-dev": { - "symfony/console": "^3.4|^4.0|^5.0" - }, - "suggest": { - "symfony/console": "For validating YAML files using the lint command" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Yaml\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Yaml Component", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/yaml/tree/v4.4.16" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2020-10-24T11:50:19+00:00" - }, - { - "name": "theseer/tokenizer", - "version": "1.1.3", - "source": { - "type": "git", - "url": "https://github.com/theseer/tokenizer.git", - "reference": "11336f6f84e16a720dae9d8e6ed5019efa85a0f9" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/theseer/tokenizer/zipball/11336f6f84e16a720dae9d8e6ed5019efa85a0f9", - "reference": "11336f6f84e16a720dae9d8e6ed5019efa85a0f9", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-tokenizer": "*", - "ext-xmlwriter": "*", - "php": "^7.0" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" - } - ], - "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", - "support": { - "issues": "https://github.com/theseer/tokenizer/issues", - "source": "https://github.com/theseer/tokenizer/tree/master" - }, - "time": "2019-06-13T22:48:21+00:00" - }, - { - "name": "vimeo/psalm", - "version": "3.18.2", - "source": { - "type": "git", - "url": "https://github.com/vimeo/psalm.git", - "reference": "19aa905f7c3c7350569999a93c40ae91ae4e1626" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/vimeo/psalm/zipball/19aa905f7c3c7350569999a93c40ae91ae4e1626", - "reference": "19aa905f7c3c7350569999a93c40ae91ae4e1626", - "shasum": "" - }, - "require": { - "amphp/amp": "^2.1", - "amphp/byte-stream": "^1.5", - "composer/package-versions-deprecated": "^1.8.0", - "composer/semver": "^1.4 || ^2.0 || ^3.0", - "composer/xdebug-handler": "^1.1", - "dnoegel/php-xdg-base-dir": "^0.1.1", - "ext-dom": "*", - "ext-json": "*", - "ext-libxml": "*", - "ext-mbstring": "*", - "ext-simplexml": "*", - "ext-tokenizer": "*", - "felixfbecker/advanced-json-rpc": "^3.0.3", - "felixfbecker/language-server-protocol": "^1.4", - "netresearch/jsonmapper": "^1.0 || ^2.0 || ^3.0", - "nikic/php-parser": "4.3.* || 4.4.* || 4.5.* || 4.6.* || ^4.8", - "openlss/lib-array2xml": "^1.0", - "php": "^7.1.3|^8", - "sebastian/diff": "^3.0 || ^4.0", - "symfony/console": "^3.4.17 || ^4.1.6 || ^5.0", - "webmozart/glob": "^4.1", - "webmozart/path-util": "^2.3" - }, - "provide": { - "psalm/psalm": "self.version" - }, - "require-dev": { - "amphp/amp": "^2.4.2", - "bamarni/composer-bin-plugin": "^1.2", - "brianium/paratest": "^4.0.0", - "ext-curl": "*", - "phpdocumentor/reflection-docblock": "^4.3.4 || ^5", - "phpmyadmin/sql-parser": "5.1.0", - "phpspec/prophecy": ">=1.9.0", - "phpunit/phpunit": "^7.5.16 || ^8.5 || ^9.0", - "psalm/plugin-phpunit": "^0.11", - "slevomat/coding-standard": "^5.0", - "squizlabs/php_codesniffer": "^3.5", - "symfony/process": "^4.3", - "weirdan/prophecy-shim": "^1.0 || ^2.0" - }, - "suggest": { - "ext-igbinary": "^2.0.5" - }, - "bin": [ - "psalm", - "psalm-language-server", - "psalm-plugin", - "psalm-refactor", - "psalter" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.x-dev", - "dev-2.x": "2.x-dev", - "dev-1.x": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psalm\\": "src/Psalm/" - }, - "files": [ - "src/functions.php", - "src/spl_object_id.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Matthew Brown" - } - ], - "description": "A static analysis tool for finding errors in PHP applications", - "keywords": [ - "code", - "inspection", - "php" - ], - "support": { - "issues": "https://github.com/vimeo/psalm/issues", - "source": "https://github.com/vimeo/psalm/tree/3.18.2" - }, - "time": "2020-10-20T13:48:22+00:00" - }, - { - "name": "webmozart/assert", - "version": "1.9.1", - "source": { - "type": "git", - "url": "https://github.com/webmozart/assert.git", - "reference": "bafc69caeb4d49c39fd0779086c03a3738cbb389" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/webmozart/assert/zipball/bafc69caeb4d49c39fd0779086c03a3738cbb389", - "reference": "bafc69caeb4d49c39fd0779086c03a3738cbb389", - "shasum": "" - }, - "require": { - "php": "^5.3.3 || ^7.0 || ^8.0", - "symfony/polyfill-ctype": "^1.8" - }, - "conflict": { - "phpstan/phpstan": "<0.12.20", - "vimeo/psalm": "<3.9.1" - }, - "require-dev": { - "phpunit/phpunit": "^4.8.36 || ^7.5.13" - }, - "type": "library", - "autoload": { - "psr-4": { - "Webmozart\\Assert\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" - } - ], - "description": "Assertions to validate method input/output with nice error messages.", - "keywords": [ - "assert", - "check", - "validate" - ], - "support": { - "issues": "https://github.com/webmozart/assert/issues", - "source": "https://github.com/webmozart/assert/tree/master" - }, - "time": "2020-07-08T17:02:28+00:00" - }, - { - "name": "webmozart/glob", - "version": "4.1.0", - "source": { - "type": "git", - "url": "https://github.com/webmozart/glob.git", - "reference": "3cbf63d4973cf9d780b93d2da8eec7e4a9e63bbe" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/webmozart/glob/zipball/3cbf63d4973cf9d780b93d2da8eec7e4a9e63bbe", - "reference": "3cbf63d4973cf9d780b93d2da8eec7e4a9e63bbe", - "shasum": "" - }, - "require": { - "php": "^5.3.3|^7.0", - "webmozart/path-util": "^2.2" - }, - "require-dev": { - "phpunit/phpunit": "^4.6", - "sebastian/version": "^1.0.1", - "symfony/filesystem": "^2.5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.1-dev" - } - }, - "autoload": { - "psr-4": { - "Webmozart\\Glob\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" - } - ], - "description": "A PHP implementation of Ant's glob.", - "support": { - "issues": "https://github.com/webmozart/glob/issues", - "source": "https://github.com/webmozart/glob/tree/master" - }, - "time": "2015-12-29T11:14:33+00:00" - }, - { - "name": "webmozart/path-util", - "version": "2.3.0", - "source": { - "type": "git", - "url": "https://github.com/webmozart/path-util.git", - "reference": "d939f7edc24c9a1bb9c0dee5cb05d8e859490725" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/webmozart/path-util/zipball/d939f7edc24c9a1bb9c0dee5cb05d8e859490725", - "reference": "d939f7edc24c9a1bb9c0dee5cb05d8e859490725", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "webmozart/assert": "~1.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.6", - "sebastian/version": "^1.0.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.3-dev" - } - }, - "autoload": { - "psr-4": { - "Webmozart\\PathUtil\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" - } - ], - "description": "A robust cross-platform utility for normalizing, comparing and modifying file paths.", - "support": { - "issues": "https://github.com/webmozart/path-util/issues", - "source": "https://github.com/webmozart/path-util/tree/2.3.0" - }, - "time": "2015-12-17T08:42:14+00:00" - } - ], - "aliases": [], - "minimum-stability": "stable", - "stability-flags": [], - "prefer-stable": false, - "prefer-lowest": false, - "platform": { - "php": "^7.1", - "ext-pdo": "*" - }, - "platform-dev": [], - "platform-overrides": { - "php": "7.1.3" - }, - "plugin-api-version": "2.0.0" -} diff --git a/tests/Doctrine/Tests/ORM/Functional/ValueObjectsTest.php b/tests/Doctrine/Tests/ORM/Functional/ValueObjectsTest.php index 19a63350a3..efeac8414a 100644 --- a/tests/Doctrine/Tests/ORM/Functional/ValueObjectsTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/ValueObjectsTest.php @@ -1,14 +1,20 @@ _schemaTool->createSchema( [ - $this->_em->getClassMetadata(DDC93Person::class), - $this->_em->getClassMetadata(DDC93Address::class), - $this->_em->getClassMetadata(DDC93Vehicle::class), - $this->_em->getClassMetadata(DDC93Car::class), - $this->_em->getClassMetadata(DDC3027Animal::class), - $this->_em->getClassMetadata(DDC3027Dog::class), + $this->_em->getClassMetadata(DDC93Person::class), + $this->_em->getClassMetadata(DDC93Address::class), + $this->_em->getClassMetadata(DDC93Vehicle::class), + $this->_em->getClassMetadata(DDC93Car::class), + $this->_em->getClassMetadata(DDC3027Animal::class), + $this->_em->getClassMetadata(DDC3027Dog::class), ] ); - } catch(\Exception $e) { + } catch (Exception $e) { } } @@ -38,23 +44,28 @@ public function testMetadataHasReflectionEmbeddablesAccessible() { $classMetadata = $this->_em->getClassMetadata(DDC93Person::class); - $this->assertInstanceOf( - class_exists(RuntimePublicReflectionProperty::class) ? - RuntimePublicReflectionProperty::class : - LegacyRuntimePublicReflectionProperty::class, - $classMetadata->getReflectionProperty('address') - ); + if (class_exists(CommonRuntimePublicReflectionProperty::class)) { + $this->assertInstanceOf( + CommonRuntimePublicReflectionProperty::class, + $classMetadata->getReflectionProperty('address') + ); + } else { + $this->assertInstanceOf( + RuntimePublicReflectionProperty::class, + $classMetadata->getReflectionProperty('address') + ); + } $this->assertInstanceOf(ReflectionEmbeddedProperty::class, $classMetadata->getReflectionProperty('address.street')); } public function testCRUD() { - $person = new DDC93Person(); - $person->name = "Tara"; - $person->address = new DDC93Address(); - $person->address->street = "United States of Tara Street"; - $person->address->zip = "12345"; - $person->address->city = "funkytown"; + $person = new DDC93Person(); + $person->name = 'Tara'; + $person->address = new DDC93Address(); + $person->address->street = 'United States of Tara Street'; + $person->address->zip = '12345'; + $person->address->city = 'funkytown'; $person->address->country = new DDC93Country('Germany'); // 1. check saving value objects works @@ -74,10 +85,10 @@ public function testCRUD() $this->assertEquals('Germany', $person->address->country->name); // 3. check changing value objects works - $person->address->street = "Street"; - $person->address->zip = "54321"; - $person->address->city = "another town"; - $person->address->country->name = "United States of America"; + $person->address->street = 'Street'; + $person->address->zip = '54321'; + $person->address->city = 'another town'; + $person->address->country->name = 'United States of America'; $this->_em->flush(); $this->_em->clear(); @@ -90,7 +101,8 @@ public function testCRUD() $this->assertEquals('United States of America', $person->address->country->name); // 4. check deleting works - $personId = $person->id;; + $personId = $person->id; + $this->_em->remove($person); $this->_em->flush(); @@ -100,12 +112,12 @@ public function testCRUD() public function testLoadDql() { for ($i = 0; $i < 3; $i++) { - $person = new DDC93Person(); - $person->name = "Donkey Kong$i"; - $person->address = new DDC93Address(); - $person->address->street = "Tree"; - $person->address->zip = "12345"; - $person->address->city = "funkytown"; + $person = new DDC93Person(); + $person->name = 'Donkey Kong' . $i; + $person->address = new DDC93Address(); + $person->address->street = 'Tree'; + $person->address->zip = '12345'; + $person->address->city = 'funkytown'; $person->address->country = new DDC93Country('United States of America'); $this->_em->persist($person); @@ -114,7 +126,7 @@ public function testLoadDql() $this->_em->flush(); $this->_em->clear(); - $dql = "SELECT p FROM " . __NAMESPACE__ . "\DDC93Person p"; + $dql = 'SELECT p FROM ' . __NAMESPACE__ . '\DDC93Person p'; $persons = $this->_em->createQuery($dql)->getResult(); $this->assertCount(3, $persons); @@ -127,7 +139,7 @@ public function testLoadDql() $this->assertEquals('United States of America', $person->address->country->name); } - $dql = "SELECT p FROM " . __NAMESPACE__ . "\DDC93Person p"; + $dql = 'SELECT p FROM ' . __NAMESPACE__ . '\DDC93Person p'; $persons = $this->_em->createQuery($dql)->getArrayResult(); foreach ($persons as $person) { @@ -152,7 +164,7 @@ public function testDqlOnEmbeddedObjectsField() $this->_em->flush(); // SELECT - $selectDql = "SELECT p FROM " . __NAMESPACE__ ."\\DDC93Person p WHERE p.address.city = :city AND p.address.country.name = :country"; + $selectDql = 'SELECT p FROM ' . __NAMESPACE__ . '\\DDC93Person p WHERE p.address.city = :city AND p.address.country.name = :country'; $loadedPerson = $this->_em->createQuery($selectDql) ->setParameter('city', 'Karlsruhe') ->setParameter('country', 'Germany') @@ -167,7 +179,7 @@ public function testDqlOnEmbeddedObjectsField() ); // UPDATE - $updateDql = "UPDATE " . __NAMESPACE__ . "\\DDC93Person p SET p.address.street = :street, p.address.country.name = :country WHERE p.address.city = :city"; + $updateDql = 'UPDATE ' . __NAMESPACE__ . '\\DDC93Person p SET p.address.street = :street, p.address.country.name = :country WHERE p.address.city = :city'; $this->_em->createQuery($updateDql) ->setParameter('street', 'Boo') ->setParameter('country', 'DE') @@ -179,7 +191,7 @@ public function testDqlOnEmbeddedObjectsField() $this->assertEquals('DE', $person->address->country->name); // DELETE - $this->_em->createQuery("DELETE " . __NAMESPACE__ . "\\DDC93Person p WHERE p.address.city = :city AND p.address.country.name = :country") + $this->_em->createQuery('DELETE ' . __NAMESPACE__ . '\\DDC93Person p WHERE p.address.city = :city AND p.address.country.name = :country') ->setParameter('city', 'Karlsruhe') ->setParameter('country', 'DE') ->execute(); @@ -196,7 +208,7 @@ public function testPartialDqlOnEmbeddedObjectsField() $this->_em->clear(); // Prove that the entity was persisted correctly. - $dql = "SELECT p FROM " . __NAMESPACE__ ."\\DDC93Person p WHERE p.name = :name"; + $dql = 'SELECT p FROM ' . __NAMESPACE__ . '\\DDC93Person p WHERE p.name = :name'; $person = $this->_em->createQuery($dql) ->setParameter('name', 'Karl') @@ -210,7 +222,7 @@ public function testPartialDqlOnEmbeddedObjectsField() // Clear the EM and prove that the embeddable can be the subject of a partial query. $this->_em->clear(); - $dql = "SELECT PARTIAL p.{id,address.city} FROM " . __NAMESPACE__ ."\\DDC93Person p WHERE p.name = :name"; + $dql = 'SELECT PARTIAL p.{id,address.city} FROM ' . __NAMESPACE__ . '\\DDC93Person p WHERE p.name = :name'; $person = $this->_em->createQuery($dql) ->setParameter('name', 'Karl') @@ -226,7 +238,7 @@ public function testPartialDqlOnEmbeddedObjectsField() // Clear the EM and prove that the embeddable can be the subject of a partial query regardless of attributes positions. $this->_em->clear(); - $dql = "SELECT PARTIAL p.{address.city, id} FROM " . __NAMESPACE__ ."\\DDC93Person p WHERE p.name = :name"; + $dql = 'SELECT PARTIAL p.{address.city, id} FROM ' . __NAMESPACE__ . '\\DDC93Person p WHERE p.name = :name'; $person = $this->_em->createQuery($dql) ->setParameter('name', 'Karl') @@ -245,7 +257,7 @@ public function testDqlWithNonExistentEmbeddableField() $this->expectException(QueryException::class); $this->expectExceptionMessage('no field or association named address.asdfasdf'); - $this->_em->createQuery("SELECT p FROM " . __NAMESPACE__ . "\\DDC93Person p WHERE p.address.asdfasdf IS NULL") + $this->_em->createQuery('SELECT p FROM ' . __NAMESPACE__ . '\\DDC93Person p WHERE p.address.asdfasdf IS NULL') ->execute(); } @@ -254,7 +266,7 @@ public function testPartialDqlWithNonExistentEmbeddableField() $this->expectException(QueryException::class); $this->expectExceptionMessage("no mapped field named 'address.asdfasdf'"); - $this->_em->createQuery("SELECT PARTIAL p.{id,address.asdfasdf} FROM " . __NAMESPACE__ . "\\DDC93Person p") + $this->_em->createQuery('SELECT PARTIAL p.{id,address.asdfasdf} FROM ' . __NAMESPACE__ . '\\DDC93Person p') ->execute(); } @@ -324,7 +336,7 @@ public function testThrowsExceptionOnInfiniteEmbeddableNesting($embeddableClassN $this->_schemaTool->createSchema( [ - $this->_em->getClassMetadata(__NAMESPACE__ . '\\' . $embeddableClassName), + $this->_em->getClassMetadata(__NAMESPACE__ . '\\' . $embeddableClassName), ] ); } @@ -356,11 +368,11 @@ class DDC93Person /** @Embedded(class = "DDC93Timestamps") */ public $timestamps; - public function __construct($name = null, DDC93Address $address = null) + public function __construct($name = null, ?DDC93Address $address = null) { - $this->name = $name; - $this->address = $address; - $this->timestamps = new DDC93Timestamps(new \DateTime); + $this->name = $name; + $this->address = $address; + $this->timestamps = new DDC93Timestamps(new DateTime()); } } @@ -372,7 +384,7 @@ class DDC93Timestamps /** @Column(type = "datetime") */ public $createdAt; - public function __construct(\DateTime $createdAt) + public function __construct(DateTime $createdAt) { $this->createdAt = $createdAt; } @@ -380,7 +392,6 @@ public function __construct(\DateTime $createdAt) /** * @Entity - * * @InheritanceType("SINGLE_TABLE") * @DiscriminatorColumn(name = "t", type = "string", length = 10) * @DiscriminatorMap({ @@ -413,9 +424,7 @@ class DDC93Car extends DDC93Vehicle */ class DDC93Country { - /** - * @Column(type="string", nullable=true) - */ + /** @Column(type="string", nullable=true) */ public $name; public function __construct($name = null) @@ -429,26 +438,20 @@ public function __construct($name = null) */ class DDC93Address { - /** - * @Column(type="string") - */ + /** @Column(type="string") */ public $street; - /** - * @Column(type="string") - */ + /** @Column(type="string") */ public $zip; - /** - * @Column(type="string") - */ + /** @Column(type="string") */ public $city; /** @Embedded(class = "DDC93Country") */ public $country; - public function __construct($street = null, $zip = null, $city = null, DDC93Country $country = null) + public function __construct($street = null, $zip = null, $city = null, ?DDC93Country $country = null) { - $this->street = $street; - $this->zip = $zip; - $this->city = $city; + $this->street = $street; + $this->zip = $zip; + $this->city = $city; $this->country = $country; } } @@ -466,9 +469,7 @@ class DDC93Customer /** @Embeddable */ class DDC93ContactInfo { - /** - * @Column(type="string") - */ + /** @Column(type="string") */ public $email; /** @Embedded(class = "DDC93Address") */ public $address; @@ -485,9 +486,9 @@ class DDC3028PersonWithPrefix /** @Embedded(class="DDC3028NestedEmbeddable", columnPrefix = "bloo_") */ public $nested; - public function __construct(DDC3028Id $id = null, DDC3028NestedEmbeddable $nested = null) + public function __construct(?DDC3028Id $id = null, ?DDC3028NestedEmbeddable $nested = null) { - $this->id = $id; + $this->id = $id; $this->nested = $nested; } } @@ -503,9 +504,9 @@ class DDC3028PersonEmptyPrefix /** @Embedded(class="DDC3028NestedEmbeddable", columnPrefix = "") */ public $nested; - public function __construct(DDC3028Id $id = null, DDC3028NestedEmbeddable $nested = null) + public function __construct(?DDC3028Id $id = null, ?DDC3028NestedEmbeddable $nested = null) { - $this->id = $id; + $this->id = $id; $this->nested = $nested; } } @@ -518,7 +519,7 @@ class DDC3028PersonPrefixFalse /** @Embedded(class="DDC3028Id", columnPrefix = false) */ public $id; - public function __construct(DDC3028Id $id = null) + public function __construct(?DDC3028Id $id = null) { $this->id = $id; } @@ -529,9 +530,7 @@ public function __construct(DDC3028Id $id = null) */ class DDC3028Id { - /** - * @Id @Column(type="string") - */ + /** @Id @Column(type="string") */ public $id; public function __construct($id = null) @@ -555,11 +554,11 @@ class DDC3028NestedEmbeddable public $nestedWithPrefixFalse; public function __construct( - DDC3028Id $nestedWithPrefix = null, - DDC3028Id $nestedWithEmptyPrefix = null, - DDC3028Id $nestedWithPrefixFalse = null + ?DDC3028Id $nestedWithPrefix = null, + ?DDC3028Id $nestedWithEmptyPrefix = null, + ?DDC3028Id $nestedWithPrefixFalse = null ) { - $this->nestedWithPrefix = $nestedWithPrefix; + $this->nestedWithPrefix = $nestedWithPrefix; $this->nestedWithEmptyPrefix = $nestedWithEmptyPrefix; $this->nestedWithPrefixFalse = $nestedWithPrefixFalse; } diff --git a/tests/Doctrine/Tests/ORM/Mapping/AnnotationDriverTest.php b/tests/Doctrine/Tests/ORM/Mapping/AnnotationDriverTest.php index e25404348b..c23c359b74 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/AnnotationDriverTest.php +++ b/tests/Doctrine/Tests/ORM/Mapping/AnnotationDriverTest.php @@ -1,5 +1,7 @@ initializeReflection(new RuntimeReflectionService()); - $reader = new AnnotationReader(); + $reader = new AnnotationReader(); $annotationDriver = new AnnotationDriver($reader); - $this->expectException(\Doctrine\ORM\Mapping\MappingException::class); + $this->expectException(MappingException::class); $annotationDriver->loadMetadataForClass('stdClass', $cm); } @@ -64,10 +66,10 @@ public function testColumnWithMissingTypeDefaultsToString() public function testGetAllClassNamesIsIdempotent() { $annotationDriver = $this->_loadDriverForCMSModels(); - $original = $annotationDriver->getAllClassNames(); + $original = $annotationDriver->getAllClassNames(); $annotationDriver = $this->_loadDriverForCMSModels(); - $afterTestReset = $annotationDriver->getAllClassNames(); + $afterTestReset = $annotationDriver->getAllClassNames(); $this->assertEquals($original, $afterTestReset); } @@ -78,10 +80,10 @@ public function testGetAllClassNamesIsIdempotent() public function testGetAllClassNamesIsIdempotentEvenWithDifferentDriverInstances() { $annotationDriver = $this->_loadDriverForCMSModels(); - $original = $annotationDriver->getAllClassNames(); + $original = $annotationDriver->getAllClassNames(); $annotationDriver = $this->_loadDriverForCMSModels(); - $afterTestReset = $annotationDriver->getAllClassNames(); + $afterTestReset = $annotationDriver->getAllClassNames(); $this->assertEquals($original, $afterTestReset); } @@ -94,7 +96,7 @@ public function testGetAllClassNamesReturnsAlreadyLoadedClassesIfAppropriate() $this->_ensureIsLoaded(CmsUser::class); $annotationDriver = $this->_loadDriverForCMSModels(); - $classes = $annotationDriver->getAllClassNames(); + $classes = $annotationDriver->getAllClassNames(); $this->assertContains(CmsUser::class, $classes); } @@ -107,7 +109,7 @@ public function testGetClassNamesReturnsOnlyTheAppropriateClasses() $this->_ensureIsLoaded(ECommerceCart::class); $annotationDriver = $this->_loadDriverForCMSModels(); - $classes = $annotationDriver->getAllClassNames(); + $classes = $annotationDriver->getAllClassNames(); $this->assertNotContains(ECommerceCart::class, $classes); } @@ -116,6 +118,7 @@ protected function _loadDriverForCMSModels() { $annotationDriver = $this->_loadDriver(); $annotationDriver->addPaths([__DIR__ . '/../../Models/CMS/']); + return $annotationDriver; } @@ -126,7 +129,7 @@ protected function _loadDriver() protected function _ensureIsLoaded($entityClassName) { - new $entityClassName; + new $entityClassName(); } /** @@ -165,7 +168,7 @@ public function testInvalidMappedSuperClassWithManyToManyAssociation() $this->expectException(MappingException::class); $this->expectExceptionMessage( - "It is illegal to put an inverse side one-to-many or many-to-many association on " . + 'It is illegal to put an inverse side one-to-many or many-to-many association on ' . "mapped superclass 'Doctrine\Tests\ORM\Mapping\InvalidMappedSuperClass#users'" ); @@ -186,7 +189,7 @@ public function testInvalidMappedSuperClassWithInheritanceInformation() $this->expectException(MappingException::class); $this->expectExceptionMessage( - "It is not supported to define inheritance information on a mapped " . + 'It is not supported to define inheritance information on a mapped ' . "superclass '" . MappedSuperClassInheritence::class . "'." ); @@ -206,10 +209,10 @@ public function testInheritanceSkipsParentLifecycleCallbacks() $factory->setEntityManager($em); $cm = $factory->getMetadataFor(AnnotationChild::class); - $this->assertEquals(["postLoad" => ["postLoad"], "preUpdate" => ["preUpdate"]], $cm->lifecycleCallbacks); + $this->assertEquals(['postLoad' => ['postLoad'], 'preUpdate' => ['preUpdate']], $cm->lifecycleCallbacks); $cm = $factory->getMetadataFor(AnnotationParent::class); - $this->assertEquals(["postLoad" => ["postLoad"], "preUpdate" => ["preUpdate"]], $cm->lifecycleCallbacks); + $this->assertEquals(['postLoad' => ['postLoad'], 'preUpdate' => ['preUpdate']], $cm->lifecycleCallbacks); } /** @@ -238,17 +241,17 @@ public function testInvalidFetchOptionThrowsException() $factory->setEntityManager($em); $this->expectException(AnnotationException::class); - $this->expectExceptionMessage('[Enum Error] Attribute "fetch" of @Doctrine\ORM\Mapping\OneToMany declared on property Doctrine\Tests\ORM\Mapping\InvalidFetchOption::$collection accepts only [LAZY, EAGER, EXTRA_LAZY], but got eager.'); + $this->expectExceptionMessage('[Enum Error] Attribute "fetch" of @Doctrine\ORM\Mapping\OneToMany declared on property Doctrine\Tests\ORM\Mapping\InvalidFetchOption::$collection accept'); $factory->getMetadataFor(InvalidFetchOption::class); } public function testAttributeOverridesMappingWithTrait() { - $factory = $this->createClassMetadataFactory(); + $factory = $this->createClassMetadataFactory(); $metadataWithoutOverride = $factory->getMetadataFor(DDC1872ExampleEntityWithoutOverride::class); - $metadataWithOverride = $factory->getMetadataFor(DDC1872ExampleEntityWithOverride::class); + $metadataWithOverride = $factory->getMetadataFor(DDC1872ExampleEntityWithOverride::class); $this->assertEquals('trait_foo', $metadataWithoutOverride->fieldMappings['foo']['columnName']); $this->assertEquals('foo_overridden', $metadataWithOverride->fieldMappings['foo']['columnName']); @@ -271,9 +274,7 @@ class ColumnWithoutType */ class InvalidMappedSuperClass { - /** - * @ManyToMany(targetEntity="Doctrine\Tests\Models\CMS\CmsUser", mappedBy="invalid") - */ + /** @ManyToMany(targetEntity="Doctrine\Tests\Models\CMS\CmsUser", mappedBy="invalid") */ private $users; } @@ -282,9 +283,7 @@ class InvalidMappedSuperClass */ class UsingInvalidMappedSuperClass extends InvalidMappedSuperClass { - /** - * @Id @Column(type="integer") @GeneratedValue - */ + /** @Id @Column(type="integer") @GeneratedValue */ private $id; } @@ -295,7 +294,6 @@ class UsingInvalidMappedSuperClass extends InvalidMappedSuperClass */ class MappedSuperClassInheritence { - } /** @@ -306,9 +304,7 @@ class MappedSuperClassInheritence */ class AnnotationParent { - /** - * @Id @Column(type="integer") @GeneratedValue - */ + /** @Id @Column(type="integer") @GeneratedValue */ private $id; /** @@ -316,7 +312,6 @@ class AnnotationParent */ public function postLoad() { - } /** @@ -324,7 +319,6 @@ public function postLoad() */ public function preUpdate() { - } } @@ -334,7 +328,6 @@ public function preUpdate() */ class AnnotationChild extends AnnotationParent { - } /** @@ -362,9 +355,7 @@ class MiddleMappedSuperclass extends SuperEntity */ class ChildEntity extends MiddleMappedSuperclass { - /** - * @Column(type="string") - */ + /** @Column(type="string") */ private $text; } @@ -373,9 +364,7 @@ class ChildEntity extends MiddleMappedSuperclass */ class InvalidFetchOption { - /** - * @OneToMany(targetEntity="Doctrine\Tests\Models\CMS\CmsUser", fetch="eager") - */ + /** @OneToMany(targetEntity="Doctrine\Tests\Models\CMS\CmsUser", fetch="eager") */ private $collection; } @@ -396,8 +385,6 @@ class AnnotationSLC */ class AnnotationSLCFoo { - /** - * @Column(type="string") - */ + /** @Column(type="string") */ public $id; } diff --git a/tests/travis/install-mysql-5.7.sh b/tests/travis/install-mysql-5.7.sh deleted file mode 100755 index 9dbd6edfd2..0000000000 --- a/tests/travis/install-mysql-5.7.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env bash - -set -ex - -echo "Restart mysql..." -sudo mysql -e "use mysql; update user set authentication_string=PASSWORD('') where User='root'; update user set plugin='mysql_native_password';FLUSH PRIVILEGES;" -sudo mysql_upgrade -u root -sudo service mysql restart diff --git a/tests/travis/mariadb.travis.xml b/tests/travis/mariadb.travis.xml deleted file mode 100644 index d4a3fef40c..0000000000 --- a/tests/travis/mariadb.travis.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - ./../Doctrine/Tests/ORM - - - - - ./../../lib/Doctrine - - - - - performance - locking_functional - - - - - diff --git a/tests/travis/mysql.travis.xml b/tests/travis/mysql.travis.xml deleted file mode 100644 index d4a3fef40c..0000000000 --- a/tests/travis/mysql.travis.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - ./../Doctrine/Tests/ORM - - - - - ./../../lib/Doctrine - - - - - performance - locking_functional - - - - - diff --git a/tests/travis/pgsql.travis.xml b/tests/travis/pgsql.travis.xml deleted file mode 100644 index d429084476..0000000000 --- a/tests/travis/pgsql.travis.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - ./../Doctrine/Tests/ORM - - - - - ./../../lib/Doctrine - - - - - performance - locking_functional - - - - diff --git a/tests/travis/sqlite.travis.xml b/tests/travis/sqlite.travis.xml deleted file mode 100644 index b783a34ffa..0000000000 --- a/tests/travis/sqlite.travis.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - ./../Doctrine/Tests/ORM - - - - - ./../../lib/Doctrine - - - - - performance - locking_functional - - - - From fa6fe096472c2914ca246f0a7dc373af3dc9c395 Mon Sep 17 00:00:00 2001 From: Benjamin Eberlei Date: Sat, 7 Nov 2020 18:37:46 +0100 Subject: [PATCH 130/136] Ignore composer.lock --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 81e913c431..729e78aa48 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,4 @@ lib/Doctrine/DBAL vendor/ /tests/Doctrine/Performance/history.db /.phpcs-cache +composer.lock From 385b5a2f80176810cc58998b6796e3792bd4de9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Paris?= Date: Sat, 7 Nov 2020 19:41:15 +0100 Subject: [PATCH 131/136] Phpunit 8 (#8330) * Revert to whitelist coverage requires PHPunit 9, and we don't have that yet. * Upgrade to PHPUnit 8 This unlocks PCOV usage for coverage * Upload coverage files to Codecov --- .github/workflows/continuous-integration.yml | 64 +++++++++++++++++-- .gitignore | 1 + ci/github/phpunit/mysqli.xml | 8 +-- ci/github/phpunit/pdo_mysql.xml | 9 +-- ci/github/phpunit/pdo_pgsql.xml | 8 +-- ci/github/phpunit/sqlite.xml | 8 +-- composer.json | 2 +- .../Doctrine/Tests/DbalFunctionalTestCase.php | 5 +- .../Mapping/UnderscoreNamingStrategyTest.php | 2 +- .../Tests/ORM/Cache/AbstractRegionTest.php | 2 +- .../Tests/ORM/Cache/CacheConfigTest.php | 2 +- .../Tests/ORM/Cache/CacheLoggerChainTest.php | 2 +- .../ORM/Cache/DefaultCacheFactoryTest.php | 2 +- .../Tests/ORM/Cache/DefaultCacheTest.php | 2 +- .../Cache/DefaultCollectionHydratorTest.php | 2 +- .../ORM/Cache/DefaultEntityHydratorTest.php | 2 +- .../Tests/ORM/Cache/DefaultQueryCacheTest.php | 20 ++---- .../Tests/ORM/Cache/FileLockRegionTest.php | 2 +- .../AbstractCollectionPersisterTest.php | 2 +- .../Entity/AbstractEntityPersisterTest.php | 2 +- .../ReadOnlyCachedEntityPersisterTest.php | 6 +- .../ORM/Cache/StatisticsCacheLoggerTest.php | 2 +- .../Tests/ORM/CommitOrderCalculatorTest.php | 4 +- .../Doctrine/Tests/ORM/ConfigurationTest.php | 2 +- .../Decorator/EntityManagerDecoratorTest.php | 2 +- .../Doctrine/Tests/ORM/EntityManagerTest.php | 12 ++-- .../Functional/AdvancedAssociationTest.php | 3 +- .../ORM/Functional/AdvancedDqlQueryTest.php | 2 +- .../ORM/Functional/BasicFunctionalTest.php | 2 +- .../ORM/Functional/CascadeRemoveOrderTest.php | 4 +- .../Functional/ClassTableInheritanceTest.php | 2 +- .../Functional/ClassTableInheritanceTest2.php | 2 +- .../Functional/CompositePrimaryKeyTest.php | 2 +- ...ompositePrimaryKeyWithAssociationsTest.php | 2 +- .../ORM/Functional/CustomFunctionsTest.php | 2 +- .../ORM/Functional/CustomIdObjectTypeTest.php | 2 +- .../ORM/Functional/DatabaseDriverTest.php | 2 +- .../ORM/Functional/DefaultValuesTest.php | 2 +- .../ORM/Functional/DetachedEntityTest.php | 2 +- .../ORM/Functional/EntityListenersTest.php | 2 +- .../EntityRepositoryCriteriaTest.php | 4 +- .../ORM/Functional/EntityRepositoryTest.php | 21 +++--- .../Functional/ExtraLazyCollectionTest.php | 4 +- .../Tests/ORM/Functional/FlushEventTest.php | 2 +- .../Tests/ORM/Functional/GH5988Test.php | 2 +- .../ORM/Functional/HydrationCacheTest.php | 2 +- .../Tests/ORM/Functional/IdentityMapTest.php | 2 +- .../ORM/Functional/IndexByAssociationTest.php | 2 +- .../JoinedTableCompositeKeyTest.php | 7 +- .../ORM/Functional/LifecycleCallbackTest.php | 8 +-- .../Functional/Locking/GearmanLockTest.php | 2 +- .../Tests/ORM/Functional/Locking/LockTest.php | 2 +- .../ORM/Functional/Locking/OptimisticTest.php | 6 +- .../ManyToManyBasicAssociationTest.php | 4 +- ...ManyToManyBidirectionalAssociationTest.php | 2 +- .../ORM/Functional/ManyToManyEventTest.php | 2 +- ...nyToManySelfReferentialAssociationTest.php | 2 +- ...anyToManyUnidirectionalAssociationTest.php | 2 +- .../Functional/ManyToOneOrphanRemovalTest.php | 2 +- .../ORM/Functional/MappedSuperclassTest.php | 3 +- .../Functional/MergeCompositeToOneKeyTest.php | 2 +- .../Tests/ORM/Functional/MergeProxiesTest.php | 2 +- .../Functional/MergeSharedEntitiesTest.php | 2 +- .../MergeVersionedManyToOneTest.php | 2 +- .../Tests/ORM/Functional/NativeQueryTest.php | 6 +- .../Tests/ORM/Functional/NewOperatorTest.php | 28 +++----- .../Tests/ORM/Functional/NotifyPolicyTest.php | 2 +- .../OneToManyBidirectionalAssociationTest.php | 2 +- .../Functional/OneToManyOrphanRemovalTest.php | 2 +- ...neToManySelfReferentialAssociationTest.php | 2 +- ...OneToManyUnidirectionalAssociationTest.php | 2 +- .../OneToOneBidirectionalAssociationTest.php | 2 +- .../Functional/OneToOneEagerLoadingTest.php | 2 +- ...eToOneInverseSideLoadAfterDqlQueryTest.php | 2 +- .../Functional/OneToOneOrphanRemovalTest.php | 2 +- ...OneToOneSelfReferentialAssociationTest.php | 2 +- .../OneToOneSingleTableInheritanceTest.php | 2 +- .../OneToOneUnidirectionalAssociationTest.php | 2 +- .../ORM/Functional/OrderedCollectionTest.php | 2 +- ...edJoinedTableInheritanceCollectionTest.php | 2 +- .../Tests/ORM/Functional/PaginationTest.php | 12 ++-- .../PersistentCollectionCriteriaTest.php | 4 +- .../Functional/PersistentCollectionTest.php | 2 +- .../ORM/Functional/PersistentObjectTest.php | 2 +- .../ORM/Functional/PostFlushEventTest.php | 2 +- .../ORM/Functional/PostLoadEventTest.php | 2 +- .../Functional/ProxiesLikeEntitiesTest.php | 4 +- .../Tests/ORM/Functional/QueryCacheTest.php | 2 +- .../ORM/Functional/QueryDqlFunctionTest.php | 18 +++--- .../Tests/ORM/Functional/QueryTest.php | 18 ++---- .../Tests/ORM/Functional/ReadOnlyTest.php | 2 +- .../ORM/Functional/ReferenceProxyTest.php | 2 +- .../Tests/ORM/Functional/ResultCacheTest.php | 3 +- .../Tests/ORM/Functional/SQLFilterTest.php | 4 +- .../SchemaTool/CompanySchemaTest.php | 2 +- .../ORM/Functional/SchemaTool/DBAL483Test.php | 2 +- .../ORM/Functional/SchemaTool/DDC214Test.php | 2 +- .../SchemaTool/MySqlSchemaToolTest.php | 3 +- .../SchemaTool/PostgreSqlSchemaToolTest.php | 2 +- .../ORM/Functional/SchemaValidatorTest.php | 2 +- .../SecondLevelCacheAbstractTest.php | 2 +- ...ompositePrimaryKeyWithAssociationsTest.php | 2 +- .../SecondLevelCacheConcurrentTest.php | 4 +- ...econdLevelCacheExtraLazyCollectionTest.php | 4 +- .../SecondLevelCacheManyToManyTest.php | 6 +- .../SecondLevelCacheQueryCacheTest.php | 24 +++---- .../SequenceEmulatedIdentityStrategyTest.php | 4 +- .../ORM/Functional/SequenceGeneratorTest.php | 2 +- .../SingleTableCompositeKeyTest.php | 7 +- .../Functional/SingleTableInheritanceTest.php | 2 +- .../StandardEntityPersisterTest.php | 2 +- .../ORM/Functional/Ticket/DDC1040Test.php | 2 +- .../ORM/Functional/Ticket/DDC1041Test.php | 2 +- .../ORM/Functional/Ticket/DDC1043Test.php | 2 +- .../ORM/Functional/Ticket/DDC1113Test.php | 2 +- .../ORM/Functional/Ticket/DDC1129Test.php | 2 +- .../ORM/Functional/Ticket/DDC1163Test.php | 2 +- .../ORM/Functional/Ticket/DDC117Test.php | 2 +- .../ORM/Functional/Ticket/DDC1181Test.php | 2 +- .../ORM/Functional/Ticket/DDC1193Test.php | 2 +- .../ORM/Functional/Ticket/DDC1209Test.php | 2 +- .../ORM/Functional/Ticket/DDC1225Test.php | 2 +- .../ORM/Functional/Ticket/DDC1228Test.php | 2 +- .../ORM/Functional/Ticket/DDC1238Test.php | 2 +- .../ORM/Functional/Ticket/DDC1250Test.php | 2 +- .../ORM/Functional/Ticket/DDC1276Test.php | 2 +- .../ORM/Functional/Ticket/DDC1300Test.php | 2 +- .../ORM/Functional/Ticket/DDC1301Test.php | 4 +- .../ORM/Functional/Ticket/DDC1306Test.php | 2 +- .../ORM/Functional/Ticket/DDC1335Test.php | 2 +- .../ORM/Functional/Ticket/DDC1383Test.php | 2 +- .../ORM/Functional/Ticket/DDC1392Test.php | 2 +- .../ORM/Functional/Ticket/DDC1400Test.php | 2 +- .../ORM/Functional/Ticket/DDC1404Test.php | 3 +- .../ORM/Functional/Ticket/DDC1430Test.php | 3 +- .../ORM/Functional/Ticket/DDC1436Test.php | 2 +- .../ORM/Functional/Ticket/DDC144Test.php | 3 +- .../ORM/Functional/Ticket/DDC1452Test.php | 2 +- .../ORM/Functional/Ticket/DDC1454Test.php | 2 +- .../ORM/Functional/Ticket/DDC1458Test.php | 2 +- .../ORM/Functional/Ticket/DDC1461Test.php | 2 +- .../ORM/Functional/Ticket/DDC1509Test.php | 2 +- .../ORM/Functional/Ticket/DDC1514Test.php | 2 +- .../ORM/Functional/Ticket/DDC1515Test.php | 2 +- .../ORM/Functional/Ticket/DDC1526Test.php | 2 +- .../ORM/Functional/Ticket/DDC1545Test.php | 2 +- .../ORM/Functional/Ticket/DDC1548Test.php | 2 +- .../ORM/Functional/Ticket/DDC1594Test.php | 2 +- .../ORM/Functional/Ticket/DDC1595Test.php | 2 +- .../ORM/Functional/Ticket/DDC163Test.php | 2 +- .../ORM/Functional/Ticket/DDC1643Test.php | 2 +- .../ORM/Functional/Ticket/DDC1654Test.php | 4 +- .../ORM/Functional/Ticket/DDC1655Test.php | 2 +- .../ORM/Functional/Ticket/DDC1666Test.php | 2 +- .../ORM/Functional/Ticket/DDC1685Test.php | 2 +- .../ORM/Functional/Ticket/DDC168Test.php | 5 +- .../ORM/Functional/Ticket/DDC1690Test.php | 3 +- .../ORM/Functional/Ticket/DDC1707Test.php | 2 +- .../ORM/Functional/Ticket/DDC1719Test.php | 4 +- .../ORM/Functional/Ticket/DDC1734Test.php | 2 +- .../ORM/Functional/Ticket/DDC1778Test.php | 2 +- .../ORM/Functional/Ticket/DDC1787Test.php | 2 +- .../ORM/Functional/Ticket/DDC1884Test.php | 2 +- .../ORM/Functional/Ticket/DDC1918Test.php | 2 +- .../ORM/Functional/Ticket/DDC1995Test.php | 2 +- .../ORM/Functional/Ticket/DDC199Test.php | 2 +- .../ORM/Functional/Ticket/DDC2012Test.php | 2 +- .../ORM/Functional/Ticket/DDC2074Test.php | 2 +- .../ORM/Functional/Ticket/DDC2084Test.php | 8 +-- .../ORM/Functional/Ticket/DDC2090Test.php | 2 +- .../ORM/Functional/Ticket/DDC2106Test.php | 2 +- .../ORM/Functional/Ticket/DDC211Test.php | 2 +- .../ORM/Functional/Ticket/DDC2175Test.php | 2 +- .../ORM/Functional/Ticket/DDC2214Test.php | 2 +- .../ORM/Functional/Ticket/DDC2224Test.php | 2 +- .../ORM/Functional/Ticket/DDC2230Test.php | 2 +- .../ORM/Functional/Ticket/DDC2231Test.php | 2 +- .../ORM/Functional/Ticket/DDC2252Test.php | 2 +- .../ORM/Functional/Ticket/DDC2256Test.php | 2 +- .../ORM/Functional/Ticket/DDC2306Test.php | 2 +- .../ORM/Functional/Ticket/DDC2346Test.php | 2 +- .../ORM/Functional/Ticket/DDC2350Test.php | 2 +- .../ORM/Functional/Ticket/DDC237Test.php | 2 +- .../ORM/Functional/Ticket/DDC2409Test.php | 2 +- .../ORM/Functional/Ticket/DDC2415Test.php | 2 +- .../ORM/Functional/Ticket/DDC2494Test.php | 6 +- .../ORM/Functional/Ticket/DDC2519Test.php | 2 +- .../ORM/Functional/Ticket/DDC2575Test.php | 2 +- .../ORM/Functional/Ticket/DDC2579Test.php | 2 +- .../ORM/Functional/Ticket/DDC258Test.php | 2 +- .../ORM/Functional/Ticket/DDC2655Test.php | 2 +- .../ORM/Functional/Ticket/DDC2660Test.php | 2 +- .../ORM/Functional/Ticket/DDC2692Test.php | 2 +- .../ORM/Functional/Ticket/DDC2759Test.php | 2 +- .../ORM/Functional/Ticket/DDC2775Test.php | 2 +- .../ORM/Functional/Ticket/DDC2780Test.php | 4 +- .../ORM/Functional/Ticket/DDC2790Test.php | 2 +- .../ORM/Functional/Ticket/DDC279Test.php | 2 +- .../ORM/Functional/Ticket/DDC2825Test.php | 2 +- .../ORM/Functional/Ticket/DDC2862Test.php | 2 +- .../ORM/Functional/Ticket/DDC2895Test.php | 2 +- .../ORM/Functional/Ticket/DDC2931Test.php | 2 +- .../ORM/Functional/Ticket/DDC2943Test.php | 2 +- .../ORM/Functional/Ticket/DDC2984Test.php | 2 +- .../ORM/Functional/Ticket/DDC3042Test.php | 2 +- .../ORM/Functional/Ticket/DDC3068Test.php | 2 +- .../ORM/Functional/Ticket/DDC309Test.php | 2 +- .../ORM/Functional/Ticket/DDC3123Test.php | 12 +++- .../ORM/Functional/Ticket/DDC3160Test.php | 3 +- .../ORM/Functional/Ticket/DDC3170Test.php | 2 +- .../ORM/Functional/Ticket/DDC3192Test.php | 2 +- .../ORM/Functional/Ticket/DDC3223Test.php | 2 +- .../ORM/Functional/Ticket/DDC3303Test.php | 2 +- .../ORM/Functional/Ticket/DDC331Test.php | 3 +- .../ORM/Functional/Ticket/DDC3330Test.php | 2 +- .../ORM/Functional/Ticket/DDC3346Test.php | 2 +- .../ORM/Functional/Ticket/DDC345Test.php | 2 +- .../ORM/Functional/Ticket/DDC353Test.php | 2 +- .../ORM/Functional/Ticket/DDC3597Test.php | 8 ++- .../ORM/Functional/Ticket/DDC3634Test.php | 11 ++-- .../ORM/Functional/Ticket/DDC3644Test.php | 2 +- .../ORM/Functional/Ticket/DDC3699Test.php | 2 +- .../ORM/Functional/Ticket/DDC3719Test.php | 2 +- .../ORM/Functional/Ticket/DDC371Test.php | 2 +- .../ORM/Functional/Ticket/DDC3785Test.php | 2 +- .../ORM/Functional/Ticket/DDC381Test.php | 2 +- .../ORM/Functional/Ticket/DDC3967Test.php | 2 +- .../ORM/Functional/Ticket/DDC422Test.php | 2 +- .../ORM/Functional/Ticket/DDC425Test.php | 2 +- .../ORM/Functional/Ticket/DDC440Test.php | 3 +- .../ORM/Functional/Ticket/DDC444Test.php | 2 +- .../ORM/Functional/Ticket/DDC448Test.php | 2 +- .../ORM/Functional/Ticket/DDC493Test.php | 2 +- .../ORM/Functional/Ticket/DDC501Test.php | 2 +- .../ORM/Functional/Ticket/DDC512Test.php | 2 +- .../ORM/Functional/Ticket/DDC513Test.php | 2 +- .../ORM/Functional/Ticket/DDC518Test.php | 2 +- .../ORM/Functional/Ticket/DDC522Test.php | 2 +- .../ORM/Functional/Ticket/DDC531Test.php | 2 +- .../ORM/Functional/Ticket/DDC5684Test.php | 4 +- .../ORM/Functional/Ticket/DDC588Test.php | 2 +- .../ORM/Functional/Ticket/DDC599Test.php | 2 +- .../ORM/Functional/Ticket/DDC618Test.php | 2 +- .../ORM/Functional/Ticket/DDC6303Test.php | 2 +- .../ORM/Functional/Ticket/DDC633Test.php | 2 +- .../ORM/Functional/Ticket/DDC6460Test.php | 2 +- .../ORM/Functional/Ticket/DDC656Test.php | 2 +- .../ORM/Functional/Ticket/DDC657Test.php | 14 ++-- .../ORM/Functional/Ticket/DDC698Test.php | 2 +- .../ORM/Functional/Ticket/DDC719Test.php | 2 +- .../ORM/Functional/Ticket/DDC729Test.php | 2 +- .../ORM/Functional/Ticket/DDC735Test.php | 2 +- .../ORM/Functional/Ticket/DDC736Test.php | 2 +- .../ORM/Functional/Ticket/DDC742Test.php | 2 +- .../ORM/Functional/Ticket/DDC748Test.php | 2 +- .../ORM/Functional/Ticket/DDC758Test.php | 2 +- .../ORM/Functional/Ticket/DDC767Test.php | 2 +- .../ORM/Functional/Ticket/DDC809Test.php | 2 +- .../ORM/Functional/Ticket/DDC812Test.php | 2 +- .../ORM/Functional/Ticket/DDC832Test.php | 4 +- .../ORM/Functional/Ticket/DDC837Test.php | 2 +- .../ORM/Functional/Ticket/DDC849Test.php | 2 +- .../ORM/Functional/Ticket/DDC881Test.php | 3 +- .../ORM/Functional/Ticket/DDC933Test.php | 2 +- .../ORM/Functional/Ticket/DDC949Test.php | 2 +- .../ORM/Functional/Ticket/DDC960Test.php | 2 +- .../ORM/Functional/Ticket/DDC992Test.php | 2 +- .../ORM/Functional/Ticket/GH2947Test.php | 2 +- .../ORM/Functional/Ticket/GH5562Test.php | 2 +- .../ORM/Functional/Ticket/GH5762Test.php | 2 +- .../ORM/Functional/Ticket/GH5804Test.php | 2 +- .../ORM/Functional/Ticket/GH5887Test.php | 2 +- .../ORM/Functional/Ticket/GH6029Test.php | 2 +- .../ORM/Functional/Ticket/GH6141Test.php | 2 +- .../ORM/Functional/Ticket/GH6217Test.php | 2 +- .../ORM/Functional/Ticket/GH6362Test.php | 2 +- .../ORM/Functional/Ticket/GH6402Test.php | 2 +- .../ORM/Functional/Ticket/GH6531Test.php | 2 +- .../ORM/Functional/Ticket/GH6740Test.php | 2 +- .../ORM/Functional/Ticket/GH7067Test.php | 2 +- .../ORM/Functional/Ticket/GH7068Test.php | 2 +- .../ORM/Functional/Ticket/GH7629Test.php | 2 +- .../ORM/Functional/Ticket/GH7735Test.php | 2 +- .../ORM/Functional/Ticket/GH7829Test.php | 2 +- .../ORM/Functional/Ticket/GH7864Test.php | 2 +- .../ORM/Functional/Ticket/GH8229Test.php | 2 +- .../ORM/Functional/Ticket/Issue5989Test.php | 2 +- .../ORM/Functional/Ticket/Ticket2481Test.php | 2 +- .../Ticket4646InstanceOfAbstractTest.php | 2 +- .../Ticket4646InstanceOfMultiLevelTest.php | 2 +- .../Ticket4646InstanceOfParametricTest.php | 2 +- .../Ticket/Ticket4646InstanceOfTest.php | 2 +- ...46InstanceOfWithMultipleParametersTest.php | 2 +- .../Tests/ORM/Functional/Ticket/Ticket69.php | 2 +- .../Tests/ORM/Functional/TypeTest.php | 2 +- .../Tests/ORM/Functional/TypeValueSqlTest.php | 2 +- .../ORM/Functional/UUIDGeneratorTest.php | 2 +- .../Functional/UnitOfWorkLifecycleTest.php | 2 +- .../ManyToManyCompositeIdForeignKeyTest.php | 4 +- .../ManyToManyCompositeIdTest.php | 4 +- .../ManyToManyExtraLazyTest.php | 4 +- .../ValueConversionType/ManyToManyTest.php | 4 +- .../OneToManyCompositeIdForeignKeyTest.php | 4 +- .../OneToManyCompositeIdTest.php | 4 +- .../OneToManyExtraLazyTest.php | 4 +- .../ValueConversionType/OneToManyTest.php | 4 +- .../OneToOneCompositeIdForeignKeyTest.php | 4 +- .../OneToOneCompositeIdTest.php | 4 +- .../ValueConversionType/OneToOneTest.php | 4 +- .../Tests/ORM/Functional/ValueObjectsTest.php | 2 +- .../ORM/Functional/VersionedOneToOneTest.php | 2 +- .../Tests/ORM/Hydration/HydrationTestCase.php | 2 +- .../ORM/Hydration/ObjectHydratorTest.php | 47 +++++++------- .../ORM/Hydration/ResultSetMappingTest.php | 3 +- .../ORM/Hydration/ScalarHydratorTest.php | 2 +- .../Hydration/SimpleObjectHydratorTest.php | 10 ++- .../Tests/ORM/Id/AssignedGeneratorTest.php | 2 +- .../Internal/HydrationCompleteHandlerTest.php | 2 +- .../Tests/ORM/LazyCriteriaCollectionTest.php | 2 +- .../ORM/Mapping/AbstractMappingDriverTest.php | 6 +- .../ORM/Mapping/AnnotationDriverTest.php | 6 +- .../ORM/Mapping/AnsiQuoteStrategyTest.php | 2 +- .../Mapping/BasicInheritanceMappingTest.php | 3 +- .../ORM/Mapping/ClassMetadataBuilderTest.php | 2 +- .../ORM/Mapping/ClassMetadataFactoryTest.php | 6 +- .../Tests/ORM/Mapping/ClassMetadataTest.php | 59 +++++++---------- .../Mapping/EntityListenerResolverTest.php | 12 ++-- .../ORM/Mapping/PHPMappingDriverTest.php | 6 +- .../Tests/ORM/Mapping/QuoteStrategyTest.php | 2 +- .../Mapping/Symfony/AbstractDriverTest.php | 4 +- .../ORM/Mapping/Symfony/YamlDriverTest.php | 2 +- .../ORM/Mapping/XmlMappingDriverTest.php | 15 ++--- .../ORM/Mapping/YamlMappingDriverTest.php | 8 +-- .../ORM/Performance/SecondLevelCacheTest.php | 2 +- .../Tests/ORM/PersistentCollectionTest.php | 2 +- ...tyPersisterCompositeTypeParametersTest.php | 2 +- ...sicEntityPersisterCompositeTypeSqlTest.php | 6 +- .../BasicEntityPersisterTypeValueSqlTest.php | 2 +- .../JoinedSubclassPersisterTest.php | 2 +- .../Tests/ORM/Proxy/ProxyFactoryTest.php | 2 +- .../ORM/Query/CustomTreeWalkersJoinTest.php | 2 +- .../Tests/ORM/Query/CustomTreeWalkersTest.php | 2 +- .../ORM/Query/DeleteSqlGenerationTest.php | 3 +- tests/Doctrine/Tests/ORM/Query/ExprTest.php | 6 +- .../Tests/ORM/Query/FilterCollectionTest.php | 6 +- .../ORM/Query/LanguageRecognitionTest.php | 2 +- tests/Doctrine/Tests/ORM/Query/LexerTest.php | 5 +- .../Tests/ORM/Query/ParserResultTest.php | 4 +- .../ORM/Query/QueryExpressionVisitorTest.php | 2 +- tests/Doctrine/Tests/ORM/Query/QueryTest.php | 17 ++--- .../ORM/Query/SelectSqlGenerationTest.php | 6 +- .../Tests/ORM/Query/SqlWalkerTest.php | 2 +- .../ORM/Query/UpdateSqlGenerationTest.php | 3 +- tests/Doctrine/Tests/ORM/QueryBuilderTest.php | 2 +- .../DefaultRepositoryFactoryTest.php | 2 +- .../AttachEntityListenersListenerTest.php | 8 +-- .../ClearCacheCollectionRegionCommandTest.php | 12 ++-- .../ClearCacheEntityRegionCommandTest.php | 12 ++-- .../ClearCacheQueryRegionCommandTest.php | 10 +-- .../GenerateRepositoriesCommandTest.php | 8 +-- .../Tools/Console/Command/InfoCommandTest.php | 14 ++-- .../Command/MappingDescribeCommandTest.php | 18 ++---- .../Console/Command/RunDqlCommandTest.php | 4 +- .../ORM/Tools/ConvertDoctrine1SchemaTest.php | 2 +- .../Tests/ORM/Tools/EntityGeneratorTest.php | 43 +++++++++---- .../Tools/EntityRepositoryGeneratorTest.php | 4 +- .../Tools/Pagination/PaginationTestCase.php | 2 +- .../Tools/ResolveTargetEntityListenerTest.php | 2 +- .../Tests/ORM/Tools/SchemaValidatorTest.php | 2 +- tests/Doctrine/Tests/ORM/Tools/SetupTest.php | 4 +- tests/Doctrine/Tests/ORM/UnitOfWorkTest.php | 2 +- .../ORM/Utility/IdentifierFlattenerTest.php | 2 +- .../Doctrine/Tests/OrmFunctionalTestCase.php | 11 ++-- tests/Doctrine/Tests/VerifyDeprecations.php | 2 +- 374 files changed, 721 insertions(+), 724 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 2a2d4c951e..6664512c92 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -54,15 +54,22 @@ jobs: if: "${{ matrix.deps == 'low' }}" - name: "Run PHPUnit" - run: "vendor/bin/phpunit -c ci/github/phpunit/sqlite.xml" + run: "vendor/bin/phpunit -c ci/github/phpunit/sqlite.xml --coverage-clover=coverage-no-cache.xml" env: ENABLE_SECOND_LEVEL_CACHE: 0 - name: "Run PHPUnit with Second Level Cache" - run: "vendor/bin/phpunit -c ci/github/phpunit/sqlite.xml --exclude-group performance,non-cacheable,locking_functional" + run: "vendor/bin/phpunit -c ci/github/phpunit/sqlite.xml --exclude-group performance,non-cacheable,locking_functional --coverage-clover=coverage-cache.xml" env: ENABLE_SECOND_LEVEL_CACHE: 1 + - name: "Upload coverage file" + uses: "actions/upload-artifact@v2" + with: + name: "phpunit-sqlite-${{ matrix.deps }}-${{ matrix.php-version }}-coverage" + path: "coverage*.xml" + + phpunit-postgres: name: "PHPUnit with PostgreSQL" runs-on: "ubuntu-20.04" @@ -112,7 +119,14 @@ jobs: run: "composer update --no-interaction --no-progress --no-suggest" - name: "Run PHPUnit" - run: "vendor/bin/phpunit -c ci/github/phpunit/pdo_pgsql.xml" + run: "vendor/bin/phpunit -c ci/github/phpunit/pdo_pgsql.xml --coverage-clover=coverage.xml" + + - name: "Upload coverage file" + uses: "actions/upload-artifact@v2" + with: + name: "${{ github.job }}-${{ matrix.postgres-version }}-${{ matrix.php-version }}-coverage" + path: "coverage.xml" + phpunit-mariadb: name: "PHPUnit with MariaDB" @@ -167,7 +181,14 @@ jobs: run: "composer update --no-interaction --no-progress --no-suggest" - name: "Run PHPUnit" - run: "vendor/bin/phpunit -c ci/github/phpunit/${{ matrix.extension }}.xml" + run: "vendor/bin/phpunit -c ci/github/phpunit/${{ matrix.extension }}.xml --coverage-clover=coverage.xml" + + - name: "Upload coverage file" + uses: "actions/upload-artifact@v2" + with: + name: "${{ github.job }}-${{ matrix.mariadb-version }}-${{ matrix.extension }}-${{ matrix.php-version }}-coverage" + path: "coverage.xml" + phpunit-mysql: name: "PHPUnit with MySQL" @@ -222,11 +243,42 @@ jobs: run: "composer update --no-interaction --no-progress --no-suggest" - name: "Run PHPUnit" - run: "vendor/bin/phpunit -c ci/github/phpunit/${{ matrix.extension }}.xml" + run: "vendor/bin/phpunit -c ci/github/phpunit/${{ matrix.extension }}.xml --coverage-clover=coverage-no-cache.xml" env: ENABLE_SECOND_LEVEL_CACHE: 0 - name: "Run PHPUnit with Second Level Cache" - run: "vendor/bin/phpunit -c ci/github/phpunit/${{ matrix.extension }}.xml --exclude-group performance,non-cacheable,locking_functional" + run: "vendor/bin/phpunit -c ci/github/phpunit/${{ matrix.extension }}.xml --exclude-group performance,non-cacheable,locking_functional --coverage-clover=coverage-no-cache.xml" env: ENABLE_SECOND_LEVEL_CACHE: 1 + + - name: "Upload coverage files" + uses: "actions/upload-artifact@v2" + with: + name: "${{ github.job }}-${{ matrix.mysql-version }}-${{ matrix.extension }}-${{ matrix.php-version }}-coverage" + path: "coverage*.xml" + + upload_coverage: + name: "Upload coverage to Codecov" + runs-on: "ubuntu-20.04" + needs: + - "phpunit-smoke-check" + - "phpunit-postgres" + - "phpunit-mariadb" + - "phpunit-mysql" + + steps: + - name: "Checkout" + uses: "actions/checkout@v2" + with: + fetch-depth: 2 + + - name: "Download coverage files" + uses: "actions/download-artifact@v2" + with: + path: "reports" + + - name: "Upload to Codecov" + uses: "codecov/codecov-action@v1" + with: + directory: reports diff --git a/.gitignore b/.gitignore index 729e78aa48..5376ff2462 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,4 @@ vendor/ /tests/Doctrine/Performance/history.db /.phpcs-cache composer.lock +/.phpunit.result.cache diff --git a/ci/github/phpunit/mysqli.xml b/ci/github/phpunit/mysqli.xml index 00b367117f..e94fd13598 100644 --- a/ci/github/phpunit/mysqli.xml +++ b/ci/github/phpunit/mysqli.xml @@ -24,11 +24,11 @@ - - + + ../../../lib/Doctrine - - + + diff --git a/ci/github/phpunit/pdo_mysql.xml b/ci/github/phpunit/pdo_mysql.xml index bb4ac109d9..4e7b131638 100644 --- a/ci/github/phpunit/pdo_mysql.xml +++ b/ci/github/phpunit/pdo_mysql.xml @@ -24,11 +24,12 @@ - - + + ../../../lib/Doctrine - - + + + diff --git a/ci/github/phpunit/pdo_pgsql.xml b/ci/github/phpunit/pdo_pgsql.xml index cfa5a7c543..b980fb94e0 100644 --- a/ci/github/phpunit/pdo_pgsql.xml +++ b/ci/github/phpunit/pdo_pgsql.xml @@ -24,11 +24,11 @@ - - + + ../../../lib/Doctrine - - + + diff --git a/ci/github/phpunit/sqlite.xml b/ci/github/phpunit/sqlite.xml index 9fe6392112..edadb0c088 100644 --- a/ci/github/phpunit/sqlite.xml +++ b/ci/github/phpunit/sqlite.xml @@ -18,11 +18,11 @@ - - + + ../../../lib/Doctrine - - + + diff --git a/composer.json b/composer.json index 5e0d9197a8..31cfc4f8cf 100644 --- a/composer.json +++ b/composer.json @@ -34,7 +34,7 @@ "require-dev": { "doctrine/coding-standard": "^6.0", "phpstan/phpstan": "^0.12.18", - "phpunit/phpunit": "^7.5", + "phpunit/phpunit": "^8.0", "symfony/yaml": "^3.4|^4.0|^5.0", "vimeo/psalm": "^3.11" }, diff --git a/tests/Doctrine/Tests/DbalFunctionalTestCase.php b/tests/Doctrine/Tests/DbalFunctionalTestCase.php index 0be58edf34..c566e0e1dd 100644 --- a/tests/Doctrine/Tests/DbalFunctionalTestCase.php +++ b/tests/Doctrine/Tests/DbalFunctionalTestCase.php @@ -25,10 +25,7 @@ protected function resetSharedConn() self::$_sharedConn = null; } - /** - * @return void - */ - protected function setUp() + protected function setUp() : void { if (isset($this->sharedFixture['conn'])) { $this->_conn = $this->sharedFixture['conn']; diff --git a/tests/Doctrine/Tests/Mapping/UnderscoreNamingStrategyTest.php b/tests/Doctrine/Tests/Mapping/UnderscoreNamingStrategyTest.php index 589dc7fd7e..ed7a351c66 100644 --- a/tests/Doctrine/Tests/Mapping/UnderscoreNamingStrategyTest.php +++ b/tests/Doctrine/Tests/Mapping/UnderscoreNamingStrategyTest.php @@ -16,7 +16,7 @@ final class UnderscoreNamingStrategyTest extends TestCase /** @test */ public function checkDeprecationMessage() : void { - $this->expectDeprecationMessage('Creating Doctrine\ORM\Mapping\UnderscoreNamingStrategy without making it number aware is deprecated and will be removed in Doctrine ORM 3.0.'); + $this->expectDeprecationMessageSame('Creating Doctrine\ORM\Mapping\UnderscoreNamingStrategy without making it number aware is deprecated and will be removed in Doctrine ORM 3.0.'); new UnderscoreNamingStrategy(CASE_LOWER, false); } } diff --git a/tests/Doctrine/Tests/ORM/Cache/AbstractRegionTest.php b/tests/Doctrine/Tests/ORM/Cache/AbstractRegionTest.php index 665978f01d..4126e316d0 100644 --- a/tests/Doctrine/Tests/ORM/Cache/AbstractRegionTest.php +++ b/tests/Doctrine/Tests/ORM/Cache/AbstractRegionTest.php @@ -22,7 +22,7 @@ abstract class AbstractRegionTest extends OrmFunctionalTestCase */ protected $cache; - protected function setUp() + protected function setUp() : void { parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Cache/CacheConfigTest.php b/tests/Doctrine/Tests/ORM/Cache/CacheConfigTest.php index 4c016df1fc..e77eb8f3b3 100644 --- a/tests/Doctrine/Tests/ORM/Cache/CacheConfigTest.php +++ b/tests/Doctrine/Tests/ORM/Cache/CacheConfigTest.php @@ -25,7 +25,7 @@ class CacheConfigTest extends DoctrineTestCase /** * {@inheritDoc} */ - protected function setUp() + protected function setUp() : void { parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Cache/CacheLoggerChainTest.php b/tests/Doctrine/Tests/ORM/Cache/CacheLoggerChainTest.php index a070237a20..2c54b40071 100644 --- a/tests/Doctrine/Tests/ORM/Cache/CacheLoggerChainTest.php +++ b/tests/Doctrine/Tests/ORM/Cache/CacheLoggerChainTest.php @@ -25,7 +25,7 @@ class CacheLoggerChainTest extends DoctrineTestCase */ private $mock; - protected function setUp() + protected function setUp() : void { parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Cache/DefaultCacheFactoryTest.php b/tests/Doctrine/Tests/ORM/Cache/DefaultCacheFactoryTest.php index 4ff2edc1cf..b83fdff052 100644 --- a/tests/Doctrine/Tests/ORM/Cache/DefaultCacheFactoryTest.php +++ b/tests/Doctrine/Tests/ORM/Cache/DefaultCacheFactoryTest.php @@ -47,7 +47,7 @@ class DefaultCacheFactoryTest extends OrmTestCase */ private $regionsConfig; - protected function setUp() + protected function setUp() : void { $this->enableSecondLevelCache(); parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Cache/DefaultCacheTest.php b/tests/Doctrine/Tests/ORM/Cache/DefaultCacheTest.php index cbc9d8e8b7..7d73e99a0c 100644 --- a/tests/Doctrine/Tests/ORM/Cache/DefaultCacheTest.php +++ b/tests/Doctrine/Tests/ORM/Cache/DefaultCacheTest.php @@ -28,7 +28,7 @@ class DefaultCacheTest extends OrmTestCase */ private $em; - protected function setUp() + protected function setUp() : void { parent::enableSecondLevelCache(); parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Cache/DefaultCollectionHydratorTest.php b/tests/Doctrine/Tests/ORM/Cache/DefaultCollectionHydratorTest.php index f2a35b16a9..cff757d66a 100644 --- a/tests/Doctrine/Tests/ORM/Cache/DefaultCollectionHydratorTest.php +++ b/tests/Doctrine/Tests/ORM/Cache/DefaultCollectionHydratorTest.php @@ -24,7 +24,7 @@ class DefaultCollectionHydratorTest extends OrmFunctionalTestCase */ private $structure; - protected function setUp() + protected function setUp() : void { $this->enableSecondLevelCache(); parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Cache/DefaultEntityHydratorTest.php b/tests/Doctrine/Tests/ORM/Cache/DefaultEntityHydratorTest.php index d58ab8a052..ca1ad99057 100644 --- a/tests/Doctrine/Tests/ORM/Cache/DefaultEntityHydratorTest.php +++ b/tests/Doctrine/Tests/ORM/Cache/DefaultEntityHydratorTest.php @@ -27,7 +27,7 @@ class DefaultEntityHydratorTest extends OrmTestCase */ private $em; - protected function setUp() + protected function setUp() : void { parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Cache/DefaultQueryCacheTest.php b/tests/Doctrine/Tests/ORM/Cache/DefaultQueryCacheTest.php index ecfcc5207f..59c23dbf73 100644 --- a/tests/Doctrine/Tests/ORM/Cache/DefaultQueryCacheTest.php +++ b/tests/Doctrine/Tests/ORM/Cache/DefaultQueryCacheTest.php @@ -46,7 +46,7 @@ class DefaultQueryCacheTest extends OrmTestCase */ private $cacheFactory; - protected function setUp() + protected function setUp() : void { parent::setUp(); @@ -640,12 +640,10 @@ public function testGetAssociationValue() $this->assertCount(1, $attractions[1]); } - /** - * @expectedException Doctrine\ORM\Cache\CacheException - * @expectedExceptionMessage Second level cache does not support scalar results. - */ public function testScalarResultException() { + $this->expectException('Doctrine\ORM\Cache\CacheException'); + $this->expectExceptionMessage('Second level cache does not support scalar results.'); $result = []; $key = new QueryCacheKey('query.key1', 0); $rsm = new ResultSetMappingBuilder($this->em); @@ -655,12 +653,10 @@ public function testScalarResultException() $this->queryCache->put($key, $rsm, $result); } - /** - * @expectedException Doctrine\ORM\Cache\CacheException - * @expectedExceptionMessage Second level cache does not support multiple root entities. - */ public function testSupportMultipleRootEntitiesException() { + $this->expectException('Doctrine\ORM\Cache\CacheException'); + $this->expectExceptionMessage('Second level cache does not support multiple root entities.'); $result = []; $key = new QueryCacheKey('query.key1', 0); $rsm = new ResultSetMappingBuilder($this->em); @@ -671,12 +667,10 @@ public function testSupportMultipleRootEntitiesException() $this->queryCache->put($key, $rsm, $result); } - /** - * @expectedException Doctrine\ORM\Cache\CacheException - * @expectedExceptionMessage Entity "Doctrine\Tests\Models\Generic\BooleanModel" not configured as part of the second-level cache. - */ public function testNotCacheableEntityException() { + $this->expectException('Doctrine\ORM\Cache\CacheException'); + $this->expectExceptionMessage('Entity "Doctrine\Tests\Models\Generic\BooleanModel" not configured as part of the second-level cache.'); $result = []; $key = new QueryCacheKey('query.key1', 0); $rsm = new ResultSetMappingBuilder($this->em); diff --git a/tests/Doctrine/Tests/ORM/Cache/FileLockRegionTest.php b/tests/Doctrine/Tests/ORM/Cache/FileLockRegionTest.php index 1162f3c6aa..f42b4f61c1 100644 --- a/tests/Doctrine/Tests/ORM/Cache/FileLockRegionTest.php +++ b/tests/Doctrine/Tests/ORM/Cache/FileLockRegionTest.php @@ -30,7 +30,7 @@ class FileLockRegionTest extends AbstractRegionTest /** * {@inheritDoc} */ - public function tearDown() + public function tearDown() : void { $this->cleanTestDirectory($this->directory); } diff --git a/tests/Doctrine/Tests/ORM/Cache/Persister/Collection/AbstractCollectionPersisterTest.php b/tests/Doctrine/Tests/ORM/Cache/Persister/Collection/AbstractCollectionPersisterTest.php index fed92a3972..69bd7497f2 100644 --- a/tests/Doctrine/Tests/ORM/Cache/Persister/Collection/AbstractCollectionPersisterTest.php +++ b/tests/Doctrine/Tests/ORM/Cache/Persister/Collection/AbstractCollectionPersisterTest.php @@ -74,7 +74,7 @@ abstract class AbstractCollectionPersisterTest extends OrmTestCase */ abstract protected function createPersister(EntityManager $em, CollectionPersister $persister, Region $region, array $mapping); - protected function setUp() + protected function setUp() : void { $this->getSharedSecondLevelCacheDriverImpl()->flushAll(); $this->enableSecondLevelCache(); diff --git a/tests/Doctrine/Tests/ORM/Cache/Persister/Entity/AbstractEntityPersisterTest.php b/tests/Doctrine/Tests/ORM/Cache/Persister/Entity/AbstractEntityPersisterTest.php index a0e3adbe51..23c7402778 100644 --- a/tests/Doctrine/Tests/ORM/Cache/Persister/Entity/AbstractEntityPersisterTest.php +++ b/tests/Doctrine/Tests/ORM/Cache/Persister/Entity/AbstractEntityPersisterTest.php @@ -45,7 +45,7 @@ abstract class AbstractEntityPersisterTest extends OrmTestCase */ abstract protected function createPersister(EntityManager $em, EntityPersister $persister, Region $region, ClassMetadata $metadata); - protected function setUp() + protected function setUp() : void { $this->getSharedSecondLevelCacheDriverImpl()->flushAll(); $this->enableSecondLevelCache(); diff --git a/tests/Doctrine/Tests/ORM/Cache/Persister/Entity/ReadOnlyCachedEntityPersisterTest.php b/tests/Doctrine/Tests/ORM/Cache/Persister/Entity/ReadOnlyCachedEntityPersisterTest.php index 716ea15cbd..2ab1e69cfb 100644 --- a/tests/Doctrine/Tests/ORM/Cache/Persister/Entity/ReadOnlyCachedEntityPersisterTest.php +++ b/tests/Doctrine/Tests/ORM/Cache/Persister/Entity/ReadOnlyCachedEntityPersisterTest.php @@ -22,12 +22,10 @@ protected function createPersister(EntityManager $em, EntityPersister $persister return new ReadOnlyCachedEntityPersister($persister, $region, $em, $metadata); } - /** - * @expectedException Doctrine\ORM\Cache\CacheException - * @expectedExceptionMessage Cannot update a readonly entity "Doctrine\Tests\Models\Cache\Country" - */ public function testInvokeUpdate() { + $this->expectException('Doctrine\ORM\Cache\CacheException'); + $this->expectExceptionMessage('Cannot update a readonly entity "Doctrine\Tests\Models\Cache\Country"'); $persister = $this->createPersisterDefault(); $entity = new Country("Foo"); diff --git a/tests/Doctrine/Tests/ORM/Cache/StatisticsCacheLoggerTest.php b/tests/Doctrine/Tests/ORM/Cache/StatisticsCacheLoggerTest.php index e9f04f350e..f38767ac34 100644 --- a/tests/Doctrine/Tests/ORM/Cache/StatisticsCacheLoggerTest.php +++ b/tests/Doctrine/Tests/ORM/Cache/StatisticsCacheLoggerTest.php @@ -19,7 +19,7 @@ class StatisticsCacheLoggerTest extends DoctrineTestCase */ private $logger; - protected function setUp() + protected function setUp() : void { parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/CommitOrderCalculatorTest.php b/tests/Doctrine/Tests/ORM/CommitOrderCalculatorTest.php index c967beb8b6..6b149cd2ce 100644 --- a/tests/Doctrine/Tests/ORM/CommitOrderCalculatorTest.php +++ b/tests/Doctrine/Tests/ORM/CommitOrderCalculatorTest.php @@ -17,7 +17,7 @@ class CommitOrderCalculatorTest extends OrmTestCase { private $_calc; - protected function setUp() + protected function setUp() : void { $this->_calc = new CommitOrderCalculator(); } @@ -98,7 +98,7 @@ public function testCommitOrdering3() ]; // We want to perform a strict comparison of the array - $this->assertContains($sorted, $correctOrders, '', false, true, true); + $this->assertContains($sorted, $correctOrders, '', false, true); } } diff --git a/tests/Doctrine/Tests/ORM/ConfigurationTest.php b/tests/Doctrine/Tests/ORM/ConfigurationTest.php index d2e839a780..13096dcc15 100644 --- a/tests/Doctrine/Tests/ORM/ConfigurationTest.php +++ b/tests/Doctrine/Tests/ORM/ConfigurationTest.php @@ -30,7 +30,7 @@ class ConfigurationTest extends TestCase */ private $configuration; - protected function setUp() + protected function setUp() : void { parent::setUp(); $this->configuration = new Configuration(); diff --git a/tests/Doctrine/Tests/ORM/Decorator/EntityManagerDecoratorTest.php b/tests/Doctrine/Tests/ORM/Decorator/EntityManagerDecoratorTest.php index f3e309af65..cacf4b4cce 100644 --- a/tests/Doctrine/Tests/ORM/Decorator/EntityManagerDecoratorTest.php +++ b/tests/Doctrine/Tests/ORM/Decorator/EntityManagerDecoratorTest.php @@ -39,7 +39,7 @@ public function ignoreDeprecationMessagesFromDoctrinePersistence() : void $this->ignoreDeprecationMessage('The Doctrine\Common\Persistence\ObjectManagerDecorator class is deprecated since doctrine/persistence 1.3 and will be removed in 2.0. Use \Doctrine\Persistence\ObjectManagerDecorator instead.'); } - public function setUp() + protected function setUp() : void { $this->wrapped = $this->createMock(EntityManagerInterface::class); } diff --git a/tests/Doctrine/Tests/ORM/EntityManagerTest.php b/tests/Doctrine/Tests/ORM/EntityManagerTest.php index 4886e78c65..e932ad82ea 100644 --- a/tests/Doctrine/Tests/ORM/EntityManagerTest.php +++ b/tests/Doctrine/Tests/ORM/EntityManagerTest.php @@ -31,7 +31,7 @@ class EntityManagerTest extends OrmTestCase */ private $_em; - function setUp() + protected function setUp() : void { parent::setUp(); $this->_em = $this->_getTestEntityManager(); @@ -314,7 +314,7 @@ public function testDeprecatedClearWithArguments() : void $entity = new Country(456, 'United Kingdom'); $this->_em->persist($entity); - $this->expectDeprecationMessage('Calling Doctrine\ORM\EntityManager::clear() with any arguments to clear specific entities is deprecated and will not be supported in Doctrine ORM 3.0.'); + $this->expectDeprecationMessageSame('Calling Doctrine\ORM\EntityManager::clear() with any arguments to clear specific entities is deprecated and will not be supported in Doctrine ORM 3.0.'); $this->_em->clear(Country::class); } @@ -323,7 +323,7 @@ public function testDeprecatedFlushWithArguments() : void $entity = new Country(456, 'United Kingdom'); $this->_em->persist($entity); - $this->expectDeprecationMessage('Calling Doctrine\ORM\EntityManager::flush() with any arguments to flush specific entities is deprecated and will not be supported in Doctrine ORM 3.0.'); + $this->expectDeprecationMessageSame('Calling Doctrine\ORM\EntityManager::flush() with any arguments to flush specific entities is deprecated and will not be supported in Doctrine ORM 3.0.'); $this->_em->flush($entity); } @@ -332,7 +332,7 @@ public function testDeprecatedMerge() : void $entity = new Country(456, 'United Kingdom'); $this->_em->persist($entity); - $this->expectDeprecationMessage('Method Doctrine\ORM\EntityManager::merge() is deprecated and will be removed in Doctrine ORM 3.0.'); + $this->expectDeprecationMessageSame('Method Doctrine\ORM\EntityManager::merge() is deprecated and will be removed in Doctrine ORM 3.0.'); $this->_em->merge($entity); } @@ -341,7 +341,7 @@ public function testDeprecatedDetach() : void $entity = new Country(456, 'United Kingdom'); $this->_em->persist($entity); - $this->expectDeprecationMessage('Method Doctrine\ORM\EntityManager::detach() is deprecated and will be removed in Doctrine ORM 3.0.'); + $this->expectDeprecationMessageSame('Method Doctrine\ORM\EntityManager::detach() is deprecated and will be removed in Doctrine ORM 3.0.'); $this->_em->detach($entity); } @@ -351,7 +351,7 @@ public function testDeprecatedCopy() : void $this->_em->persist($entity); try { - $this->expectDeprecationMessage('Method Doctrine\ORM\EntityManager::copy() is deprecated and will be removed in Doctrine ORM 3.0.'); + $this->expectDeprecationMessageSame('Method Doctrine\ORM\EntityManager::copy() is deprecated and will be removed in Doctrine ORM 3.0.'); $this->_em->copy($entity); } catch (\BadMethodCallException $e) { // do nothing diff --git a/tests/Doctrine/Tests/ORM/Functional/AdvancedAssociationTest.php b/tests/Doctrine/Tests/ORM/Functional/AdvancedAssociationTest.php index e6714500cd..140b2968bb 100644 --- a/tests/Doctrine/Tests/ORM/Functional/AdvancedAssociationTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/AdvancedAssociationTest.php @@ -13,7 +13,8 @@ */ class AdvancedAssociationTest extends OrmFunctionalTestCase { - protected function setUp() { + protected function setUp() : void + { parent::setUp(); try { $this->_schemaTool->createSchema( diff --git a/tests/Doctrine/Tests/ORM/Functional/AdvancedDqlQueryTest.php b/tests/Doctrine/Tests/ORM/Functional/AdvancedDqlQueryTest.php index a7c35412b5..ed6bf8b800 100644 --- a/tests/Doctrine/Tests/ORM/Functional/AdvancedDqlQueryTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/AdvancedDqlQueryTest.php @@ -14,7 +14,7 @@ */ class AdvancedDqlQueryTest extends OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { $this->useModelSet('company'); parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/BasicFunctionalTest.php b/tests/Doctrine/Tests/ORM/Functional/BasicFunctionalTest.php index 7f19fa8301..e22612fd3b 100644 --- a/tests/Doctrine/Tests/ORM/Functional/BasicFunctionalTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/BasicFunctionalTest.php @@ -22,7 +22,7 @@ class BasicFunctionalTest extends OrmFunctionalTestCase { use VerifyDeprecations; - protected function setUp() + protected function setUp() : void { $this->useModelSet('cms'); parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/CascadeRemoveOrderTest.php b/tests/Doctrine/Tests/ORM/Functional/CascadeRemoveOrderTest.php index 8908e51e00..da7f6bcc25 100644 --- a/tests/Doctrine/Tests/ORM/Functional/CascadeRemoveOrderTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/CascadeRemoveOrderTest.php @@ -10,7 +10,7 @@ */ class CascadeRemoveOrderTest extends OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { parent::setUp(); @@ -22,7 +22,7 @@ protected function setUp() ); } - protected function tearDown() + protected function tearDown() : void { parent::tearDown(); diff --git a/tests/Doctrine/Tests/ORM/Functional/ClassTableInheritanceTest.php b/tests/Doctrine/Tests/ORM/Functional/ClassTableInheritanceTest.php index 4ece24fa77..4d92abd244 100644 --- a/tests/Doctrine/Tests/ORM/Functional/ClassTableInheritanceTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/ClassTableInheritanceTest.php @@ -21,7 +21,7 @@ */ class ClassTableInheritanceTest extends OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { $this->useModelSet('company'); diff --git a/tests/Doctrine/Tests/ORM/Functional/ClassTableInheritanceTest2.php b/tests/Doctrine/Tests/ORM/Functional/ClassTableInheritanceTest2.php index 84949a6e3e..5fac480bd3 100644 --- a/tests/Doctrine/Tests/ORM/Functional/ClassTableInheritanceTest2.php +++ b/tests/Doctrine/Tests/ORM/Functional/ClassTableInheritanceTest2.php @@ -12,7 +12,7 @@ */ class ClassTableInheritanceTest2 extends OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { parent::setUp(); try { diff --git a/tests/Doctrine/Tests/ORM/Functional/CompositePrimaryKeyTest.php b/tests/Doctrine/Tests/ORM/Functional/CompositePrimaryKeyTest.php index 03bde6ba7c..cedd4bd6bf 100644 --- a/tests/Doctrine/Tests/ORM/Functional/CompositePrimaryKeyTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/CompositePrimaryKeyTest.php @@ -12,7 +12,7 @@ class CompositePrimaryKeyTest extends OrmFunctionalTestCase { - public function setUp() + protected function setUp() : void { $this->useModelSet('navigation'); parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/CompositePrimaryKeyWithAssociationsTest.php b/tests/Doctrine/Tests/ORM/Functional/CompositePrimaryKeyWithAssociationsTest.php index 533f611d40..a335ed464f 100644 --- a/tests/Doctrine/Tests/ORM/Functional/CompositePrimaryKeyWithAssociationsTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/CompositePrimaryKeyWithAssociationsTest.php @@ -9,7 +9,7 @@ class CompositePrimaryKeyWithAssociationsTest extends OrmFunctionalTestCase { - public function setUp() + protected function setUp() : void { $this->useModelSet('geonames'); parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/CustomFunctionsTest.php b/tests/Doctrine/Tests/ORM/Functional/CustomFunctionsTest.php index 79668b8f2c..0da3d7c239 100644 --- a/tests/Doctrine/Tests/ORM/Functional/CustomFunctionsTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/CustomFunctionsTest.php @@ -15,7 +15,7 @@ class CustomFunctionsTest extends OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { $this->useModelSet('cms'); diff --git a/tests/Doctrine/Tests/ORM/Functional/CustomIdObjectTypeTest.php b/tests/Doctrine/Tests/ORM/Functional/CustomIdObjectTypeTest.php index 08d89fa8ec..a76a5d7116 100644 --- a/tests/Doctrine/Tests/ORM/Functional/CustomIdObjectTypeTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/CustomIdObjectTypeTest.php @@ -11,7 +11,7 @@ class CustomIdObjectTypeTest extends OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { if (DBALType::hasType(CustomIdObjectType::NAME)) { DBALType::overrideType(CustomIdObjectType::NAME, CustomIdObjectType::class); diff --git a/tests/Doctrine/Tests/ORM/Functional/DatabaseDriverTest.php b/tests/Doctrine/Tests/ORM/Functional/DatabaseDriverTest.php index 5d08039e50..f0e09df533 100644 --- a/tests/Doctrine/Tests/ORM/Functional/DatabaseDriverTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/DatabaseDriverTest.php @@ -14,7 +14,7 @@ class DatabaseDriverTest extends DatabaseDriverTestCase */ protected $_sm = null; - public function setUp() + protected function setUp() : void { $this->useModelSet('cms'); parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/DefaultValuesTest.php b/tests/Doctrine/Tests/ORM/Functional/DefaultValuesTest.php index 2797ba8337..26a4f24f41 100644 --- a/tests/Doctrine/Tests/ORM/Functional/DefaultValuesTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/DefaultValuesTest.php @@ -11,7 +11,7 @@ */ class DefaultValuesTest extends OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { parent::setUp(); try { diff --git a/tests/Doctrine/Tests/ORM/Functional/DetachedEntityTest.php b/tests/Doctrine/Tests/ORM/Functional/DetachedEntityTest.php index b1a9853071..abcef89a22 100644 --- a/tests/Doctrine/Tests/ORM/Functional/DetachedEntityTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/DetachedEntityTest.php @@ -21,7 +21,7 @@ class DetachedEntityTest extends OrmFunctionalTestCase { use VerifyDeprecations; - protected function setUp() + protected function setUp() : void { $this->useModelSet('cms'); parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/EntityListenersTest.php b/tests/Doctrine/Tests/ORM/Functional/EntityListenersTest.php index 4b066933eb..a60b9abec9 100644 --- a/tests/Doctrine/Tests/ORM/Functional/EntityListenersTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/EntityListenersTest.php @@ -20,7 +20,7 @@ class EntityListenersTest extends OrmFunctionalTestCase */ private $listener; - protected function setUp() + protected function setUp() : void { $this->useModelSet('company'); parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/EntityRepositoryCriteriaTest.php b/tests/Doctrine/Tests/ORM/Functional/EntityRepositoryCriteriaTest.php index 700964b97d..fc901949c1 100644 --- a/tests/Doctrine/Tests/ORM/Functional/EntityRepositoryCriteriaTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/EntityRepositoryCriteriaTest.php @@ -14,14 +14,14 @@ */ class EntityRepositoryCriteriaTest extends OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { $this->useModelSet('generic'); $this->useModelSet('tweet'); parent::setUp(); } - public function tearDown() + public function tearDown() : void { if ($this->_em) { $this->_em->getConfiguration()->setEntityNamespaces([]); diff --git a/tests/Doctrine/Tests/ORM/Functional/EntityRepositoryTest.php b/tests/Doctrine/Tests/ORM/Functional/EntityRepositoryTest.php index 555eaff8be..ce61310fcd 100644 --- a/tests/Doctrine/Tests/ORM/Functional/EntityRepositoryTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/EntityRepositoryTest.php @@ -29,13 +29,13 @@ class EntityRepositoryTest extends OrmFunctionalTestCase { use VerifyDeprecations; - protected function setUp() + protected function setUp() : void { $this->useModelSet('cms'); parent::setUp(); } - public function tearDown() + public function tearDown() : void { if ($this->_em) { $this->_em->getConfiguration()->setEntityNamespaces([]); @@ -306,18 +306,14 @@ public function testCountBy() $this->assertSame(2, $userCount); } - /** - * @expectedException \Doctrine\ORM\ORMException - */ public function testExceptionIsThrownWhenCallingFindByWithoutParameter() { + $this->expectException('Doctrine\ORM\ORMException'); $this->_em->getRepository(CmsUser::class) ->findByStatus(); } - /** - * @expectedException \Doctrine\ORM\ORMException - */ public function testExceptionIsThrownWhenUsingInvalidFieldName() { + $this->expectException('Doctrine\ORM\ORMException'); $this->_em->getRepository(CmsUser::class) ->findByThisFieldDoesNotExist('testvalue'); } @@ -645,11 +641,11 @@ public function testDefaultRepositoryClassName() /** * @group DDC-753 - * @expectedException Doctrine\ORM\ORMException - * @expectedExceptionMessage Invalid repository class 'Doctrine\Tests\Models\DDC753\DDC753InvalidRepository'. It must be a Doctrine\Persistence\ObjectRepository. */ public function testSetDefaultRepositoryInvalidClassError() { + $this->expectException('Doctrine\ORM\ORMException'); + $this->expectExceptionMessage('Invalid repository class \'Doctrine\Tests\Models\DDC753\DDC753InvalidRepository\'. It must be a Doctrine\Persistence\ObjectRepository.'); $this->assertEquals($this->_em->getConfiguration()->getDefaultRepositoryClassName(), EntityRepository::class); $this->_em->getConfiguration()->setDefaultRepositoryClassName(DDC753InvalidRepository::class); } @@ -683,12 +679,11 @@ public function testCanRetrieveRepositoryFromClassNameWithLeadingBackslash() /** * @group DDC-1376 - * - * @expectedException Doctrine\ORM\ORMException - * @expectedExceptionMessage You cannot search for the association field 'Doctrine\Tests\Models\CMS\CmsUser#address', because it is the inverse side of an association. */ public function testInvalidOrderByAssociation() { + $this->expectException('Doctrine\ORM\ORMException'); + $this->expectExceptionMessage('You cannot search for the association field \'Doctrine\Tests\Models\CMS\CmsUser#address\', because it is the inverse side of an association.'); $this->_em->getRepository(CmsUser::class) ->findBy(['status' => 'test'], ['address' => 'ASC']); } diff --git a/tests/Doctrine/Tests/ORM/Functional/ExtraLazyCollectionTest.php b/tests/Doctrine/Tests/ORM/Functional/ExtraLazyCollectionTest.php index cfd303fcf1..34040f7b67 100644 --- a/tests/Doctrine/Tests/ORM/Functional/ExtraLazyCollectionTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/ExtraLazyCollectionTest.php @@ -35,7 +35,7 @@ class ExtraLazyCollectionTest extends OrmFunctionalTestCase private $topic; private $phonenumber; - public function setUp() + protected function setUp() : void { $this->useModelSet('tweet'); $this->useModelSet('cms'); @@ -61,7 +61,7 @@ public function setUp() $this->loadFixture(); } - public function tearDown() + public function tearDown() : void { parent::tearDown(); diff --git a/tests/Doctrine/Tests/ORM/Functional/FlushEventTest.php b/tests/Doctrine/Tests/ORM/Functional/FlushEventTest.php index b9298e3dc0..1424d60af6 100644 --- a/tests/Doctrine/Tests/ORM/Functional/FlushEventTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/FlushEventTest.php @@ -15,7 +15,7 @@ */ class FlushEventTest extends OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { $this->useModelSet('cms'); parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/GH5988Test.php b/tests/Doctrine/Tests/ORM/Functional/GH5988Test.php index 928f432320..f388b3d8bb 100644 --- a/tests/Doctrine/Tests/ORM/Functional/GH5988Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/GH5988Test.php @@ -17,7 +17,7 @@ */ final class GH5988Test extends OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/HydrationCacheTest.php b/tests/Doctrine/Tests/ORM/Functional/HydrationCacheTest.php index dc84ac4ed1..46a4870ce8 100644 --- a/tests/Doctrine/Tests/ORM/Functional/HydrationCacheTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/HydrationCacheTest.php @@ -12,7 +12,7 @@ */ class HydrationCacheTest extends OrmFunctionalTestCase { - public function setUp() + protected function setUp() : void { $this->useModelSet('cms'); diff --git a/tests/Doctrine/Tests/ORM/Functional/IdentityMapTest.php b/tests/Doctrine/Tests/ORM/Functional/IdentityMapTest.php index 15929ae270..1ab9eb8251 100644 --- a/tests/Doctrine/Tests/ORM/Functional/IdentityMapTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/IdentityMapTest.php @@ -18,7 +18,7 @@ */ class IdentityMapTest extends OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { $this->useModelSet('cms'); parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/IndexByAssociationTest.php b/tests/Doctrine/Tests/ORM/Functional/IndexByAssociationTest.php index 289e55807f..bbd49dbc81 100644 --- a/tests/Doctrine/Tests/ORM/Functional/IndexByAssociationTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/IndexByAssociationTest.php @@ -19,7 +19,7 @@ class IndexByAssociationTest extends OrmFunctionalTestCase private $bond; - public function setUp() + protected function setUp() : void { $this->useModelSet('stockexchange'); parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/JoinedTableCompositeKeyTest.php b/tests/Doctrine/Tests/ORM/Functional/JoinedTableCompositeKeyTest.php index ab5c394e02..c581fa5181 100644 --- a/tests/Doctrine/Tests/ORM/Functional/JoinedTableCompositeKeyTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/JoinedTableCompositeKeyTest.php @@ -7,17 +7,12 @@ class JoinedTableCompositeKeyTest extends OrmFunctionalTestCase { - - public function setUp() + protected function setUp() : void { $this->useModelSet('compositekeyinheritance'); parent::setUp(); - } - /** - * - */ public function testInsertWithCompositeKey() { $childEntity = new JoinedChildClass(); diff --git a/tests/Doctrine/Tests/ORM/Functional/LifecycleCallbackTest.php b/tests/Doctrine/Tests/ORM/Functional/LifecycleCallbackTest.php index e23095fe84..268070de4a 100644 --- a/tests/Doctrine/Tests/ORM/Functional/LifecycleCallbackTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/LifecycleCallbackTest.php @@ -11,7 +11,7 @@ class LifecycleCallbackTest extends OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { parent::setUp(); try { @@ -268,7 +268,7 @@ public function testCascadedEntitiesNotLoadedInPostLoadDuringIterationWithSimple break; } } - + /** * https://github.com/doctrine/orm/issues/6568 */ @@ -276,7 +276,7 @@ public function testPostLoadIsInvokedOnFetchJoinedEntities() { $entA = new LifecycleCallbackCascader(); $this->_em->persist($entA); - + $entB_1 = new LifecycleCallbackTestEntity(); $entB_2 = new LifecycleCallbackTestEntity(); @@ -496,7 +496,7 @@ public function doStuffOnPostLoad() { $this->postLoadCallbackInvoked = true; $this->postLoadEntitiesCount = count($this->entities); } - + public function getId() { return $this->id; } diff --git a/tests/Doctrine/Tests/ORM/Functional/Locking/GearmanLockTest.php b/tests/Doctrine/Tests/ORM/Functional/Locking/GearmanLockTest.php index e804a5c339..5f58f5ea3e 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Locking/GearmanLockTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/Locking/GearmanLockTest.php @@ -15,7 +15,7 @@ class GearmanLockTest extends OrmFunctionalTestCase private $maxRunTime = 0; private $articleId; - protected function setUp() + protected function setUp() : void { if (!class_exists('GearmanClient', false)) { $this->markTestSkipped('pecl/gearman is required for this test to run.'); diff --git a/tests/Doctrine/Tests/ORM/Functional/Locking/LockTest.php b/tests/Doctrine/Tests/ORM/Functional/Locking/LockTest.php index d515e95bff..9c09337940 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Locking/LockTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/Locking/LockTest.php @@ -15,7 +15,7 @@ */ class LockTest extends OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { $this->useModelSet('cms'); parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Locking/OptimisticTest.php b/tests/Doctrine/Tests/ORM/Functional/Locking/OptimisticTest.php index 8b8113b6a6..4d8711c97e 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Locking/OptimisticTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/Locking/OptimisticTest.php @@ -9,7 +9,7 @@ class OptimisticTest extends OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { parent::setUp(); @@ -120,7 +120,7 @@ public function testMultipleFlushesDoIncrementalUpdates() $this->_em->persist($test); $this->_em->flush(); - $this->assertInternalType('int', $test->getVersion()); + $this->assertIsInt($test->getVersion()); $this->assertEquals($i + 1, $test->getVersion()); } } @@ -134,7 +134,7 @@ public function testStandardInsertSetsInitialVersionValue() $this->_em->persist($test); $this->_em->flush(); - $this->assertInternalType('int', $test->getVersion()); + $this->assertIsInt($test->getVersion()); $this->assertEquals(1, $test->getVersion()); return $test; diff --git a/tests/Doctrine/Tests/ORM/Functional/ManyToManyBasicAssociationTest.php b/tests/Doctrine/Tests/ORM/Functional/ManyToManyBasicAssociationTest.php index 0436b2af76..bacacd567b 100644 --- a/tests/Doctrine/Tests/ORM/Functional/ManyToManyBasicAssociationTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/ManyToManyBasicAssociationTest.php @@ -19,7 +19,7 @@ */ class ManyToManyBasicAssociationTest extends OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { $this->useModelSet('cms'); parent::setUp(); @@ -268,7 +268,7 @@ public function testWorkWithDqlHydratedEmptyCollection() ->setParameter(1, $user->getId()) ->getSingleResult(); $this->assertEquals(0, count($newUser->groups)); - $this->assertInternalType('array', $newUser->groups->getMapping()); + $this->assertIsArray($newUser->groups->getMapping()); $newUser->addGroup($group); diff --git a/tests/Doctrine/Tests/ORM/Functional/ManyToManyBidirectionalAssociationTest.php b/tests/Doctrine/Tests/ORM/Functional/ManyToManyBidirectionalAssociationTest.php index 597e0f3c39..80e639aaf7 100644 --- a/tests/Doctrine/Tests/ORM/Functional/ManyToManyBidirectionalAssociationTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/ManyToManyBidirectionalAssociationTest.php @@ -21,7 +21,7 @@ class ManyToManyBidirectionalAssociationTest extends AbstractManyToManyAssociati private $firstCategory; private $secondCategory; - protected function setUp() + protected function setUp() : void { $this->useModelSet('ecommerce'); parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/ManyToManyEventTest.php b/tests/Doctrine/Tests/ORM/Functional/ManyToManyEventTest.php index 87283ec4bf..adf36de71b 100644 --- a/tests/Doctrine/Tests/ORM/Functional/ManyToManyEventTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/ManyToManyEventTest.php @@ -19,7 +19,7 @@ class ManyToManyEventTest extends OrmFunctionalTestCase */ private $listener; - protected function setUp() + protected function setUp() : void { $this->useModelSet('cms'); parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/ManyToManySelfReferentialAssociationTest.php b/tests/Doctrine/Tests/ORM/Functional/ManyToManySelfReferentialAssociationTest.php index 7c15c83fc9..4663033ad5 100644 --- a/tests/Doctrine/Tests/ORM/Functional/ManyToManySelfReferentialAssociationTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/ManyToManySelfReferentialAssociationTest.php @@ -21,7 +21,7 @@ class ManyToManySelfReferentialAssociationTest extends AbstractManyToManyAssocia private $firstRelated; private $secondRelated; - protected function setUp() + protected function setUp() : void { $this->useModelSet('ecommerce'); parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/ManyToManyUnidirectionalAssociationTest.php b/tests/Doctrine/Tests/ORM/Functional/ManyToManyUnidirectionalAssociationTest.php index 20e31db00d..1c94b4b942 100644 --- a/tests/Doctrine/Tests/ORM/Functional/ManyToManyUnidirectionalAssociationTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/ManyToManyUnidirectionalAssociationTest.php @@ -21,7 +21,7 @@ class ManyToManyUnidirectionalAssociationTest extends AbstractManyToManyAssociat private $firstCart; private $secondCart; - protected function setUp() + protected function setUp() : void { $this->useModelSet('ecommerce'); parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/ManyToOneOrphanRemovalTest.php b/tests/Doctrine/Tests/ORM/Functional/ManyToOneOrphanRemovalTest.php index 049edd8290..2e16cbcbc6 100644 --- a/tests/Doctrine/Tests/ORM/Functional/ManyToOneOrphanRemovalTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/ManyToOneOrphanRemovalTest.php @@ -23,7 +23,7 @@ class ManyToOneOrphanRemovalTest extends OrmFunctionalTestCase ] ]; - protected function setUp() + protected function setUp() : void { $this->useModelSet('ornemental_orphan_removal'); diff --git a/tests/Doctrine/Tests/ORM/Functional/MappedSuperclassTest.php b/tests/Doctrine/Tests/ORM/Functional/MappedSuperclassTest.php index 97c34bba33..40bf1b6039 100644 --- a/tests/Doctrine/Tests/ORM/Functional/MappedSuperclassTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/MappedSuperclassTest.php @@ -14,7 +14,8 @@ */ class MappedSuperclassTest extends OrmFunctionalTestCase { - protected function setUp() { + protected function setUp() : void + { $this->useModelSet('directorytree'); parent::setUp(); } diff --git a/tests/Doctrine/Tests/ORM/Functional/MergeCompositeToOneKeyTest.php b/tests/Doctrine/Tests/ORM/Functional/MergeCompositeToOneKeyTest.php index 54a9bc833d..f7dcb33125 100644 --- a/tests/Doctrine/Tests/ORM/Functional/MergeCompositeToOneKeyTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/MergeCompositeToOneKeyTest.php @@ -14,7 +14,7 @@ class MergeCompositeToOneKeyTest extends OrmFunctionalTestCase /** * {@inheritDoc} */ - protected function setUp() + protected function setUp() : void { parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/MergeProxiesTest.php b/tests/Doctrine/Tests/ORM/Functional/MergeProxiesTest.php index e323a19071..92750299d2 100644 --- a/tests/Doctrine/Tests/ORM/Functional/MergeProxiesTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/MergeProxiesTest.php @@ -20,7 +20,7 @@ class MergeProxiesTest extends OrmFunctionalTestCase /** * {@inheritDoc} */ - protected function setUp() + protected function setUp() : void { $this->useModelSet('generic'); diff --git a/tests/Doctrine/Tests/ORM/Functional/MergeSharedEntitiesTest.php b/tests/Doctrine/Tests/ORM/Functional/MergeSharedEntitiesTest.php index 3e2937eda9..518565c9a3 100644 --- a/tests/Doctrine/Tests/ORM/Functional/MergeSharedEntitiesTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/MergeSharedEntitiesTest.php @@ -13,7 +13,7 @@ class MergeSharedEntitiesTest extends OrmFunctionalTestCase /** * {@inheritDoc} */ - protected function setUp() + protected function setUp() : void { parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/MergeVersionedManyToOneTest.php b/tests/Doctrine/Tests/ORM/Functional/MergeVersionedManyToOneTest.php index 18e061a45e..2993374db9 100644 --- a/tests/Doctrine/Tests/ORM/Functional/MergeVersionedManyToOneTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/MergeVersionedManyToOneTest.php @@ -14,7 +14,7 @@ class MergeVersionedManyToOneTest extends OrmFunctionalTestCase { use VerifyDeprecations; - protected function setUp() + protected function setUp() : void { $this->useModelSet('versioned_many_to_one'); diff --git a/tests/Doctrine/Tests/ORM/Functional/NativeQueryTest.php b/tests/Doctrine/Tests/ORM/Functional/NativeQueryTest.php index 31c19a1cd4..d69c00109e 100644 --- a/tests/Doctrine/Tests/ORM/Functional/NativeQueryTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/NativeQueryTest.php @@ -30,7 +30,7 @@ class NativeQueryTest extends OrmFunctionalTestCase { private $platform = null; - protected function setUp() + protected function setUp() : void { $this->useModelSet('cms'); $this->useModelSet('company'); @@ -341,11 +341,9 @@ public function testAbstractClassInSingleTableInheritanceSchemaWithRSMBuilderThr $rsm->addRootEntityFromClassMetadata(CompanyContract::class, 'c'); } - /** - * @expectedException \InvalidArgumentException - */ public function testRSMBuilderThrowsExceptionOnColumnConflict() { + $this->expectException('InvalidArgumentException'); $rsm = new ResultSetMappingBuilder($this->_em); $rsm->addRootEntityFromClassMetadata(CmsUser::class, 'u'); $rsm->addJoinedEntityFromClassMetadata(CmsAddress::class, 'a', 'u', 'address'); diff --git a/tests/Doctrine/Tests/ORM/Functional/NewOperatorTest.php b/tests/Doctrine/Tests/ORM/Functional/NewOperatorTest.php index 1422dcd9a2..0a198b4085 100644 --- a/tests/Doctrine/Tests/ORM/Functional/NewOperatorTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/NewOperatorTest.php @@ -21,7 +21,7 @@ class NewOperatorTest extends OrmFunctionalTestCase */ private $fixtures; - protected function setUp() + protected function setUp() : void { $this->useModelSet('cms'); parent::setUp(); @@ -189,7 +189,7 @@ public function testShouldAssumeFromEntityNamespaceWhenNotGiven() $dql = " SELECT new CmsUserDTO(u.name, e.email, a.city) - FROM + FROM Doctrine\Tests\Models\CMS\CmsUser u JOIN u.email e @@ -1047,42 +1047,34 @@ public function testShouldSupportMultipleNewOperatorsAndMultipleScalarsWithAndWi $this->assertEquals($this->fixtures[2]->username,$result[2]['cmsUserUsername']); } - /** - * @expectedException Doctrine\ORM\Query\QueryException - * @expectedExceptionMessage [Semantical Error] line 0, col 11 near '\InvalidClass(u.name)': Error: Class "\InvalidClass" is not defined. - */ public function testInvalidClassException() { + $this->expectException('Doctrine\ORM\Query\QueryException'); + $this->expectExceptionMessage('[Semantical Error] line 0, col 11 near \'\InvalidClass(u.name)\': Error: Class "\InvalidClass" is not defined.'); $dql = "SELECT new \InvalidClass(u.name) FROM Doctrine\Tests\Models\CMS\CmsUser u"; $this->_em->createQuery($dql)->getResult(); } - /** - * @expectedException Doctrine\ORM\Query\QueryException - * @expectedExceptionMessage [Semantical Error] line 0, col 11 near '\stdClass(u.name)': Error: Class "\stdClass" has not a valid constructor. - */ public function testInvalidClassConstructorException() { + $this->expectException('Doctrine\ORM\Query\QueryException'); + $this->expectExceptionMessage('[Semantical Error] line 0, col 11 near \'\stdClass(u.name)\': Error: Class "\stdClass" has not a valid constructor.'); $dql = "SELECT new \stdClass(u.name) FROM Doctrine\Tests\Models\CMS\CmsUser u"; $this->_em->createQuery($dql)->getResult(); } - /** - * @expectedException Doctrine\ORM\Query\QueryException - * @expectedExceptionMessage [Semantical Error] line 0, col 11 near 'Doctrine\Tests\ORM\Functional\ClassWithTooMuchArgs(u.name)': Error: Number of arguments does not match with "Doctrine\Tests\ORM\Functional\ClassWithTooMuchArgs" constructor declaration. - */ public function testInvalidClassWithoutConstructorException() { + $this->expectException('Doctrine\ORM\Query\QueryException'); + $this->expectExceptionMessage('[Semantical Error] line 0, col 11 near \'Doctrine\Tests\ORM\Functional\ClassWithTooMuchArgs(u.name)\': Error: Number of arguments does not match with "Doctrine\Tests\ORM\Functional\ClassWithTooMuchArgs" constructor declaration.'); $dql = "SELECT new Doctrine\Tests\ORM\Functional\ClassWithTooMuchArgs(u.name) FROM Doctrine\Tests\Models\CMS\CmsUser u"; $this->_em->createQuery($dql)->getResult(); } - /** - * @expectedException Doctrine\ORM\Query\QueryException - * @expectedExceptionMessage [Semantical Error] line 0, col 11 near 'Doctrine\Tests\ORM\Functional\ClassWithPrivateConstructor(u.name)': Error: Class "Doctrine\Tests\ORM\Functional\ClassWithPrivateConstructor" can not be instantiated. - */ public function testClassCantBeInstantiatedException() { + $this->expectException('Doctrine\ORM\Query\QueryException'); + $this->expectExceptionMessage('[Semantical Error] line 0, col 11 near \'Doctrine\Tests\ORM\Functional\ClassWithPrivateConstructor(u.name)\': Error: Class "Doctrine\Tests\ORM\Functional\ClassWithPrivateConstructor" can not be instantiated.'); $dql = "SELECT new Doctrine\Tests\ORM\Functional\ClassWithPrivateConstructor(u.name) FROM Doctrine\Tests\Models\CMS\CmsUser u"; $this->_em->createQuery($dql)->getResult(); } diff --git a/tests/Doctrine/Tests/ORM/Functional/NotifyPolicyTest.php b/tests/Doctrine/Tests/ORM/Functional/NotifyPolicyTest.php index df23914b32..128ea1ff82 100644 --- a/tests/Doctrine/Tests/ORM/Functional/NotifyPolicyTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/NotifyPolicyTest.php @@ -14,7 +14,7 @@ */ class NotifyPolicyTest extends OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { parent::setUp(); try { diff --git a/tests/Doctrine/Tests/ORM/Functional/OneToManyBidirectionalAssociationTest.php b/tests/Doctrine/Tests/ORM/Functional/OneToManyBidirectionalAssociationTest.php index 95309c6057..91f81a72da 100644 --- a/tests/Doctrine/Tests/ORM/Functional/OneToManyBidirectionalAssociationTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/OneToManyBidirectionalAssociationTest.php @@ -18,7 +18,7 @@ class OneToManyBidirectionalAssociationTest extends OrmFunctionalTestCase private $firstFeature; private $secondFeature; - protected function setUp() + protected function setUp() : void { $this->useModelSet('ecommerce'); parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/OneToManyOrphanRemovalTest.php b/tests/Doctrine/Tests/ORM/Functional/OneToManyOrphanRemovalTest.php index da70672b6d..ff75cb4fb2 100644 --- a/tests/Doctrine/Tests/ORM/Functional/OneToManyOrphanRemovalTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/OneToManyOrphanRemovalTest.php @@ -13,7 +13,7 @@ class OneToManyOrphanRemovalTest extends OrmFunctionalTestCase { protected $userId; - protected function setUp() + protected function setUp() : void { $this->useModelSet('cms'); diff --git a/tests/Doctrine/Tests/ORM/Functional/OneToManySelfReferentialAssociationTest.php b/tests/Doctrine/Tests/ORM/Functional/OneToManySelfReferentialAssociationTest.php index c9f42237d1..be85a10392 100644 --- a/tests/Doctrine/Tests/ORM/Functional/OneToManySelfReferentialAssociationTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/OneToManySelfReferentialAssociationTest.php @@ -16,7 +16,7 @@ class OneToManySelfReferentialAssociationTest extends OrmFunctionalTestCase private $firstChild; private $secondChild; - protected function setUp() + protected function setUp() : void { $this->useModelSet('ecommerce'); parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/OneToManyUnidirectionalAssociationTest.php b/tests/Doctrine/Tests/ORM/Functional/OneToManyUnidirectionalAssociationTest.php index c13a6fe997..f521fb6dcb 100644 --- a/tests/Doctrine/Tests/ORM/Functional/OneToManyUnidirectionalAssociationTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/OneToManyUnidirectionalAssociationTest.php @@ -14,7 +14,7 @@ class OneToManyUnidirectionalAssociationTest extends OrmFunctionalTestCase { protected $locations = []; - public function setUp() + protected function setUp() : void { $this->useModelSet('routing'); parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/OneToOneBidirectionalAssociationTest.php b/tests/Doctrine/Tests/ORM/Functional/OneToOneBidirectionalAssociationTest.php index c989e126c4..83691e886e 100644 --- a/tests/Doctrine/Tests/ORM/Functional/OneToOneBidirectionalAssociationTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/OneToOneBidirectionalAssociationTest.php @@ -17,7 +17,7 @@ class OneToOneBidirectionalAssociationTest extends OrmFunctionalTestCase private $customer; private $cart; - protected function setUp() + protected function setUp() : void { $this->useModelSet('ecommerce'); parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/OneToOneEagerLoadingTest.php b/tests/Doctrine/Tests/ORM/Functional/OneToOneEagerLoadingTest.php index 5b4cdffdfe..375242352a 100644 --- a/tests/Doctrine/Tests/ORM/Functional/OneToOneEagerLoadingTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/OneToOneEagerLoadingTest.php @@ -11,7 +11,7 @@ */ class OneToOneEagerLoadingTest extends OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { parent::setUp(); $schemaTool = new SchemaTool($this->_em); diff --git a/tests/Doctrine/Tests/ORM/Functional/OneToOneInverseSideLoadAfterDqlQueryTest.php b/tests/Doctrine/Tests/ORM/Functional/OneToOneInverseSideLoadAfterDqlQueryTest.php index 85e518efa7..1ab31b7a3f 100644 --- a/tests/Doctrine/Tests/ORM/Functional/OneToOneInverseSideLoadAfterDqlQueryTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/OneToOneInverseSideLoadAfterDqlQueryTest.php @@ -11,7 +11,7 @@ class OneToOneInverseSideLoadAfterDqlQueryTest extends OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/OneToOneOrphanRemovalTest.php b/tests/Doctrine/Tests/ORM/Functional/OneToOneOrphanRemovalTest.php index 09ef64e021..d99acc34b0 100644 --- a/tests/Doctrine/Tests/ORM/Functional/OneToOneOrphanRemovalTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/OneToOneOrphanRemovalTest.php @@ -12,7 +12,7 @@ */ class OneToOneOrphanRemovalTest extends OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { $this->useModelSet('cms'); diff --git a/tests/Doctrine/Tests/ORM/Functional/OneToOneSelfReferentialAssociationTest.php b/tests/Doctrine/Tests/ORM/Functional/OneToOneSelfReferentialAssociationTest.php index 0011e8c8c4..cf15e7d6e0 100644 --- a/tests/Doctrine/Tests/ORM/Functional/OneToOneSelfReferentialAssociationTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/OneToOneSelfReferentialAssociationTest.php @@ -20,7 +20,7 @@ class OneToOneSelfReferentialAssociationTest extends OrmFunctionalTestCase private $customer; private $mentor; - protected function setUp() + protected function setUp() : void { $this->useModelSet('ecommerce'); parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/OneToOneSingleTableInheritanceTest.php b/tests/Doctrine/Tests/ORM/Functional/OneToOneSingleTableInheritanceTest.php index 3e9a291f00..b20ab90821 100644 --- a/tests/Doctrine/Tests/ORM/Functional/OneToOneSingleTableInheritanceTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/OneToOneSingleTableInheritanceTest.php @@ -10,7 +10,7 @@ class OneToOneSingleTableInheritanceTest extends OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/OneToOneUnidirectionalAssociationTest.php b/tests/Doctrine/Tests/ORM/Functional/OneToOneUnidirectionalAssociationTest.php index 797a38517d..2d967167a8 100644 --- a/tests/Doctrine/Tests/ORM/Functional/OneToOneUnidirectionalAssociationTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/OneToOneUnidirectionalAssociationTest.php @@ -18,7 +18,7 @@ class OneToOneUnidirectionalAssociationTest extends OrmFunctionalTestCase private $product; private $shipping; - protected function setUp() + protected function setUp() : void { $this->useModelSet('ecommerce'); parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/OrderedCollectionTest.php b/tests/Doctrine/Tests/ORM/Functional/OrderedCollectionTest.php index aa4fb1da0f..00de0cd05a 100644 --- a/tests/Doctrine/Tests/ORM/Functional/OrderedCollectionTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/OrderedCollectionTest.php @@ -12,7 +12,7 @@ class OrderedCollectionTest extends OrmFunctionalTestCase { protected $locations = []; - public function setUp() + protected function setUp() : void { $this->useModelSet('routing'); parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/OrderedJoinedTableInheritanceCollectionTest.php b/tests/Doctrine/Tests/ORM/Functional/OrderedJoinedTableInheritanceCollectionTest.php index 30531bae98..166187af97 100644 --- a/tests/Doctrine/Tests/ORM/Functional/OrderedJoinedTableInheritanceCollectionTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/OrderedJoinedTableInheritanceCollectionTest.php @@ -12,7 +12,7 @@ */ class OrderedJoinedTableInheritanceCollectionTest extends OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { parent::setUp(); try { diff --git a/tests/Doctrine/Tests/ORM/Functional/PaginationTest.php b/tests/Doctrine/Tests/ORM/Functional/PaginationTest.php index 9f200cb8e9..36959743ee 100644 --- a/tests/Doctrine/Tests/ORM/Functional/PaginationTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/PaginationTest.php @@ -26,7 +26,7 @@ */ class PaginationTest extends OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { $this->useModelSet('cms'); $this->useModelSet('pagination'); @@ -711,14 +711,16 @@ public function testCountQueryStripsParametersInSelect() public function testPaginationWithSubSelectOrderByExpression($useOutputWalker, $fetchJoinCollection) { $query = $this->_em->createQuery( - "SELECT u, + <<<'SQL' + SELECT u, ( SELECT MAX(a.version) - FROM Doctrine\\Tests\\Models\\CMS\\CmsArticle a + FROM Doctrine\Tests\Models\CMS\CmsArticle a WHERE a.user = u ) AS HIDDEN max_version - FROM Doctrine\\Tests\\Models\\CMS\\CmsUser u - ORDER BY max_version DESC" + FROM Doctrine\Tests\Models\CMS\CmsUser u + ORDER BY max_version DESC +SQL ); $paginator = new Paginator($query, $fetchJoinCollection); diff --git a/tests/Doctrine/Tests/ORM/Functional/PersistentCollectionCriteriaTest.php b/tests/Doctrine/Tests/ORM/Functional/PersistentCollectionCriteriaTest.php index 4e0f442d84..aea051e2c9 100644 --- a/tests/Doctrine/Tests/ORM/Functional/PersistentCollectionCriteriaTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/PersistentCollectionCriteriaTest.php @@ -16,14 +16,14 @@ */ class PersistentCollectionCriteriaTest extends OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { $this->useModelSet('tweet'); $this->useModelSet('quote'); parent::setUp(); } - public function tearDown() + public function tearDown() : void { if ($this->_em) { $this->_em->getConfiguration()->setEntityNamespaces([]); diff --git a/tests/Doctrine/Tests/ORM/Functional/PersistentCollectionTest.php b/tests/Doctrine/Tests/ORM/Functional/PersistentCollectionTest.php index b1751455f3..1c9601e8b6 100644 --- a/tests/Doctrine/Tests/ORM/Functional/PersistentCollectionTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/PersistentCollectionTest.php @@ -9,7 +9,7 @@ class PersistentCollectionTest extends OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { parent::setUp(); try { diff --git a/tests/Doctrine/Tests/ORM/Functional/PersistentObjectTest.php b/tests/Doctrine/Tests/ORM/Functional/PersistentObjectTest.php index 0fd2b47455..cfbeb5041f 100644 --- a/tests/Doctrine/Tests/ORM/Functional/PersistentObjectTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/PersistentObjectTest.php @@ -13,7 +13,7 @@ */ class PersistentObjectTest extends OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/PostFlushEventTest.php b/tests/Doctrine/Tests/ORM/Functional/PostFlushEventTest.php index 12e2c40809..c2506bafbe 100644 --- a/tests/Doctrine/Tests/ORM/Functional/PostFlushEventTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/PostFlushEventTest.php @@ -19,7 +19,7 @@ class PostFlushEventTest extends OrmFunctionalTestCase */ private $listener; - protected function setUp() + protected function setUp() : void { $this->useModelSet('cms'); parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/PostLoadEventTest.php b/tests/Doctrine/Tests/ORM/Functional/PostLoadEventTest.php index 02a0866667..cfd7db235e 100644 --- a/tests/Doctrine/Tests/ORM/Functional/PostLoadEventTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/PostLoadEventTest.php @@ -25,7 +25,7 @@ class PostLoadEventTest extends OrmFunctionalTestCase /** * {@inheritdoc} */ - protected function setUp() + protected function setUp() : void { $this->useModelSet('cms'); diff --git a/tests/Doctrine/Tests/ORM/Functional/ProxiesLikeEntitiesTest.php b/tests/Doctrine/Tests/ORM/Functional/ProxiesLikeEntitiesTest.php index e88733d7db..ca29a0495c 100644 --- a/tests/Doctrine/Tests/ORM/Functional/ProxiesLikeEntitiesTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/ProxiesLikeEntitiesTest.php @@ -27,7 +27,7 @@ class ProxiesLikeEntitiesTest extends OrmFunctionalTestCase */ protected $user; - protected function setUp() + protected function setUp() : void { parent::setUp(); try { @@ -134,7 +134,7 @@ public function testFindWithProxyName() $this->_em->clear(); } - protected function tearDown() + protected function tearDown() : void { $this->_em->createQuery('DELETE FROM Doctrine\Tests\Models\CMS\CmsUser u')->execute(); } diff --git a/tests/Doctrine/Tests/ORM/Functional/QueryCacheTest.php b/tests/Doctrine/Tests/ORM/Functional/QueryCacheTest.php index a307ad1378..2124f9846e 100644 --- a/tests/Doctrine/Tests/ORM/Functional/QueryCacheTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/QueryCacheTest.php @@ -21,7 +21,7 @@ class QueryCacheTest extends OrmFunctionalTestCase */ private $cacheDataReflection; - protected function setUp() + protected function setUp() : void { $this->cacheDataReflection = new \ReflectionProperty(ArrayCache::class, "data"); $this->cacheDataReflection->setAccessible(true); diff --git a/tests/Doctrine/Tests/ORM/Functional/QueryDqlFunctionTest.php b/tests/Doctrine/Tests/ORM/Functional/QueryDqlFunctionTest.php index 50008eb693..ec326e4f83 100644 --- a/tests/Doctrine/Tests/ORM/Functional/QueryDqlFunctionTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/QueryDqlFunctionTest.php @@ -14,7 +14,7 @@ */ class QueryDqlFunctionTest extends OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { $this->useModelSet('company'); parent::setUp(); @@ -279,12 +279,12 @@ public function testDateDiff() $query = $this->_em->createQuery("SELECT DATE_DIFF(CURRENT_TIMESTAMP(), DATE_ADD(CURRENT_TIMESTAMP(), 10, 'day')) AS diff FROM Doctrine\Tests\Models\Company\CompanyManager m"); $arg = $query->getArrayResult(); - $this->assertEquals(-10, $arg[0]['diff'], "Should be roughly -10 (or -9)", 1); + $this->assertEqualsWithDelta(-10, $arg[0]['diff'], 1, 'Should be roughly -10 (or -9)'); $query = $this->_em->createQuery("SELECT DATE_DIFF(DATE_ADD(CURRENT_TIMESTAMP(), 10, 'day'), CURRENT_TIMESTAMP()) AS diff FROM Doctrine\Tests\Models\Company\CompanyManager m"); $arg = $query->getArrayResult(); - $this->assertEquals(10, $arg[0]['diff'], "Should be roughly 10 (or 9)", 1); + $this->assertEqualsWithDelta(10, $arg[0]['diff'], 1, 'Should be roughly 10 (or 9)'); } /** @@ -309,11 +309,11 @@ public function testDateAdd(string $unit, int $amount, int $delta = 0) : void self::assertArrayHasKey('now', $result); self::assertArrayHasKey('add', $result); - self::assertEquals( + self::assertEqualsWithDelta( (new \DateTimeImmutable($result['now']))->modify(sprintf('+%d %s', $amount, $unit)), new \DateTimeImmutable($result['add']), - '', - $delta + $delta, + '' ); } @@ -339,11 +339,11 @@ public function testDateSub(string $unit, int $amount, int $delta = 0) : void self::assertArrayHasKey('now', $result); self::assertArrayHasKey('sub', $result); - self::assertEquals( + self::assertEqualsWithDelta( (new \DateTimeImmutable($result['now']))->modify(sprintf('-%d %s', $amount, $unit)), new \DateTimeImmutable($result['sub']), - '', - $delta + $delta, + '' ); } diff --git a/tests/Doctrine/Tests/ORM/Functional/QueryTest.php b/tests/Doctrine/Tests/ORM/Functional/QueryTest.php index f25cd33faa..ae9d2f8b09 100644 --- a/tests/Doctrine/Tests/ORM/Functional/QueryTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/QueryTest.php @@ -23,7 +23,7 @@ */ class QueryTest extends OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { $this->useModelSet('cms'); @@ -315,38 +315,30 @@ public function testIterateResultClearEveryCycle() $this->_em->flush(); } - /** - * @expectedException \Doctrine\ORM\Query\QueryException - */ public function testIterateResult_FetchJoinedCollection_ThrowsException() { + $this->expectException('Doctrine\ORM\Query\QueryException'); $query = $this->_em->createQuery("SELECT u, a FROM ' . CmsUser::class . ' u JOIN u.articles a"); $articles = $query->iterate(); } - /** - * @expectedException Doctrine\ORM\NoResultException - */ public function testGetSingleResultThrowsExceptionOnNoResult() { + $this->expectException('Doctrine\ORM\NoResultException'); $this->_em->createQuery("select a from Doctrine\Tests\Models\CMS\CmsArticle a") ->getSingleResult(); } - /** - * @expectedException Doctrine\ORM\NoResultException - */ public function testGetSingleScalarResultThrowsExceptionOnNoResult() { + $this->expectException('Doctrine\ORM\NoResultException'); $this->_em->createQuery("select a from Doctrine\Tests\Models\CMS\CmsArticle a") ->getSingleScalarResult(); } - /** - * @expectedException Doctrine\ORM\NonUniqueResultException - */ public function testGetSingleScalarResultThrowsExceptionOnNonUniqueResult() { + $this->expectException('Doctrine\ORM\NonUniqueResultException'); $user = new CmsUser; $user->name = 'Guilherme'; $user->username = 'gblanco'; diff --git a/tests/Doctrine/Tests/ORM/Functional/ReadOnlyTest.php b/tests/Doctrine/Tests/ORM/Functional/ReadOnlyTest.php index a664a4df25..570a56d625 100644 --- a/tests/Doctrine/Tests/ORM/Functional/ReadOnlyTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/ReadOnlyTest.php @@ -11,7 +11,7 @@ */ class ReadOnlyTest extends OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/ReferenceProxyTest.php b/tests/Doctrine/Tests/ORM/Functional/ReferenceProxyTest.php index d2e0e82725..a59903054c 100644 --- a/tests/Doctrine/Tests/ORM/Functional/ReferenceProxyTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/ReferenceProxyTest.php @@ -17,7 +17,7 @@ */ class ReferenceProxyTest extends OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { $this->useModelSet('ecommerce'); $this->useModelSet('company'); diff --git a/tests/Doctrine/Tests/ORM/Functional/ResultCacheTest.php b/tests/Doctrine/Tests/ORM/Functional/ResultCacheTest.php index cffe07fe7d..b74b82cbda 100644 --- a/tests/Doctrine/Tests/ORM/Functional/ResultCacheTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/ResultCacheTest.php @@ -22,7 +22,8 @@ class ResultCacheTest extends OrmFunctionalTestCase */ private $cacheDataReflection; - protected function setUp() { + protected function setUp() : void + { $this->cacheDataReflection = new \ReflectionProperty(ArrayCache::class, "data"); $this->cacheDataReflection->setAccessible(true); $this->useModelSet('cms'); diff --git a/tests/Doctrine/Tests/ORM/Functional/SQLFilterTest.php b/tests/Doctrine/Tests/ORM/Functional/SQLFilterTest.php index c35036b6e3..35b5459fc6 100644 --- a/tests/Doctrine/Tests/ORM/Functional/SQLFilterTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/SQLFilterTest.php @@ -39,14 +39,14 @@ class SQLFilterTest extends OrmFunctionalTestCase private $managerId, $managerId2, $contractId1, $contractId2; private $organizationId, $eventId1, $eventId2; - public function setUp() + protected function setUp() : void { $this->useModelSet('cms'); $this->useModelSet('company'); parent::setUp(); } - public function tearDown() + public function tearDown() : void { parent::tearDown(); diff --git a/tests/Doctrine/Tests/ORM/Functional/SchemaTool/CompanySchemaTest.php b/tests/Doctrine/Tests/ORM/Functional/SchemaTool/CompanySchemaTest.php index 1a36591cf5..614c7c29a9 100644 --- a/tests/Doctrine/Tests/ORM/Functional/SchemaTool/CompanySchemaTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/SchemaTool/CompanySchemaTest.php @@ -13,7 +13,7 @@ */ class CompanySchemaTest extends OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { $this->useModelSet('company'); parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/SchemaTool/DBAL483Test.php b/tests/Doctrine/Tests/ORM/Functional/SchemaTool/DBAL483Test.php index 8a874c478a..9fe5c602f7 100644 --- a/tests/Doctrine/Tests/ORM/Functional/SchemaTool/DBAL483Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/SchemaTool/DBAL483Test.php @@ -7,7 +7,7 @@ class DBAL483Test extends OrmFunctionalTestCase { - public function setUp() + protected function setUp() : void { parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/SchemaTool/DDC214Test.php b/tests/Doctrine/Tests/ORM/Functional/SchemaTool/DDC214Test.php index 8c414b119a..d38fcb51b4 100644 --- a/tests/Doctrine/Tests/ORM/Functional/SchemaTool/DDC214Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/SchemaTool/DDC214Test.php @@ -15,7 +15,7 @@ class DDC214Test extends OrmFunctionalTestCase private $classes = []; private $schemaTool = null; - public function setUp() + protected function setUp() : void { parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/SchemaTool/MySqlSchemaToolTest.php b/tests/Doctrine/Tests/ORM/Functional/SchemaTool/MySqlSchemaToolTest.php index 829b3aa2b8..3a1578e28c 100644 --- a/tests/Doctrine/Tests/ORM/Functional/SchemaTool/MySqlSchemaToolTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/SchemaTool/MySqlSchemaToolTest.php @@ -10,7 +10,8 @@ class MySqlSchemaToolTest extends OrmFunctionalTestCase { - protected function setUp() { + protected function setUp() : void + { parent::setUp(); if ($this->_em->getConnection()->getDatabasePlatform()->getName() !== 'mysql') { $this->markTestSkipped('The ' . __CLASS__ .' requires the use of mysql.'); diff --git a/tests/Doctrine/Tests/ORM/Functional/SchemaTool/PostgreSqlSchemaToolTest.php b/tests/Doctrine/Tests/ORM/Functional/SchemaTool/PostgreSqlSchemaToolTest.php index 5ebf84c564..b1ba7d10f3 100644 --- a/tests/Doctrine/Tests/ORM/Functional/SchemaTool/PostgreSqlSchemaToolTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/SchemaTool/PostgreSqlSchemaToolTest.php @@ -8,7 +8,7 @@ class PostgreSqlSchemaToolTest extends OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/SchemaValidatorTest.php b/tests/Doctrine/Tests/ORM/Functional/SchemaValidatorTest.php index 5ab0f07c07..14032646b2 100644 --- a/tests/Doctrine/Tests/ORM/Functional/SchemaValidatorTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/SchemaValidatorTest.php @@ -16,7 +16,7 @@ */ class SchemaValidatorTest extends OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { $this->registerType(CustomIdObjectType::class); $this->registerType(UpperCaseStringType::class); diff --git a/tests/Doctrine/Tests/ORM/Functional/SecondLevelCacheAbstractTest.php b/tests/Doctrine/Tests/ORM/Functional/SecondLevelCacheAbstractTest.php index becf7edbb4..e6ed7d7974 100644 --- a/tests/Doctrine/Tests/ORM/Functional/SecondLevelCacheAbstractTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/SecondLevelCacheAbstractTest.php @@ -43,7 +43,7 @@ abstract class SecondLevelCacheAbstractTest extends OrmFunctionalTestCase */ protected $cache; - protected function setUp() + protected function setUp() : void { $this->enableSecondLevelCache(); diff --git a/tests/Doctrine/Tests/ORM/Functional/SecondLevelCacheCompositePrimaryKeyWithAssociationsTest.php b/tests/Doctrine/Tests/ORM/Functional/SecondLevelCacheCompositePrimaryKeyWithAssociationsTest.php index 8af09c9bf0..8cfb8245fe 100644 --- a/tests/Doctrine/Tests/ORM/Functional/SecondLevelCacheCompositePrimaryKeyWithAssociationsTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/SecondLevelCacheCompositePrimaryKeyWithAssociationsTest.php @@ -15,7 +15,7 @@ class SecondLevelCacheCompositePrimaryKeyWithAssociationsTest extends OrmFunctio */ protected $cache; - public function setUp() + protected function setUp() : void { $this->enableSecondLevelCache(); $this->useModelSet('geonames'); diff --git a/tests/Doctrine/Tests/ORM/Functional/SecondLevelCacheConcurrentTest.php b/tests/Doctrine/Tests/ORM/Functional/SecondLevelCacheConcurrentTest.php index 0f4ca38328..cafd16a872 100644 --- a/tests/Doctrine/Tests/ORM/Functional/SecondLevelCacheConcurrentTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/SecondLevelCacheConcurrentTest.php @@ -26,7 +26,7 @@ class SecondLevelCacheConcurrentTest extends SecondLevelCacheAbstractTest private $countryMetadata; - protected function setUp() + protected function setUp() : void { $this->enableSecondLevelCache(); parent::setUp(); @@ -45,7 +45,7 @@ protected function setUp() $this->_em->getMetadataFactory()->setMetadataFor(Country::class, $countryMetadata); } - protected function tearDown() + protected function tearDown() : void { parent::tearDown(); diff --git a/tests/Doctrine/Tests/ORM/Functional/SecondLevelCacheExtraLazyCollectionTest.php b/tests/Doctrine/Tests/ORM/Functional/SecondLevelCacheExtraLazyCollectionTest.php index 75499ac302..9f438d6bc2 100644 --- a/tests/Doctrine/Tests/ORM/Functional/SecondLevelCacheExtraLazyCollectionTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/SecondLevelCacheExtraLazyCollectionTest.php @@ -12,7 +12,7 @@ */ class SecondLevelCacheExtraLazyCollectionTest extends SecondLevelCacheAbstractTest { - public function setUp() + protected function setUp() : void { parent::setUp(); @@ -23,7 +23,7 @@ public function setUp() $targetEntity->associationMappings['travels']['fetch'] = ClassMetadata::FETCH_EXTRA_LAZY; } - public function tearDown() + public function tearDown() : void { parent::tearDown(); diff --git a/tests/Doctrine/Tests/ORM/Functional/SecondLevelCacheManyToManyTest.php b/tests/Doctrine/Tests/ORM/Functional/SecondLevelCacheManyToManyTest.php index efe19f3e07..35bed89efb 100644 --- a/tests/Doctrine/Tests/ORM/Functional/SecondLevelCacheManyToManyTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/SecondLevelCacheManyToManyTest.php @@ -186,12 +186,10 @@ public function testStoreManyToManyAssociationWhitCascade() $this->assertEquals($queryCount1, $this->getCurrentQueryCount()); } - /** - * @expectedException \Doctrine\ORM\Cache\CacheException - * @expectedExceptionMessage Cannot update a readonly collection "Doctrine\Tests\Models\Cache\Travel#visitedCities - */ public function testReadOnlyCollection() { + $this->expectException('Doctrine\ORM\Cache\CacheException'); + $this->expectExceptionMessage('Cannot update a readonly collection "Doctrine\Tests\Models\Cache\Travel#visitedCities'); $this->evictRegions(); $this->loadFixturesCountries(); diff --git a/tests/Doctrine/Tests/ORM/Functional/SecondLevelCacheQueryCacheTest.php b/tests/Doctrine/Tests/ORM/Functional/SecondLevelCacheQueryCacheTest.php index 56188ade6c..5e7ca59f3d 100644 --- a/tests/Doctrine/Tests/ORM/Functional/SecondLevelCacheQueryCacheTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/SecondLevelCacheQueryCacheTest.php @@ -1085,12 +1085,10 @@ public function testHintClearEntityRegionDeleteStatement() $this->assertFalse($this->cache->containsEntity(Country::class, $this->countries[1]->getId())); } - /** - * @expectedException \Doctrine\ORM\Cache\CacheException - * @expectedExceptionMessage Second level cache does not support partial entities. - */ public function testCacheablePartialQueryException() { + $this->expectException('Doctrine\ORM\Cache\CacheException'); + $this->expectExceptionMessage('Second level cache does not support partial entities.'); $this->evictRegions(); $this->loadFixturesCountries(); @@ -1099,12 +1097,10 @@ public function testCacheablePartialQueryException() ->getResult(); } - /** - * @expectedException \Doctrine\ORM\Cache\CacheException - * @expectedExceptionMessage Second level cache does not support partial entities. - */ public function testCacheableForcePartialLoadHintQueryException() { + $this->expectException('Doctrine\ORM\Cache\CacheException'); + $this->expectExceptionMessage('Second level cache does not support partial entities.'); $this->evictRegions(); $this->loadFixturesCountries(); @@ -1114,23 +1110,19 @@ public function testCacheableForcePartialLoadHintQueryException() ->getResult(); } - /** - * @expectedException \Doctrine\ORM\Cache\CacheException - * @expectedExceptionMessage Second-level cache query supports only select statements. - */ public function testNonCacheableQueryDeleteStatementException() { + $this->expectException('Doctrine\ORM\Cache\CacheException'); + $this->expectExceptionMessage('Second-level cache query supports only select statements.'); $this->_em->createQuery("DELETE Doctrine\Tests\Models\Cache\Country u WHERE u.id = 4") ->setCacheable(true) ->getResult(); } - /** - * @expectedException \Doctrine\ORM\Cache\CacheException - * @expectedExceptionMessage Second-level cache query supports only select statements. - */ public function testNonCacheableQueryUpdateStatementException() { + $this->expectException('Doctrine\ORM\Cache\CacheException'); + $this->expectExceptionMessage('Second-level cache query supports only select statements.'); $this->_em->createQuery("UPDATE Doctrine\Tests\Models\Cache\Country u SET u.name = 'foo' WHERE u.id = 4") ->setCacheable(true) ->getResult(); diff --git a/tests/Doctrine/Tests/ORM/Functional/SequenceEmulatedIdentityStrategyTest.php b/tests/Doctrine/Tests/ORM/Functional/SequenceEmulatedIdentityStrategyTest.php index d425936f5b..03b764c4aa 100644 --- a/tests/Doctrine/Tests/ORM/Functional/SequenceEmulatedIdentityStrategyTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/SequenceEmulatedIdentityStrategyTest.php @@ -10,7 +10,7 @@ class SequenceEmulatedIdentityStrategyTest extends OrmFunctionalTestCase /** * {@inheritdoc} */ - protected function setUp() + protected function setUp() : void { parent::setUp(); @@ -32,7 +32,7 @@ protected function setUp() /** * {@inheritdoc} */ - protected function tearDown() + protected function tearDown() : void { parent::tearDown(); diff --git a/tests/Doctrine/Tests/ORM/Functional/SequenceGeneratorTest.php b/tests/Doctrine/Tests/ORM/Functional/SequenceGeneratorTest.php index 290984f358..f313d7162e 100644 --- a/tests/Doctrine/Tests/ORM/Functional/SequenceGeneratorTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/SequenceGeneratorTest.php @@ -10,7 +10,7 @@ */ class SequenceGeneratorTest extends OrmFunctionalTestCase { - public function setUp() + protected function setUp() : void { parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/SingleTableCompositeKeyTest.php b/tests/Doctrine/Tests/ORM/Functional/SingleTableCompositeKeyTest.php index 091c79f541..c61290bae3 100644 --- a/tests/Doctrine/Tests/ORM/Functional/SingleTableCompositeKeyTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/SingleTableCompositeKeyTest.php @@ -7,17 +7,12 @@ class SingleTableCompositeKeyTest extends OrmFunctionalTestCase { - - public function setUp() + protected function setUp() : void { $this->useModelSet('compositekeyinheritance'); parent::setUp(); - } - /** - * - */ public function testInsertWithCompositeKey() { $childEntity = new SingleChildClass(); diff --git a/tests/Doctrine/Tests/ORM/Functional/SingleTableInheritanceTest.php b/tests/Doctrine/Tests/ORM/Functional/SingleTableInheritanceTest.php index 5bafffd790..3ef2f03ac3 100644 --- a/tests/Doctrine/Tests/ORM/Functional/SingleTableInheritanceTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/SingleTableInheritanceTest.php @@ -21,7 +21,7 @@ class SingleTableInheritanceTest extends OrmFunctionalTestCase private $flex; private $ultra; - public function setUp() + protected function setUp() : void { $this->useModelSet('company'); parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/StandardEntityPersisterTest.php b/tests/Doctrine/Tests/ORM/Functional/StandardEntityPersisterTest.php index bef1f76821..f2c0472ec3 100644 --- a/tests/Doctrine/Tests/ORM/Functional/StandardEntityPersisterTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/StandardEntityPersisterTest.php @@ -15,7 +15,7 @@ */ class StandardEntityPersisterTest extends OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { $this->useModelSet('ecommerce'); parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1040Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1040Test.php index 988e8ba99d..0312bec549 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1040Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1040Test.php @@ -11,7 +11,7 @@ */ class DDC1040Test extends OrmFunctionalTestCase { - public function setUp() + protected function setUp() : void { $this->useModelSet('cms'); parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1041Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1041Test.php index ed27ed1004..fcb6fce1be 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1041Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1041Test.php @@ -10,7 +10,7 @@ */ class DDC1041Test extends OrmFunctionalTestCase { - public function setUp() + protected function setUp() : void { $this->useModelSet('company'); parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1043Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1043Test.php index 9b35eb006c..faeda3c141 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1043Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1043Test.php @@ -10,7 +10,7 @@ */ class DDC1043Test extends OrmFunctionalTestCase { - public function setUp() + protected function setUp() : void { $this->useModelSet('cms'); parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1113Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1113Test.php index 324e848121..8b8c6f2d58 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1113Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1113Test.php @@ -8,7 +8,7 @@ */ class DDC1113Test extends \Doctrine\Tests\OrmFunctionalTestCase { - public function setUp() + protected function setUp() : void { parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1129Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1129Test.php index 81c9501029..480d230378 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1129Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1129Test.php @@ -9,7 +9,7 @@ */ class DDC1129Test extends \Doctrine\Tests\OrmFunctionalTestCase { - public function setUp() + protected function setUp() : void { $this->useModelSet('cms'); parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1163Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1163Test.php index f287034925..32715075a8 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1163Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1163Test.php @@ -9,7 +9,7 @@ */ class DDC1163Test extends \Doctrine\Tests\OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { parent::setUp(); //$this->_em->getConnection()->getConfiguration()->setSQLLogger(new \Doctrine\DBAL\Logging\EchoSQLLogger); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC117Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC117Test.php index f1685d6094..53cca99467 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC117Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC117Test.php @@ -24,7 +24,7 @@ class DDC117Test extends \Doctrine\Tests\OrmFunctionalTestCase private $translation; private $articleDetails; - protected function setUp() + protected function setUp() : void { $this->useModelSet('ddc117'); parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1181Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1181Test.php index 564e046e7d..55cff4c027 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1181Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1181Test.php @@ -6,7 +6,7 @@ class DDC1181Test extends OrmFunctionalTestCase { - public function setUp() + protected function setUp() : void { parent::setUp(); $this->_schemaTool->createSchema( diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1193Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1193Test.php index f4d98cb23a..93044ae912 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1193Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1193Test.php @@ -6,7 +6,7 @@ class DDC1193Test extends OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { parent::setUp(); //$this->_em->getConnection()->getConfiguration()->setSQLLogger(new \Doctrine\DBAL\Logging\EchoSQLLogger); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1209Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1209Test.php index 6c54da296b..76b22e80b5 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1209Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1209Test.php @@ -6,7 +6,7 @@ class DDC1209Test extends OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { parent::setUp(); try { diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1225Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1225Test.php index 1bfd6b91e1..7669f68337 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1225Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1225Test.php @@ -7,7 +7,7 @@ */ class DDC1225Test extends \Doctrine\Tests\OrmFunctionalTestCase { - public function setUp() + protected function setUp() : void { parent::setUp(); try { diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1228Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1228Test.php index b4de087a35..9cde55d64e 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1228Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1228Test.php @@ -8,7 +8,7 @@ */ class DDC1228Test extends \Doctrine\Tests\OrmFunctionalTestCase { - public function setUp() + protected function setUp() : void { parent::setUp(); try { diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1238Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1238Test.php index 00c621eeee..f90de56f82 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1238Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1238Test.php @@ -7,7 +7,7 @@ */ class DDC1238Test extends \Doctrine\Tests\OrmFunctionalTestCase { - public function setUp() + protected function setUp() : void { parent::setUp(); try { diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1250Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1250Test.php index a09b1761fe..6de949d0e9 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1250Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1250Test.php @@ -7,7 +7,7 @@ */ class DDC1250Test extends \Doctrine\Tests\OrmFunctionalTestCase { - public function setUp() + protected function setUp() : void { parent::setUp(); try { diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1276Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1276Test.php index d340746863..62b9d718a3 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1276Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1276Test.php @@ -13,7 +13,7 @@ class DDC1276Test extends \Doctrine\Tests\OrmFunctionalTestCase { use VerifyDeprecations; - public function setUp() + protected function setUp() : void { $this->useModelSet('cms'); parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1300Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1300Test.php index 4f0038b1c8..71559da6b5 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1300Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1300Test.php @@ -7,7 +7,7 @@ */ class DDC1300Test extends \Doctrine\Tests\OrmFunctionalTestCase { - public function setUp() + protected function setUp() : void { parent::setUp(); $this->_schemaTool->createSchema( diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1301Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1301Test.php index 785b22187e..1fed1daf8a 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1301Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1301Test.php @@ -15,7 +15,7 @@ class DDC1301Test extends \Doctrine\Tests\OrmFunctionalTestCase { private $userId; - public function setUp() + protected function setUp() : void { $this->useModelSet('legacy'); parent::setUp(); @@ -28,7 +28,7 @@ public function setUp() $this->loadFixture(); } - public function tearDown() + public function tearDown() : void { parent::tearDown(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1306Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1306Test.php index 03c761a959..f5ca357bcc 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1306Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1306Test.php @@ -11,7 +11,7 @@ */ class DDC1306Test extends \Doctrine\Tests\OrmFunctionalTestCase { - public function setUp() + protected function setUp() : void { $this->useModelSet('cms'); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1335Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1335Test.php index dd47555947..17f412ab26 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1335Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1335Test.php @@ -7,7 +7,7 @@ */ class DDC1335Test extends \Doctrine\Tests\OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { parent::setUp(); try { diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1383Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1383Test.php index ca75f90550..8720ab6a95 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1383Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1383Test.php @@ -11,7 +11,7 @@ class DDC1383Test extends \Doctrine\Tests\OrmFunctionalTestCase { use VerifyDeprecations; - protected function setUp() + protected function setUp() : void { parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1392Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1392Test.php index b872e413b5..5d6dd66072 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1392Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1392Test.php @@ -12,7 +12,7 @@ class DDC1392Test extends \Doctrine\Tests\OrmFunctionalTestCase { use VerifyDeprecations; - protected function setUp() + protected function setUp() : void { parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1400Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1400Test.php index 1248fe8412..0f0a41aa9b 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1400Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1400Test.php @@ -7,7 +7,7 @@ */ class DDC1400Test extends \Doctrine\Tests\OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1404Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1404Test.php index b3a1a939d2..419225ed14 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1404Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1404Test.php @@ -7,8 +7,7 @@ */ class DDC1404Test extends \Doctrine\Tests\OrmFunctionalTestCase { - - protected function setUp() + protected function setUp() : void { parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1430Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1430Test.php index 6b08a83267..138eeb7e59 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1430Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1430Test.php @@ -7,8 +7,7 @@ */ class DDC1430Test extends \Doctrine\Tests\OrmFunctionalTestCase { - - protected function setUp() + protected function setUp() : void { parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1436Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1436Test.php index 9ffa497cd4..8c44942b51 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1436Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1436Test.php @@ -7,7 +7,7 @@ */ class DDC1436Test extends \Doctrine\Tests\OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC144Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC144Test.php index 3866c588db..56a48919ea 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC144Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC144Test.php @@ -6,7 +6,8 @@ class DDC144Test extends OrmFunctionalTestCase { - protected function setUp() { + protected function setUp() : void + { parent::setUp(); $this->_schemaTool->createSchema( diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1452Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1452Test.php index 7e7ecc4f84..59d9736050 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1452Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1452Test.php @@ -12,7 +12,7 @@ */ class DDC1452Test extends \Doctrine\Tests\OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { $this->useModelSet('cms'); parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1454Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1454Test.php index f10065cd88..93de4f0a16 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1454Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1454Test.php @@ -9,7 +9,7 @@ */ class DDC1454Test extends \Doctrine\Tests\OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1458Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1458Test.php index 72d79cd432..ef2b559972 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1458Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1458Test.php @@ -6,7 +6,7 @@ class DDC1258Test extends OrmFunctionalTestCase { - public function setUp() + protected function setUp() : void { parent::setUp(); $this->_schemaTool->createSchema( diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1461Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1461Test.php index da7100d683..c0aaf1afc9 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1461Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1461Test.php @@ -7,7 +7,7 @@ */ class DDC1461Test extends \Doctrine\Tests\OrmFunctionalTestCase { - public function setUp() + protected function setUp() : void { parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1509Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1509Test.php index a2f9c1904a..8d8f3add74 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1509Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1509Test.php @@ -11,7 +11,7 @@ class DDC1509Test extends \Doctrine\Tests\OrmFunctionalTestCase { use VerifyDeprecations; - protected function setUp() + protected function setUp() : void { parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1514Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1514Test.php index 1fc8a06efa..25e32602a6 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1514Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1514Test.php @@ -9,7 +9,7 @@ */ class DDC1514Test extends \Doctrine\Tests\OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1515Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1515Test.php index 294ae87388..300413eb7f 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1515Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1515Test.php @@ -8,7 +8,7 @@ */ class DDC1515Test extends \Doctrine\Tests\OrmFunctionalTestCase { - public function setUp() + protected function setUp() : void { parent::setUp(); $this->_schemaTool->createSchema( diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1526Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1526Test.php index 7a76e3fb93..605f9412b6 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1526Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1526Test.php @@ -7,7 +7,7 @@ */ class DDC1526Test extends \Doctrine\Tests\OrmFunctionalTestCase { - public function setUp() + protected function setUp() : void { parent::setUp(); $this->_schemaTool->createSchema( diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1545Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1545Test.php index 20ebe424c5..00df9327bc 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1545Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1545Test.php @@ -16,7 +16,7 @@ class DDC1545Test extends \Doctrine\Tests\OrmFunctionalTestCase private $user2Id; - public function setUp() + protected function setUp() : void { $this->useModelSet('cms'); parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1548Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1548Test.php index 6628586cc9..31fa6f1933 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1548Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1548Test.php @@ -7,7 +7,7 @@ */ class DDC1548Test extends \Doctrine\Tests\OrmFunctionalTestCase { - public function setUp() + protected function setUp() : void { parent::setUp(); $this->_schemaTool->createSchema( diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1594Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1594Test.php index 00cd70a3c0..f6be23a6af 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1594Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1594Test.php @@ -12,7 +12,7 @@ class DDC1594Test extends \Doctrine\Tests\OrmFunctionalTestCase { use VerifyDeprecations; - public function setUp() + protected function setUp() : void { $this->useModelSet('cms'); parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1595Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1595Test.php index 5f0e128b5c..57601c6d65 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1595Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1595Test.php @@ -9,7 +9,7 @@ */ class DDC1595Test extends \Doctrine\Tests\OrmFunctionalTestCase { - public function setUp() + protected function setUp() : void { parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC163Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC163Test.php index cea515ce3e..9cb8e75530 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC163Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC163Test.php @@ -6,7 +6,7 @@ class DDC163Test extends \Doctrine\Tests\OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { $this->useModelSet('company'); parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1643Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1643Test.php index fda1682462..4d82d152d6 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1643Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1643Test.php @@ -12,7 +12,7 @@ class DDC1643Test extends \Doctrine\Tests\OrmFunctionalTestCase private $user1; private $user2; - public function setUp() + protected function setUp() : void { $this->useModelSet('cms'); parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1654Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1654Test.php index a5a620f63d..c6c332bc65 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1654Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1654Test.php @@ -7,7 +7,7 @@ */ class DDC1654Test extends \Doctrine\Tests\OrmFunctionalTestCase { - public function setUp() + protected function setUp() : void { parent::setUp(); $this->setUpEntitySchema( @@ -18,7 +18,7 @@ public function setUp() ); } - public function tearDown() + public function tearDown() : void { $conn = static::$_sharedConn; $conn->executeUpdate('DELETE FROM ddc1654post_ddc1654comment'); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1655Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1655Test.php index a63d3635fe..f5996be3ec 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1655Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1655Test.php @@ -9,7 +9,7 @@ */ class DDC1655Test extends \Doctrine\Tests\OrmFunctionalTestCase { - public function setUp() + protected function setUp() : void { parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1666Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1666Test.php index e664e537c3..6e359ddd70 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1666Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1666Test.php @@ -10,7 +10,7 @@ */ class DDC1666Test extends \Doctrine\Tests\OrmFunctionalTestCase { - public function setUp() + protected function setUp() : void { $this->useModelSet('cms'); parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1685Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1685Test.php index b2cbf513ab..c93f059169 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1685Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1685Test.php @@ -12,7 +12,7 @@ class DDC1685Test extends \Doctrine\Tests\OrmFunctionalTestCase { private $paginator; - protected function setUp() + protected function setUp() : void { $this->useModelSet('ddc117'); parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC168Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC168Test.php index ddaa83d80e..87647d397f 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC168Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC168Test.php @@ -8,7 +8,8 @@ class DDC168Test extends \Doctrine\Tests\OrmFunctionalTestCase { protected $oldMetadata; - protected function setUp() { + protected function setUp() : void + { $this->useModelSet('company'); parent::setUp(); @@ -19,7 +20,7 @@ protected function setUp() { $this->_em->getMetadataFactory()->setMetadataFor(CompanyEmployee::class, $metadata); } - public function tearDown() + public function tearDown() : void { $this->_em->getMetadataFactory()->setMetadataFor(CompanyEmployee::class, $this->oldMetadata); parent::tearDown(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1690Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1690Test.php index dc5feb9833..f86bcb2c02 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1690Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1690Test.php @@ -8,7 +8,8 @@ class DDC1690Test extends \Doctrine\Tests\OrmFunctionalTestCase { - protected function setUp() { + protected function setUp() : void + { parent::setUp(); try { $this->_schemaTool->createSchema( diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1707Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1707Test.php index 54b52a57bd..9e2c9f9418 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1707Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1707Test.php @@ -10,7 +10,7 @@ */ class DDC1707Test extends OrmFunctionalTestCase { - public function setUp() + protected function setUp() : void { parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1719Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1719Test.php index b3784ff8a7..33e71e0786 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1719Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1719Test.php @@ -7,7 +7,7 @@ */ class DDC1719Test extends \Doctrine\Tests\OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { parent::setUp(); @@ -18,7 +18,7 @@ protected function setUp() ); } - protected function tearDown() + protected function tearDown() : void { parent::tearDown(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1734Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1734Test.php index 64199eb07c..9df2ea1f21 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1734Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1734Test.php @@ -13,7 +13,7 @@ class DDC1734Test extends \Doctrine\Tests\OrmFunctionalTestCase /** * {@inheritDoc} */ - protected function setUp() + protected function setUp() : void { $this->useModelSet('cms'); parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1778Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1778Test.php index 09623f1353..f838fefd90 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1778Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1778Test.php @@ -13,7 +13,7 @@ class DDC1778Test extends \Doctrine\Tests\OrmFunctionalTestCase private $user; private $phone; - public function setUp() + protected function setUp() : void { $this->useModelSet('cms'); parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1787Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1787Test.php index 17f28658a5..027a13a383 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1787Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1787Test.php @@ -7,7 +7,7 @@ */ class DDC1787Test extends \Doctrine\Tests\OrmFunctionalTestCase { - public function setUp() + protected function setUp() : void { parent::setUp(); $this->_schemaTool->createSchema( diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1884Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1884Test.php index c1c723bbf0..958100ecac 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1884Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1884Test.php @@ -12,7 +12,7 @@ */ class DDC1884Test extends \Doctrine\Tests\OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { $this->useModelSet('taxi'); parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1918Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1918Test.php index 4b0c7eb915..92c12d60b9 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1918Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1918Test.php @@ -11,7 +11,7 @@ */ class DDC1918Test extends \Doctrine\Tests\OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { $this->useModelSet('cms'); parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1995Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1995Test.php index 8bb975a05b..e4643969a1 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1995Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1995Test.php @@ -10,7 +10,7 @@ */ class DDC1995Test extends \Doctrine\Tests\OrmFunctionalTestCase { - public function setUp() + protected function setUp() : void { $this->useModelSet('company'); parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC199Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC199Test.php index 2fb3acd33b..c40e09a1d4 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC199Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC199Test.php @@ -6,7 +6,7 @@ class DDC199Test extends OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { parent::setUp(); $this->_schemaTool->createSchema( diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2012Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2012Test.php index 3882408081..13adca23e3 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2012Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2012Test.php @@ -11,7 +11,7 @@ */ class DDC2012Test extends \Doctrine\Tests\OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2074Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2074Test.php index 0456adc50e..d5fc39b957 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2074Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2074Test.php @@ -16,7 +16,7 @@ */ class DDC2074Test extends OrmFunctionalTestCase { - public function setUp() + protected function setUp() : void { $this->useModelSet('ecommerce'); parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2084Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2084Test.php index eadbc1caf9..8b34274384 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2084Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2084Test.php @@ -7,7 +7,7 @@ */ class DDC2084Test extends \Doctrine\Tests\OrmFunctionalTestCase { - public function setUp() + protected function setUp() : void { parent::setUp(); @@ -49,12 +49,10 @@ public function testIssue() $this->assertEquals('Foo', $e->getMyEntity2()->getValue()); } - /** - * @expectedException \Doctrine\ORM\ORMInvalidArgumentException - * @expectedExceptionMessage Binding entities to query parameters only allowed for entities that have an identifier. - */ public function testinvalidIdentifierBindingEntityException() { + $this->expectException('Doctrine\ORM\ORMInvalidArgumentException'); + $this->expectExceptionMessage('Binding entities to query parameters only allowed for entities that have an identifier.'); $this->_em->find(__NAMESPACE__ . '\DDC2084\MyEntity1', new DDC2084\MyEntity2('Foo')); } } diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2090Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2090Test.php index 174fee2b28..1051751aa3 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2090Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2090Test.php @@ -10,7 +10,7 @@ */ class DDC2090Test extends \Doctrine\Tests\OrmFunctionalTestCase { - public function setUp() + protected function setUp() : void { $this->useModelSet('company'); parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2106Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2106Test.php index 99b2ade0f0..53ce73e9ed 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2106Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2106Test.php @@ -9,7 +9,7 @@ */ class DDC2106Test extends \Doctrine\Tests\OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC211Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC211Test.php index 9ac27f3cf9..f217afbb06 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC211Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC211Test.php @@ -6,7 +6,7 @@ class DDC211Test extends OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { parent::setUp(); $this->_schemaTool->createSchema( diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2175Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2175Test.php index d6b3c603b8..532033c1fe 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2175Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2175Test.php @@ -7,7 +7,7 @@ */ class DDC2175Test extends \Doctrine\Tests\OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { parent::setUp(); $this->_schemaTool->createSchema( diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2214Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2214Test.php index 87101fff1d..d180fa2b30 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2214Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2214Test.php @@ -13,7 +13,7 @@ */ class DDC2214Test extends \Doctrine\Tests\OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2224Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2224Test.php index 3529fa3564..f6bc715eeb 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2224Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2224Test.php @@ -12,7 +12,7 @@ */ class DDC2224Test extends \Doctrine\Tests\OrmFunctionalTestCase { - public static function setUpBeforeClass() + public static function setUpBeforeClass() : void { \Doctrine\DBAL\Types\Type::addType('DDC2224Type', DDC2224Type::class); } diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2230Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2230Test.php index 3fd6ea49d9..6a9488050f 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2230Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2230Test.php @@ -16,7 +16,7 @@ class DDC2230Test extends OrmFunctionalTestCase { use VerifyDeprecations; - protected function setUp() + protected function setUp() : void { parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2231Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2231Test.php index dcca1360e1..8b5c458b7c 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2231Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2231Test.php @@ -12,7 +12,7 @@ */ class DDC2231Test extends \Doctrine\Tests\OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { parent::setUp(); $this->_schemaTool->createSchema( diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2252Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2252Test.php index e4b6019662..9a5e456c9f 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2252Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2252Test.php @@ -14,7 +14,7 @@ class DDC2252Test extends \Doctrine\Tests\OrmFunctionalTestCase private $membership; private $privileges = []; - protected function setUp() + protected function setUp() : void { parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2256Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2256Test.php index 02281a5e3a..c38f7d645f 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2256Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2256Test.php @@ -10,7 +10,7 @@ */ class DDC2256Test extends \Doctrine\Tests\OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2306Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2306Test.php index 24807db029..baed97f140 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2306Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2306Test.php @@ -13,7 +13,7 @@ class DDC2306Test extends \Doctrine\Tests\OrmFunctionalTestCase /** * {@inheritDoc} */ - protected function setUp() + protected function setUp() : void { parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2346Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2346Test.php index a1cac08eaf..0cdd4607b9 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2346Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2346Test.php @@ -18,7 +18,7 @@ class DDC2346Test extends \Doctrine\Tests\OrmFunctionalTestCase /** * {@inheritDoc} */ - protected function setUp() + protected function setUp() : void { parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2350Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2350Test.php index 1d3a4117ad..5998538c05 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2350Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2350Test.php @@ -10,7 +10,7 @@ */ class DDC2350Test extends OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC237Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC237Test.php index eac219c728..3dad06a486 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC237Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC237Test.php @@ -6,7 +6,7 @@ class DDC237Test extends \Doctrine\Tests\OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { parent::setUp(); $this->_schemaTool->createSchema( diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2409Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2409Test.php index aa44bbaee6..04e1544e89 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2409Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2409Test.php @@ -14,7 +14,7 @@ class DDC2409Test extends \Doctrine\Tests\OrmFunctionalTestCase { use VerifyDeprecations; - public function setUp() + protected function setUp() : void { $this->useModelSet('cms'); parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2415Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2415Test.php index fb1f0ec273..950af6c593 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2415Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2415Test.php @@ -12,7 +12,7 @@ */ class DDC2415Test extends \Doctrine\Tests\OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2494Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2494Test.php index 4aa30e9504..ffa9295e90 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2494Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2494Test.php @@ -11,7 +11,7 @@ */ class DDC2494Test extends \Doctrine\Tests\OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { parent::setUp(); @@ -56,13 +56,13 @@ public function testIssue() $this->assertArrayHasKey('convertToPHPValue', DDC2494TinyIntType::$calls); $this->assertCount(1, DDC2494TinyIntType::$calls['convertToPHPValue']); - $this->assertInternalType('integer', $item->getCurrency()->getId()); + $this->assertIsInt($item->getCurrency()->getId()); $this->assertCount(1, DDC2494TinyIntType::$calls['convertToPHPValue']); $this->assertFalse($item->getCurrency()->__isInitialized()); $this->assertEquals($queryCount, $this->getCurrentQueryCount()); - $this->assertInternalType('integer', $item->getCurrency()->getTemp()); + $this->assertIsInt($item->getCurrency()->getTemp()); $this->assertCount(3, DDC2494TinyIntType::$calls['convertToPHPValue']); $this->assertTrue($item->getCurrency()->__isInitialized()); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2519Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2519Test.php index cc12d044dc..3789d04a7b 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2519Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2519Test.php @@ -13,7 +13,7 @@ class DDC2519Test extends \Doctrine\Tests\OrmFunctionalTestCase { private $userId; - public function setUp() + protected function setUp() : void { $this->useModelSet('legacy'); parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2575Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2575Test.php index e3652e55c0..0e6b1a1b33 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2575Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2575Test.php @@ -11,7 +11,7 @@ class DDC2575Test extends \Doctrine\Tests\OrmFunctionalTestCase private $aEntities = []; private $bEntities = []; - protected function setUp() + protected function setUp() : void { parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2579Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2579Test.php index e7ba77759f..67d4712b09 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2579Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2579Test.php @@ -11,7 +11,7 @@ */ class DDC2579Test extends \Doctrine\Tests\OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC258Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC258Test.php index fb7ce673e3..8f65498795 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC258Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC258Test.php @@ -6,7 +6,7 @@ class DDC258Test extends OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { parent::setUp(); $this->_schemaTool->createSchema( diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2655Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2655Test.php index 8a2dc166a8..59ef5d31f8 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2655Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2655Test.php @@ -9,7 +9,7 @@ */ class DDC2655Test extends \Doctrine\Tests\OrmFunctionalTestCase { - public function setUp() + protected function setUp() : void { $this->useModelSet('cms'); parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2660Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2660Test.php index 46380f754b..e6e3f4c4de 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2660Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2660Test.php @@ -12,7 +12,7 @@ class DDC2660Test extends \Doctrine\Tests\OrmFunctionalTestCase /** * {@inheritDoc} */ - protected function setUp() + protected function setUp() : void { parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2692Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2692Test.php index 1e9f05e476..c88ef9ac05 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2692Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2692Test.php @@ -13,7 +13,7 @@ class DDC2692Test extends \Doctrine\Tests\OrmFunctionalTestCase /** * {@inheritDoc} */ - protected function setUp() + protected function setUp() : void { parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2759Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2759Test.php index 10d3e68ae9..f76778629d 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2759Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2759Test.php @@ -10,7 +10,7 @@ class DDC2759Test extends \Doctrine\Tests\OrmFunctionalTestCase /** * {@inheritDoc} */ - protected function setUp() + protected function setUp() : void { parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2775Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2775Test.php index b84024f048..62d8d5fa7c 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2775Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2775Test.php @@ -11,7 +11,7 @@ */ class DDC2775Test extends OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2780Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2780Test.php index 5539dfbbe5..2fd0f2dd0f 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2780Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2780Test.php @@ -12,9 +12,9 @@ class DDC2780Test extends \Doctrine\Tests\OrmFunctionalTestCase /** * {@inheritDoc} */ - protected function setup() + protected function setUp() : void { - parent::setup(); + parent::setUp(); $this->_schemaTool->createSchema( [ diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2790Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2790Test.php index 0f3efab262..b14c098ff6 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2790Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2790Test.php @@ -14,7 +14,7 @@ class DDC2790Test extends \Doctrine\Tests\OrmFunctionalTestCase /** * {@inheritDoc} */ - protected function setUp() + protected function setUp() : void { $this->useModelSet('cms'); parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC279Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC279Test.php index f09e2e68cc..278a3b47ac 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC279Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC279Test.php @@ -4,7 +4,7 @@ class DDC279Test extends \Doctrine\Tests\OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { parent::setUp(); $this->_schemaTool->createSchema( diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2825Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2825Test.php index 7aeba002a0..5060ec34a7 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2825Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2825Test.php @@ -16,7 +16,7 @@ class DDC2825Test extends \Doctrine\Tests\OrmFunctionalTestCase /** * {@inheritDoc} */ - protected function setUp() + protected function setUp() : void { parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2862Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2862Test.php index c4b2fb227b..0a4fcbd8e1 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2862Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2862Test.php @@ -10,7 +10,7 @@ */ class DDC2862Test extends \Doctrine\Tests\OrmFunctionalTestCase { - public function setUp() + protected function setUp() : void { $this->enableSecondLevelCache(); parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2895Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2895Test.php index 397c7acd38..fdebb43a6f 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2895Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2895Test.php @@ -9,7 +9,7 @@ */ class DDC2895Test extends \Doctrine\Tests\OrmFunctionalTestCase { - public function setUp() + protected function setUp() : void { parent::setUp(); try { diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2931Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2931Test.php index 927856a1c6..b4b92e3198 100755 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2931Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2931Test.php @@ -9,7 +9,7 @@ */ class DDC2931Test extends \Doctrine\Tests\OrmFunctionalTestCase { - public function setUp() + protected function setUp() : void { parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2943Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2943Test.php index 553bc98f52..823110cdae 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2943Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2943Test.php @@ -12,7 +12,7 @@ */ class DDC2943Test extends OrmFunctionalTestCase { - public function setUp() + protected function setUp() : void { $this->enableSecondLevelCache(); $this->useModelSet('cache'); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2984Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2984Test.php index e21ac82dc8..191da80f72 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2984Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2984Test.php @@ -12,7 +12,7 @@ */ class DDC2984Test extends \Doctrine\Tests\OrmFunctionalTestCase { - public function setUp() + protected function setUp() : void { parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3042Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3042Test.php index 940989bb71..5b783df840 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3042Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3042Test.php @@ -9,7 +9,7 @@ */ class DDC3042Test extends OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3068Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3068Test.php index 90a3f3ed80..61d892b4c4 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3068Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3068Test.php @@ -16,7 +16,7 @@ class DDC3068Test extends \Doctrine\Tests\OrmFunctionalTestCase private $foo; private $merc; - protected function setUp() + protected function setUp() : void { $this->useModelSet('taxi'); parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC309Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC309Test.php index 15454b4826..557aa1106f 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC309Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC309Test.php @@ -6,7 +6,7 @@ class DDC309Test extends OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { parent::setUp(); $this->_schemaTool->createSchema( diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3123Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3123Test.php index 515aa9febc..64b055e5a3 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3123Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3123Test.php @@ -3,14 +3,16 @@ namespace Doctrine\Tests\ORM\Functional\Ticket; use Doctrine\ORM\Events; +use Doctrine\ORM\UnitOfWork; use Doctrine\Tests\Models\CMS\CmsUser; +use ReflectionClass; /** * @group DDC-3123 */ class DDC3123Test extends \Doctrine\Tests\OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { $this->useModelSet('cms'); parent::setUp(); @@ -36,7 +38,13 @@ public function testIssue() ->expects($this->once()) ->method(Events::postFlush) ->will($this->returnCallback(function () use ($uow, $test) { - $test->assertAttributeEmpty('extraUpdates', $uow, 'ExtraUpdates are reset before postFlush'); + $class = new ReflectionClass(UnitOfWork::class); + $property = $class->getProperty('extraUpdates'); + $property->setAccessible(true); + $test->assertEmpty( + $property->getValue($uow), + 'ExtraUpdates are reset before postFlush' + ); })); $this->_em->getEventManager()->addEventListener(Events::postFlush, $listener); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3160Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3160Test.php index c0ed69dd0e..1eae53f477 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3160Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3160Test.php @@ -14,7 +14,8 @@ */ class DDC3160Test extends OrmFunctionalTestCase { - protected function setUp() { + protected function setUp() : void + { $this->useModelSet('cms'); parent::setUp(); } diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3170Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3170Test.php index 45a49b7a6d..b24f977c8c 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3170Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3170Test.php @@ -13,7 +13,7 @@ class DDC3170Test extends \Doctrine\Tests\OrmFunctionalTestCase /** * {@inheritDoc} */ - protected function setUp() + protected function setUp() : void { parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3192Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3192Test.php index 1262bce452..ae14277628 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3192Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3192Test.php @@ -12,7 +12,7 @@ */ class DDC3192Test extends \Doctrine\Tests\OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3223Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3223Test.php index 0f98adca1f..813af9a9fa 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3223Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3223Test.php @@ -11,7 +11,7 @@ */ class DDC3223Test extends OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3303Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3303Test.php index b40f99ff9d..61515be80a 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3303Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3303Test.php @@ -5,7 +5,7 @@ class DDC3303Test extends OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC331Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC331Test.php index 5ec8ad730a..45cac50f8a 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC331Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC331Test.php @@ -9,7 +9,8 @@ */ class DDC331Test extends \Doctrine\Tests\OrmFunctionalTestCase { - protected function setUp() { + protected function setUp() : void + { $this->useModelSet('company'); parent::setUp(); } diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3330Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3330Test.php index a03c3172cf..5af4d0669b 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3330Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3330Test.php @@ -12,7 +12,7 @@ */ class DDC3330Test extends OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3346Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3346Test.php index 3865767604..eeafa12bea 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3346Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3346Test.php @@ -10,7 +10,7 @@ */ class DDC3346Test extends \Doctrine\Tests\OrmFunctionalTestCase { - public function setUp() + protected function setUp() : void { $this->useModelSet('ddc3346'); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC345Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC345Test.php index 20b4236c30..e570f1e3a8 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC345Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC345Test.php @@ -4,7 +4,7 @@ class DDC345Test extends \Doctrine\Tests\OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { parent::setUp(); //$this->_em->getConnection()->getConfiguration()->setSQLLogger(new \Doctrine\DBAL\Logging\EchoSQLLogger); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC353Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC353Test.php index dcb782bd4f..cdc780b951 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC353Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC353Test.php @@ -6,7 +6,7 @@ class DDC353Test extends \Doctrine\Tests\OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { parent::setUp(); try { diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3597Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3597Test.php index 6d59fd6f70..89c76810e8 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3597Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3597Test.php @@ -5,13 +5,15 @@ use Doctrine\Tests\Models\DDC3597\DDC3597Image; use Doctrine\Tests\Models\DDC3597\DDC3597Media; use Doctrine\Tests\Models\DDC3597\DDC3597Root; +use Doctrine\Tests\OrmFunctionalTestCase; /** * @group DDC-117 */ -class DDC3597Test extends \Doctrine\Tests\OrmFunctionalTestCase { - - protected function setUp() { +class DDC3597Test extends OrmFunctionalTestCase +{ + protected function setUp() : void + { parent::setUp(); $this->_schemaTool->createSchema( [ diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3634Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3634Test.php index 01f42bb930..2dccf237b3 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3634Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3634Test.php @@ -11,9 +11,10 @@ /** * @group DDC-3634 */ -class DDC3634Test extends OrmFunctionalTestCase { - - protected function setUp() { +class DDC3634Test extends OrmFunctionalTestCase +{ + protected function setUp() : void + { parent::setUp(); $metadata = $this->_em->getClassMetadata(DDC3634Entity::class); @@ -57,7 +58,7 @@ public function testSavesIntegerAutoGeneratedValueAsString() $this->_em->persist($entity); $this->_em->flush(); - $this->assertInternalType('string', $entity->id); + $this->assertIsString($entity->id); } public function testSavesIntegerAutoGeneratedValueAsStringWithJoinedInheritance() @@ -67,7 +68,7 @@ public function testSavesIntegerAutoGeneratedValueAsStringWithJoinedInheritance( $this->_em->persist($entity); $this->_em->flush(); - $this->assertInternalType('string', $entity->id); + $this->assertIsString($entity->id); } } diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3644Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3644Test.php index 968c44d721..6c66766483 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3644Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3644Test.php @@ -12,7 +12,7 @@ */ class DDC3644Test extends OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3699Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3699Test.php index 8d3607112e..f36c19254e 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3699Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3699Test.php @@ -12,7 +12,7 @@ class DDC3597Test extends \Doctrine\Tests\OrmFunctionalTestCase { use VerifyDeprecations; - protected function setUp() + protected function setUp() : void { $this->useModelSet('ddc3699'); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3719Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3719Test.php index f5f60c0b0d..803367b8d8 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3719Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3719Test.php @@ -12,7 +12,7 @@ */ class DDC3719Test extends \Doctrine\Tests\OrmFunctionalTestCase { - public function setUp() + protected function setUp() : void { $this->useModelSet('company'); parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC371Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC371Test.php index 3fe5c4b80d..d306676629 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC371Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC371Test.php @@ -9,7 +9,7 @@ */ class DDC371Test extends \Doctrine\Tests\OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { parent::setUp(); //$this->_em->getConnection()->getConfiguration()->setSQLLogger(new \Doctrine\DBAL\Logging\EchoSQLLogger); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3785Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3785Test.php index 984cda551b..6b1dd59fb5 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3785Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3785Test.php @@ -8,7 +8,7 @@ class DDC3785Test extends \Doctrine\Tests\OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC381Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC381Test.php index bbfd6974e2..4bfe606529 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC381Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC381Test.php @@ -4,7 +4,7 @@ class DDC381Test extends \Doctrine\Tests\OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3967Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3967Test.php index 72a9cfe168..36dc82250c 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3967Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC3967Test.php @@ -7,7 +7,7 @@ class DDC3967Test extends SecondLevelCacheAbstractTest { - protected function setUp() + protected function setUp() : void { parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC422Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC422Test.php index 6ace5e7494..dc4b31669e 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC422Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC422Test.php @@ -6,7 +6,7 @@ class DDC422Test extends \Doctrine\Tests\OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { parent::setUp(); //$this->_em->getConnection()->getConfiguration()->setSQLLogger(new \Doctrine\DBAL\Logging\EchoSQLLogger); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC425Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC425Test.php index 8d91119a20..9c5ea5cda6 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC425Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC425Test.php @@ -5,7 +5,7 @@ class DDC425Test extends \Doctrine\Tests\OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { parent::setUp(); $this->_schemaTool->createSchema( diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC440Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC440Test.php index 30d2ca6b9c..aff0b0567e 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC440Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC440Test.php @@ -4,8 +4,7 @@ class DDC440Test extends \Doctrine\Tests\OrmFunctionalTestCase { - - protected function setUp() + protected function setUp() : void { parent::setUp(); try { diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC444Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC444Test.php index 41d7e1270e..9607d22de7 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC444Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC444Test.php @@ -4,7 +4,7 @@ class DDC444Test extends \Doctrine\Tests\OrmFunctionalTestCase { - public function setUp() + protected function setUp() : void { parent::setUp(); //$this->_em->getConnection()->getConfiguration()->setSQLLogger(new \Doctrine\DBAL\Logging\EchoSQLLogger); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC448Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC448Test.php index 31e03e3373..7d0ddd3b57 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC448Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC448Test.php @@ -6,7 +6,7 @@ class DDC448Test extends OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { parent::setUp(); $this->_schemaTool->createSchema( diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC493Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC493Test.php index 536a8b49b5..4fa82abccf 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC493Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC493Test.php @@ -4,7 +4,7 @@ class DDC493Test extends \Doctrine\Tests\OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { parent::setUp(); $this->_schemaTool->createSchema( diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC501Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC501Test.php index 14c8be412c..1aca0a39ad 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC501Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC501Test.php @@ -22,7 +22,7 @@ class DDC501Test extends OrmFunctionalTestCase { use VerifyDeprecations; - protected function setUp() + protected function setUp() : void { $this->useModelSet('cms'); parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC512Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC512Test.php index 6f3c3cfb01..9e4f80bfa1 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC512Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC512Test.php @@ -6,7 +6,7 @@ class DDC512Test extends OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { parent::setUp(); $this->_schemaTool->createSchema( diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC513Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC513Test.php index 800c442a39..13255382a0 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC513Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC513Test.php @@ -4,7 +4,7 @@ class DDC513Test extends \Doctrine\Tests\OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { parent::setUp(); $this->_schemaTool->createSchema( diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC518Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC518Test.php index 64749876b8..864c5eb3b6 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC518Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC518Test.php @@ -8,7 +8,7 @@ class DDC518Test extends \Doctrine\Tests\OrmFunctionalTestCase { use VerifyDeprecations; - public function setUp() + protected function setUp() : void { $this->useModelSet('cms'); parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC522Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC522Test.php index dc6fa20817..58e8a69145 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC522Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC522Test.php @@ -10,7 +10,7 @@ */ class DDC522Test extends \Doctrine\Tests\OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC531Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC531Test.php index 33d88c6be1..77ea2024bf 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC531Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC531Test.php @@ -6,7 +6,7 @@ class DDC531Test extends \Doctrine\Tests\OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { parent::setUp(); $this->_schemaTool->createSchema( diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC5684Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC5684Test.php index e525ae1342..5b14cd0686 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC5684Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC5684Test.php @@ -14,7 +14,7 @@ */ class DDC5684Test extends \Doctrine\Tests\OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { parent::setUp(); @@ -27,7 +27,7 @@ protected function setUp() $this->_schemaTool->createSchema([$this->_em->getClassMetadata(DDC5684Object::class)]); } - protected function tearDown() + protected function tearDown() : void { $this->_schemaTool->dropSchema([$this->_em->getClassMetadata(DDC5684Object::class)]); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC588Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC588Test.php index 7361bc4f40..cbd895c3d0 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC588Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC588Test.php @@ -4,7 +4,7 @@ class DDC588Test extends \Doctrine\Tests\OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC599Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC599Test.php index 842ccdd1a7..e1ef818c5c 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC599Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC599Test.php @@ -4,7 +4,7 @@ class DDC599Test extends \Doctrine\Tests\OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { parent::setUp(); //$this->_em->getConnection()->getConfiguration()->setSQLLogger(new \Doctrine\DBAL\Logging\EchoSQLLogger); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC618Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC618Test.php index 5e359863e9..44daf38e5f 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC618Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC618Test.php @@ -7,7 +7,7 @@ */ class DDC618Test extends \Doctrine\Tests\OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { parent::setUp(); try { diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC6303Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC6303Test.php index 22c898eeb0..432cc7ec34 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC6303Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC6303Test.php @@ -12,7 +12,7 @@ */ class DDC6303Test extends OrmFunctionalTestCase { - public function setUp() : void + protected function setUp() : void { parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC633Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC633Test.php index 2ed53ed354..a5facde97b 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC633Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC633Test.php @@ -6,7 +6,7 @@ class DDC633Test extends \Doctrine\Tests\OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { parent::setUp(); try { diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC6460Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC6460Test.php index 9868c7d1c0..f0147cfa6a 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC6460Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC6460Test.php @@ -13,7 +13,7 @@ class DDC6460Test extends \Doctrine\Tests\OrmFunctionalTestCase { - public function setUp() + protected function setUp() : void { parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC656Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC656Test.php index 1f94a3953a..3ee395adfd 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC656Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC656Test.php @@ -4,7 +4,7 @@ class DDC656Test extends \Doctrine\Tests\OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { parent::setUp(); try { diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC657Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC657Test.php index 759464a5f0..68a718f1d0 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC657Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC657Test.php @@ -9,7 +9,7 @@ */ class DDC657Test extends \Doctrine\Tests\OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { $this->useModelSet('generic'); parent::setUp(); @@ -36,13 +36,13 @@ public function testScalarResult() $this->assertCount(2,$result); - $this->assertContains('11:11:11', $result[0]['time']); - $this->assertContains('2010-01-01', $result[0]['date']); - $this->assertContains('2010-01-01 11:11:11', $result[0]['datetime']); + $this->assertStringContainsString('11:11:11', $result[0]['time']); + $this->assertStringContainsString('2010-01-01', $result[0]['date']); + $this->assertStringContainsString('2010-01-01 11:11:11', $result[0]['datetime']); - $this->assertContains('12:12:12', $result[1]['time']); - $this->assertContains('2010-02-02', $result[1]['date']); - $this->assertContains('2010-02-02 12:12:12', $result[1]['datetime']); + $this->assertStringContainsString('12:12:12', $result[1]['time']); + $this->assertStringContainsString('2010-02-02', $result[1]['date']); + $this->assertStringContainsString('2010-02-02 12:12:12', $result[1]['datetime']); } public function testaTicketEntityArrayResult() diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC698Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC698Test.php index f21d6de693..7dd584af34 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC698Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC698Test.php @@ -4,7 +4,7 @@ class DDC698Test extends \Doctrine\Tests\OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { parent::setUp(); try { diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC719Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC719Test.php index c6f1a2254c..1818e7a80e 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC719Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC719Test.php @@ -4,7 +4,7 @@ class DDC719Test extends \Doctrine\Tests\OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { parent::setUp(); //$this->_em->getConnection()->getConfiguration()->setSQLLogger(new \Doctrine\DBAL\Logging\EchoSQLLogger); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC729Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC729Test.php index 8cc9642100..ce9dd157b9 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC729Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC729Test.php @@ -10,7 +10,7 @@ class DDC729Test extends \Doctrine\Tests\OrmFunctionalTestCase { use VerifyDeprecations; - public function setUp() + protected function setUp() : void { parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC735Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC735Test.php index afae6973bf..2e91e34dcb 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC735Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC735Test.php @@ -6,7 +6,7 @@ class DDC735Test extends \Doctrine\Tests\OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { parent::setUp(); try { diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC736Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC736Test.php index 932731bf6f..7987c6da66 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC736Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC736Test.php @@ -10,7 +10,7 @@ class DDC736Test extends \Doctrine\Tests\OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { $this->useModelSet('ecommerce'); parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC742Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC742Test.php index 8adcb08795..6758e842d3 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC742Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC742Test.php @@ -13,7 +13,7 @@ class DDC742Test extends \Doctrine\Tests\OrmFunctionalTestCase /** * {@inheritDoc} */ - protected function setUp() + protected function setUp() : void { parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC748Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC748Test.php index cfafc66dd6..2d73f0e893 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC748Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC748Test.php @@ -9,7 +9,7 @@ class DDC748Test extends \Doctrine\Tests\OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { $this->useModelSet('cms'); parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC758Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC758Test.php index e7a36310ed..20399cb759 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC758Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC758Test.php @@ -11,7 +11,7 @@ class DDC758Test extends \Doctrine\Tests\OrmFunctionalTestCase { use VerifyDeprecations; - public function setUp() + protected function setUp() : void { $this->markTestSkipped('Destroys testsuite'); $this->useModelSet("cms"); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC767Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC767Test.php index 8420db1327..6fdd2bab15 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC767Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC767Test.php @@ -7,7 +7,7 @@ class DDC767Test extends \Doctrine\Tests\OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { $this->useModelSet('cms'); parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC809Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC809Test.php index 4c6464a188..0a190c9b4d 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC809Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC809Test.php @@ -4,7 +4,7 @@ class DDC809Test extends \Doctrine\Tests\OrmFunctionalTestCase { - public function setUp() + protected function setUp() : void { parent::setUp(); $this->_schemaTool->createSchema( diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC812Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC812Test.php index 5b37a47923..49159e68b3 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC812Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC812Test.php @@ -7,7 +7,7 @@ class DDC812Test extends \Doctrine\Tests\OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { $this->useModelSet('cms'); parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC832Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC832Test.php index fdae13585f..0205f99d92 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC832Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC832Test.php @@ -4,7 +4,7 @@ class DDC832Test extends \Doctrine\Tests\OrmFunctionalTestCase { - public function setUp() + protected function setUp() : void { parent::setUp(); @@ -28,7 +28,7 @@ public function setUp() } } - public function tearDown() + public function tearDown() : void { /* @var $sm \Doctrine\DBAL\Schema\AbstractSchemaManager */ $platform = $this->_em->getConnection()->getDatabasePlatform(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC837Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC837Test.php index 4721a6b18b..1c93cffae3 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC837Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC837Test.php @@ -4,7 +4,7 @@ class DDC837Test extends \Doctrine\Tests\OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { parent::setUp(); $this->_schemaTool->createSchema( diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC849Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC849Test.php index 1844b316f3..19af190ee2 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC849Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC849Test.php @@ -11,7 +11,7 @@ class DDC849Test extends \Doctrine\Tests\OrmFunctionalTestCase private $group1; private $group2; - public function setUp() + protected function setUp() : void { $this->useModelSet('cms'); parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC881Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC881Test.php index 3df61f7165..376477a16d 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC881Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC881Test.php @@ -7,8 +7,7 @@ class DDC881Test extends \Doctrine\Tests\OrmFunctionalTestCase { - - protected function setUp() + protected function setUp() : void { parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC933Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC933Test.php index 9fda6ed03b..d7539c41bc 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC933Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC933Test.php @@ -10,7 +10,7 @@ class DDC933Test extends OrmFunctionalTestCase { - public function setUp() + protected function setUp() : void { $this->useModelSet('company'); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC949Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC949Test.php index 8c3162df36..68e9187ecc 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC949Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC949Test.php @@ -7,7 +7,7 @@ class DDC949Test extends OrmFunctionalTestCase { - public function setUp() + protected function setUp() : void { $this->useModelSet('generic'); parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC960Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC960Test.php index 730a70bce8..f9b609f868 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC960Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC960Test.php @@ -6,7 +6,7 @@ class DDC960Test extends OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { parent::setUp(); try { diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC992Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC992Test.php index 77780486bd..ae97541249 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC992Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC992Test.php @@ -9,7 +9,7 @@ */ class DDC992Test extends \Doctrine\Tests\OrmFunctionalTestCase { - public function setUp() + protected function setUp() : void { parent::setUp(); try { diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/GH2947Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/GH2947Test.php index 0b21b57f06..bfc3ca3a11 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/GH2947Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/GH2947Test.php @@ -10,7 +10,7 @@ */ class GH2947Test extends OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { $this->resultCacheImpl = new ArrayCache(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/GH5562Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/GH5562Test.php index 824c4378ad..2b42e2be90 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/GH5562Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/GH5562Test.php @@ -9,7 +9,7 @@ final class GH5562Test extends OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { $this->enableSecondLevelCache(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/GH5762Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/GH5762Test.php index b7a748ddc4..e966d74403 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/GH5762Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/GH5762Test.php @@ -11,7 +11,7 @@ */ class GH5762Test extends OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/GH5804Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/GH5804Test.php index 77d4fbc878..b4d530fde4 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/GH5804Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/GH5804Test.php @@ -13,7 +13,7 @@ */ final class GH5804Test extends OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/GH5887Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/GH5887Test.php index f19dd5924b..dbe402da32 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/GH5887Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/GH5887Test.php @@ -12,7 +12,7 @@ */ class GH5887Test extends OrmFunctionalTestCase { - public function setUp() + protected function setUp() : void { parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/GH6029Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/GH6029Test.php index 50696a5166..a7ab589042 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/GH6029Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/GH6029Test.php @@ -11,7 +11,7 @@ final class GH6029Test extends OrmFunctionalTestCase /** * {@inheritDoc} */ - protected function setUp() + protected function setUp() : void { parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/GH6141Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/GH6141Test.php index 00ae936a4b..550ba87b4b 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/GH6141Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/GH6141Test.php @@ -9,7 +9,7 @@ class GH6141Test extends OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/GH6217Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/GH6217Test.php index d781d0c816..590793e26c 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/GH6217Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/GH6217Test.php @@ -8,7 +8,7 @@ */ final class GH6217Test extends OrmFunctionalTestCase { - public function setUp() : void + protected function setUp() : void { $this->enableSecondLevelCache(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/GH6362Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/GH6362Test.php index 576fbd0eb8..ec7b38faa7 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/GH6362Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/GH6362Test.php @@ -9,7 +9,7 @@ final class GH6362Test extends OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/GH6402Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/GH6402Test.php index d675da94ad..8436e5fdb1 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/GH6402Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/GH6402Test.php @@ -13,7 +13,7 @@ */ class GH6402Test extends OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { $this->useModelSet('quote'); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/GH6531Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/GH6531Test.php index 1d819f2508..56473f1121 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/GH6531Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/GH6531Test.php @@ -8,7 +8,7 @@ final class GH6531Test extends \Doctrine\Tests\OrmFunctionalTestCase { protected function setUp() : void { - parent::setup(); + parent::setUp(); $this->setUpEntitySchema( [ diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/GH6740Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/GH6740Test.php index 3589fa2fb8..dccf69d5fd 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/GH6740Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/GH6740Test.php @@ -24,7 +24,7 @@ final class GH6740Test extends OrmFunctionalTestCase */ private $secondCategoryId; - public function setUp() : void + protected function setUp() : void { $this->useModelSet('ecommerce'); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/GH7067Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/GH7067Test.php index 15dc5fa9ca..18b81f434f 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/GH7067Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/GH7067Test.php @@ -5,7 +5,7 @@ final class GH7067Test extends \Doctrine\Tests\OrmFunctionalTestCase { - public function setUp() : void + protected function setUp() : void { $this->enableSecondLevelCache(); parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/GH7068Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/GH7068Test.php index 297d77e036..234b7fbce6 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/GH7068Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/GH7068Test.php @@ -11,7 +11,7 @@ final class GH7068Test extends OrmFunctionalTestCase /** * {@inheritDoc} */ - protected function setUp() + protected function setUp() : void { parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/GH7629Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/GH7629Test.php index a0c100acaa..7a007447fc 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/GH7629Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/GH7629Test.php @@ -9,7 +9,7 @@ class GH7629Test extends OrmFunctionalTestCase /** * {@inheritDoc} */ - protected function setUp(): void + protected function setUp() : void { parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/GH7735Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/GH7735Test.php index 52a10dc643..a9cdc10267 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/GH7735Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/GH7735Test.php @@ -9,7 +9,7 @@ final class GH7735Test extends OrmFunctionalTestCase { - public function setUp() : void + protected function setUp() : void { $this->enableSecondLevelCache(); parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/GH7829Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/GH7829Test.php index 08f91d2a8e..88a4b01885 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/GH7829Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/GH7829Test.php @@ -17,7 +17,7 @@ final class GH7829Test extends OrmFunctionalTestCase /** @var DebugStack */ private $logger; - protected function setUp() + protected function setUp() : void { $this->useModelSet('cms'); parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/GH7864Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/GH7864Test.php index 4c1bb64e69..b4916ffe5b 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/GH7864Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/GH7864Test.php @@ -15,7 +15,7 @@ class GH7864Test extends OrmFunctionalTestCase { protected function setUp() : void { - parent::setup(); + parent::setUp(); $this->setUpEntitySchema( [ diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/GH8229Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/GH8229Test.php index d07405811c..e32ff11c59 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/GH8229Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/GH8229Test.php @@ -15,7 +15,7 @@ */ class GH8229Test extends OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/Issue5989Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/Issue5989Test.php index cf601b99ae..b9007ce443 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/Issue5989Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/Issue5989Test.php @@ -11,7 +11,7 @@ */ class Issue5989Test extends \Doctrine\Tests\OrmFunctionalTestCase { - public function setUp() + protected function setUp() : void { $this->useModelSet('issue5989'); parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/Ticket2481Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/Ticket2481Test.php index ebedf0c869..ebaa71f840 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/Ticket2481Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/Ticket2481Test.php @@ -4,7 +4,7 @@ class Ticket2481Test extends \Doctrine\Tests\OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/Ticket4646InstanceOfAbstractTest.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/Ticket4646InstanceOfAbstractTest.php index 5fa5cdc86e..eaee1aae59 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/Ticket4646InstanceOfAbstractTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/Ticket4646InstanceOfAbstractTest.php @@ -6,7 +6,7 @@ class Ticket4646InstanceOfAbstractTest extends OrmFunctionalTestCase { - protected function setUp(): void + protected function setUp() : void { parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/Ticket4646InstanceOfMultiLevelTest.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/Ticket4646InstanceOfMultiLevelTest.php index 2c111a9e61..6f4e591eba 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/Ticket4646InstanceOfMultiLevelTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/Ticket4646InstanceOfMultiLevelTest.php @@ -6,7 +6,7 @@ class Ticket4646InstanceOfMultiLevelTest extends OrmFunctionalTestCase { - protected function setUp(): void + protected function setUp() : void { parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/Ticket4646InstanceOfParametricTest.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/Ticket4646InstanceOfParametricTest.php index bf11c3a85d..1f92cb02cc 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/Ticket4646InstanceOfParametricTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/Ticket4646InstanceOfParametricTest.php @@ -6,7 +6,7 @@ class Ticket4646InstanceOfParametricTest extends OrmFunctionalTestCase { - protected function setUp(): void + protected function setUp() : void { parent::setUp(); $this->_schemaTool->createSchema([ diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/Ticket4646InstanceOfTest.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/Ticket4646InstanceOfTest.php index 0ed97243c0..7d95270d9e 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/Ticket4646InstanceOfTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/Ticket4646InstanceOfTest.php @@ -6,7 +6,7 @@ class Ticket4646InstanceOfTest extends OrmFunctionalTestCase { - protected function setUp(): void + protected function setUp() : void { parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/Ticket4646InstanceOfWithMultipleParametersTest.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/Ticket4646InstanceOfWithMultipleParametersTest.php index c8c172ab69..b63b2d9ce3 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/Ticket4646InstanceOfWithMultipleParametersTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/Ticket4646InstanceOfWithMultipleParametersTest.php @@ -6,7 +6,7 @@ class Ticket4646MultipleInstanceOfWithMultipleParametersTest extends OrmFunctionalTestCase { - protected function setUp(): void + protected function setUp() : void { parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/Ticket69.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/Ticket69.php index ccc8bce120..369e326a7f 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/Ticket69.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/Ticket69.php @@ -8,7 +8,7 @@ * @author robo */ class AdvancedAssociationTest extends \Doctrine\Tests\OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { parent::setUp(); try { diff --git a/tests/Doctrine/Tests/ORM/Functional/TypeTest.php b/tests/Doctrine/Tests/ORM/Functional/TypeTest.php index 9dd99777a0..0771e30da4 100644 --- a/tests/Doctrine/Tests/ORM/Functional/TypeTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/TypeTest.php @@ -12,7 +12,7 @@ class TypeTest extends OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { $this->useModelSet('generic'); diff --git a/tests/Doctrine/Tests/ORM/Functional/TypeValueSqlTest.php b/tests/Doctrine/Tests/ORM/Functional/TypeValueSqlTest.php index 3af954cfd9..b51d5a133f 100644 --- a/tests/Doctrine/Tests/ORM/Functional/TypeValueSqlTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/TypeValueSqlTest.php @@ -12,7 +12,7 @@ class TypeValueSqlTest extends OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { if (DBALType::hasType(UpperCaseStringType::NAME)) { DBALType::overrideType(UpperCaseStringType::NAME, UpperCaseStringType::class); diff --git a/tests/Doctrine/Tests/ORM/Functional/UUIDGeneratorTest.php b/tests/Doctrine/Tests/ORM/Functional/UUIDGeneratorTest.php index ff352ba1f1..258bd4188b 100644 --- a/tests/Doctrine/Tests/ORM/Functional/UUIDGeneratorTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/UUIDGeneratorTest.php @@ -7,7 +7,7 @@ */ class UUIDGeneratorTest extends OrmFunctionalTestCase { - public function setUp() + protected function setUp() : void { parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/UnitOfWorkLifecycleTest.php b/tests/Doctrine/Tests/ORM/Functional/UnitOfWorkLifecycleTest.php index 8c4c500e72..2688d17818 100644 --- a/tests/Doctrine/Tests/ORM/Functional/UnitOfWorkLifecycleTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/UnitOfWorkLifecycleTest.php @@ -8,7 +8,7 @@ class UnitOfWorkLifecycleTest extends OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { $this->useModelSet('cms'); parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/ValueConversionType/ManyToManyCompositeIdForeignKeyTest.php b/tests/Doctrine/Tests/ORM/Functional/ValueConversionType/ManyToManyCompositeIdForeignKeyTest.php index 108ba74373..e314e8172e 100644 --- a/tests/Doctrine/Tests/ORM/Functional/ValueConversionType/ManyToManyCompositeIdForeignKeyTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/ValueConversionType/ManyToManyCompositeIdForeignKeyTest.php @@ -17,7 +17,7 @@ */ class ManyToManyCompositeIdForeignKeyTest extends OrmFunctionalTestCase { - public function setUp() + protected function setUp() : void { $this->useModelSet('vct_manytomany_compositeid_foreignkey'); @@ -44,7 +44,7 @@ public function setUp() $this->_em->clear(); } - public static function tearDownAfterClass() + public static function tearDownAfterClass() : void { $conn = static::$_sharedConn; diff --git a/tests/Doctrine/Tests/ORM/Functional/ValueConversionType/ManyToManyCompositeIdTest.php b/tests/Doctrine/Tests/ORM/Functional/ValueConversionType/ManyToManyCompositeIdTest.php index 4403f2bf95..99bec4a4a5 100644 --- a/tests/Doctrine/Tests/ORM/Functional/ValueConversionType/ManyToManyCompositeIdTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/ValueConversionType/ManyToManyCompositeIdTest.php @@ -16,7 +16,7 @@ */ class ManyToManyCompositeIdTest extends OrmFunctionalTestCase { - public function setUp() + protected function setUp() : void { $this->useModelSet('vct_manytomany_compositeid'); @@ -39,7 +39,7 @@ public function setUp() $this->_em->clear(); } - public static function tearDownAfterClass() + public static function tearDownAfterClass() : void { $conn = static::$_sharedConn; diff --git a/tests/Doctrine/Tests/ORM/Functional/ValueConversionType/ManyToManyExtraLazyTest.php b/tests/Doctrine/Tests/ORM/Functional/ValueConversionType/ManyToManyExtraLazyTest.php index af1d99de3f..06f1c091a0 100644 --- a/tests/Doctrine/Tests/ORM/Functional/ValueConversionType/ManyToManyExtraLazyTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/ValueConversionType/ManyToManyExtraLazyTest.php @@ -17,7 +17,7 @@ */ class ManyToManyExtraLazyTest extends OrmFunctionalTestCase { - public function setUp() + protected function setUp() : void { $this->useModelSet('vct_manytomany_extralazy'); parent::setUp(); @@ -53,7 +53,7 @@ public function setUp() $this->_em->clear(); } - public static function tearDownAfterClass() + public static function tearDownAfterClass() : void { $conn = static::$_sharedConn; diff --git a/tests/Doctrine/Tests/ORM/Functional/ValueConversionType/ManyToManyTest.php b/tests/Doctrine/Tests/ORM/Functional/ValueConversionType/ManyToManyTest.php index 4532ee9d5f..4ebec8d071 100644 --- a/tests/Doctrine/Tests/ORM/Functional/ValueConversionType/ManyToManyTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/ValueConversionType/ManyToManyTest.php @@ -16,7 +16,7 @@ */ class ManyToManyTest extends OrmFunctionalTestCase { - public function setUp() + protected function setUp() : void { $this->useModelSet('vct_manytomany'); @@ -38,7 +38,7 @@ public function setUp() $this->_em->clear(); } - public static function tearDownAfterClass() + public static function tearDownAfterClass() : void { $conn = static::$_sharedConn; diff --git a/tests/Doctrine/Tests/ORM/Functional/ValueConversionType/OneToManyCompositeIdForeignKeyTest.php b/tests/Doctrine/Tests/ORM/Functional/ValueConversionType/OneToManyCompositeIdForeignKeyTest.php index b76687bc4b..a8e017b0c9 100644 --- a/tests/Doctrine/Tests/ORM/Functional/ValueConversionType/OneToManyCompositeIdForeignKeyTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/ValueConversionType/OneToManyCompositeIdForeignKeyTest.php @@ -17,7 +17,7 @@ */ class OneToManyCompositeIdForeignKeyTest extends OrmFunctionalTestCase { - public function setUp() + protected function setUp() : void { $this->useModelSet('vct_onetomany_compositeid_foreignkey'); @@ -45,7 +45,7 @@ public function setUp() $this->_em->clear(); } - public static function tearDownAfterClass() + public static function tearDownAfterClass() : void { $conn = static::$_sharedConn; diff --git a/tests/Doctrine/Tests/ORM/Functional/ValueConversionType/OneToManyCompositeIdTest.php b/tests/Doctrine/Tests/ORM/Functional/ValueConversionType/OneToManyCompositeIdTest.php index 266a382e76..359def1433 100644 --- a/tests/Doctrine/Tests/ORM/Functional/ValueConversionType/OneToManyCompositeIdTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/ValueConversionType/OneToManyCompositeIdTest.php @@ -16,7 +16,7 @@ */ class OneToManyCompositeIdTest extends OrmFunctionalTestCase { - public function setUp() + protected function setUp() : void { $this->useModelSet('vct_onetomany_compositeid'); @@ -40,7 +40,7 @@ public function setUp() $this->_em->clear(); } - public static function tearDownAfterClass() + public static function tearDownAfterClass() : void { $conn = static::$_sharedConn; diff --git a/tests/Doctrine/Tests/ORM/Functional/ValueConversionType/OneToManyExtraLazyTest.php b/tests/Doctrine/Tests/ORM/Functional/ValueConversionType/OneToManyExtraLazyTest.php index 9da341467a..244c5fe1b9 100644 --- a/tests/Doctrine/Tests/ORM/Functional/ValueConversionType/OneToManyExtraLazyTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/ValueConversionType/OneToManyExtraLazyTest.php @@ -17,7 +17,7 @@ */ class OneToManyExtraLazyTest extends OrmFunctionalTestCase { - public function setUp() + protected function setUp() : void { $this->useModelSet('vct_onetomany_extralazy'); @@ -51,7 +51,7 @@ public function setUp() $this->_em->clear(); } - public static function tearDownAfterClass() + public static function tearDownAfterClass() : void { $conn = static::$_sharedConn; diff --git a/tests/Doctrine/Tests/ORM/Functional/ValueConversionType/OneToManyTest.php b/tests/Doctrine/Tests/ORM/Functional/ValueConversionType/OneToManyTest.php index 6a10296a7f..f210e2ec84 100644 --- a/tests/Doctrine/Tests/ORM/Functional/ValueConversionType/OneToManyTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/ValueConversionType/OneToManyTest.php @@ -16,7 +16,7 @@ */ class OneToManyTest extends OrmFunctionalTestCase { - public function setUp() + protected function setUp() : void { $this->useModelSet('vct_onetomany'); @@ -39,7 +39,7 @@ public function setUp() $this->_em->clear(); } - public static function tearDownAfterClass() + public static function tearDownAfterClass() : void { $conn = static::$_sharedConn; diff --git a/tests/Doctrine/Tests/ORM/Functional/ValueConversionType/OneToOneCompositeIdForeignKeyTest.php b/tests/Doctrine/Tests/ORM/Functional/ValueConversionType/OneToOneCompositeIdForeignKeyTest.php index 206ca7e325..f5bd984c04 100644 --- a/tests/Doctrine/Tests/ORM/Functional/ValueConversionType/OneToOneCompositeIdForeignKeyTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/ValueConversionType/OneToOneCompositeIdForeignKeyTest.php @@ -17,7 +17,7 @@ */ class OneToOneCompositeIdForeignKeyTest extends OrmFunctionalTestCase { - public function setUp() + protected function setUp() : void { $this->useModelSet('vct_onetoone_compositeid_foreignkey'); parent::setUp(); @@ -44,7 +44,7 @@ public function setUp() $this->_em->clear(); } - public static function tearDownAfterClass() + public static function tearDownAfterClass() : void { $conn = static::$_sharedConn; diff --git a/tests/Doctrine/Tests/ORM/Functional/ValueConversionType/OneToOneCompositeIdTest.php b/tests/Doctrine/Tests/ORM/Functional/ValueConversionType/OneToOneCompositeIdTest.php index 428fe80c6c..df63a3906e 100644 --- a/tests/Doctrine/Tests/ORM/Functional/ValueConversionType/OneToOneCompositeIdTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/ValueConversionType/OneToOneCompositeIdTest.php @@ -16,7 +16,7 @@ */ class OneToOneCompositeIdTest extends OrmFunctionalTestCase { - public function setUp() + protected function setUp() : void { $this->useModelSet('vct_onetoone_compositeid'); parent::setUp(); @@ -39,7 +39,7 @@ public function setUp() $this->_em->clear(); } - public static function tearDownAfterClass() + public static function tearDownAfterClass() : void { $conn = static::$_sharedConn; diff --git a/tests/Doctrine/Tests/ORM/Functional/ValueConversionType/OneToOneTest.php b/tests/Doctrine/Tests/ORM/Functional/ValueConversionType/OneToOneTest.php index 8ca8eebe56..9bba31c752 100644 --- a/tests/Doctrine/Tests/ORM/Functional/ValueConversionType/OneToOneTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/ValueConversionType/OneToOneTest.php @@ -16,7 +16,7 @@ */ class OneToOneTest extends OrmFunctionalTestCase { - public function setUp() + protected function setUp() : void { $this->useModelSet('vct_onetoone'); @@ -39,7 +39,7 @@ public function setUp() $this->_em->clear(); } - public static function tearDownAfterClass() + public static function tearDownAfterClass() : void { $conn = static::$_sharedConn; diff --git a/tests/Doctrine/Tests/ORM/Functional/ValueObjectsTest.php b/tests/Doctrine/Tests/ORM/Functional/ValueObjectsTest.php index efeac8414a..b1e6fdd93d 100644 --- a/tests/Doctrine/Tests/ORM/Functional/ValueObjectsTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/ValueObjectsTest.php @@ -21,7 +21,7 @@ */ class ValueObjectsTest extends OrmFunctionalTestCase { - public function setUp() + protected function setUp() : void { parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Functional/VersionedOneToOneTest.php b/tests/Doctrine/Tests/ORM/Functional/VersionedOneToOneTest.php index f8062f9954..8548b1834a 100644 --- a/tests/Doctrine/Tests/ORM/Functional/VersionedOneToOneTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/VersionedOneToOneTest.php @@ -16,7 +16,7 @@ */ class VersionedOneToOneTest extends OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Hydration/HydrationTestCase.php b/tests/Doctrine/Tests/ORM/Hydration/HydrationTestCase.php index a2b099162b..3284e026fb 100644 --- a/tests/Doctrine/Tests/ORM/Hydration/HydrationTestCase.php +++ b/tests/Doctrine/Tests/ORM/Hydration/HydrationTestCase.php @@ -8,7 +8,7 @@ class HydrationTestCase extends \Doctrine\Tests\OrmTestCase { protected $_em; - protected function setUp() + protected function setUp() : void { parent::setUp(); $this->_em = $this->_getTestEntityManager(); diff --git a/tests/Doctrine/Tests/ORM/Hydration/ObjectHydratorTest.php b/tests/Doctrine/Tests/ORM/Hydration/ObjectHydratorTest.php index c7d82a0dc7..56e6db2ea9 100644 --- a/tests/Doctrine/Tests/ORM/Hydration/ObjectHydratorTest.php +++ b/tests/Doctrine/Tests/ORM/Hydration/ObjectHydratorTest.php @@ -407,9 +407,9 @@ public function testMixedQueryNormalJoin($userEntityKey) $this->assertEquals(2, count($result)); - $this->assertInternalType('array', $result); - $this->assertInternalType('array', $result[0]); - $this->assertInternalType('array', $result[1]); + $this->assertIsArray($result); + $this->assertIsArray($result[0]); + $this->assertIsArray($result[1]); // first user => 2 phonenumbers $this->assertEquals(2, $result[0]['numPhones']); @@ -471,9 +471,9 @@ public function testMixedQueryFetchJoin($userEntityKey) $this->assertEquals(2, count($result)); - $this->assertInternalType('array', $result); - $this->assertInternalType('array', $result[0]); - $this->assertInternalType('array', $result[1]); + $this->assertIsArray($result); + $this->assertIsArray($result[0]); + $this->assertIsArray($result[1]); $this->assertInstanceOf(CmsUser::class, $result[0][$userEntityKey]); $this->assertInstanceOf(PersistentCollection::class, $result[0][$userEntityKey]->phonenumbers); @@ -552,9 +552,9 @@ public function testMixedQueryFetchJoinCustomIndex($userEntityKey) $this->assertEquals(2, count($result)); - $this->assertInternalType('array', $result); - $this->assertInternalType('array', $result[1]); - $this->assertInternalType('array', $result[2]); + $this->assertIsArray($result); + $this->assertIsArray($result[1]); + $this->assertIsArray($result[2]); // test the scalar values $this->assertEquals('ROMANB', $result[1]['nameUpper']); @@ -985,8 +985,8 @@ public function testScalarQueryWithoutResultVariables($userEntityKey) $this->assertEquals(2, count($result)); - $this->assertInternalType('array', $result[0]); - $this->assertInternalType('array', $result[1]); + $this->assertIsArray($result[0]); + $this->assertIsArray($result[1]); $this->assertEquals(1, $result[0]['id']); $this->assertEquals('romanb', $result[0]['name']); @@ -1090,7 +1090,7 @@ public function testCreatesProxyForLazyLoadingWithForeignKeysWithAliasedProductE $this->assertEquals(1, count($result)); - $this->assertInternalType('array', $result[0]); + $this->assertIsArray($result[0]); $this->assertInstanceOf(ECommerceProduct::class, $result[0]['product']); } @@ -1213,10 +1213,10 @@ public function testChainedJoinWithEmptyCollectionsWithAliasedUserEntity() $this->assertEquals(2, count($result)); - $this->assertInternalType('array', $result[0]); + $this->assertIsArray($result[0]); $this->assertInstanceOf(CmsUser::class, $result[0]['user']); - $this->assertInternalType('array', $result[1]); + $this->assertIsArray($result[1]); $this->assertInstanceOf(CmsUser::class, $result[1]['user']); $this->assertEquals(0, $result[0]['user']->articles->count()); @@ -1550,9 +1550,9 @@ public function testManyToManyHydrationWithAliasedUserEntity() $this->assertEquals(2, count($result)); - $this->assertInternalType('array', $result[0]); + $this->assertIsArray($result[0]); $this->assertInstanceOf(CmsUser::class, $result[0]['user']); - $this->assertInternalType('array', $result[1]); + $this->assertIsArray($result[1]); $this->assertInstanceOf(CmsUser::class, $result[1]['user']); $this->assertEquals(2, count($result[0]['user']->groups)); @@ -1822,12 +1822,11 @@ public function testIndexByScalarsOnly($userEntityKey) /** * @group DDC-1470 - * - * @expectedException \Doctrine\ORM\Internal\Hydration\HydrationException - * @expectedExceptionMessage The meta mapping for the discriminator column "c_discr" is missing for "Doctrine\Tests\Models\Company\CompanyFixContract" using the DQL alias "c". */ public function testMissingMetaMappingException() { + $this->expectException('Doctrine\ORM\Internal\Hydration\HydrationException'); + $this->expectExceptionMessage('The meta mapping for the discriminator column "c_discr" is missing for "Doctrine\Tests\Models\Company\CompanyFixContract" using the DQL alias "c".'); $rsm = new ResultSetMapping; $rsm->addEntityResult(CompanyFixContract::class, 'c'); @@ -1849,12 +1848,11 @@ public function testMissingMetaMappingException() /** * @group DDC-1470 - * - * @expectedException \Doctrine\ORM\Internal\Hydration\HydrationException - * @expectedExceptionMessage The discriminator column "discr" is missing for "Doctrine\Tests\Models\Company\CompanyEmployee" using the DQL alias "e". */ public function testMissingDiscriminatorColumnException() { + $this->expectException('Doctrine\ORM\Internal\Hydration\HydrationException'); + $this->expectExceptionMessage('The discriminator column "discr" is missing for "Doctrine\Tests\Models\Company\CompanyEmployee" using the DQL alias "e".'); $rsm = new ResultSetMapping; $rsm->addEntityResult(CompanyFixContract::class, 'c'); @@ -1883,12 +1881,11 @@ public function testMissingDiscriminatorColumnException() /** * @group DDC-3076 - * - * @expectedException \Doctrine\ORM\Internal\Hydration\HydrationException - * @expectedExceptionMessage The discriminator value "subworker" is invalid. It must be one of "person", "manager", "employee". */ public function testInvalidDiscriminatorValueException() { + $this->expectException('Doctrine\ORM\Internal\Hydration\HydrationException'); + $this->expectExceptionMessage('The discriminator value "subworker" is invalid. It must be one of "person", "manager", "employee".'); $rsm = new ResultSetMapping; $rsm->addEntityResult(CompanyPerson::class, 'p'); diff --git a/tests/Doctrine/Tests/ORM/Hydration/ResultSetMappingTest.php b/tests/Doctrine/Tests/ORM/Hydration/ResultSetMappingTest.php index e341a35131..6eb33126c0 100644 --- a/tests/Doctrine/Tests/ORM/Hydration/ResultSetMappingTest.php +++ b/tests/Doctrine/Tests/ORM/Hydration/ResultSetMappingTest.php @@ -28,7 +28,8 @@ class ResultSetMappingTest extends \Doctrine\Tests\OrmTestCase */ private $_em; - protected function setUp() { + protected function setUp() : void + { parent::setUp(); $this->_rsm = new ResultSetMapping; $this->_em = $this->_getTestEntityManager(); diff --git a/tests/Doctrine/Tests/ORM/Hydration/ScalarHydratorTest.php b/tests/Doctrine/Tests/ORM/Hydration/ScalarHydratorTest.php index 919486cc8e..dd2aab48f5 100644 --- a/tests/Doctrine/Tests/ORM/Hydration/ScalarHydratorTest.php +++ b/tests/Doctrine/Tests/ORM/Hydration/ScalarHydratorTest.php @@ -37,7 +37,7 @@ public function testNewHydrationSimpleEntityQuery() $result = $hydrator->hydrateAll($stmt, $rsm); - $this->assertInternalType('array', $result); + $this->assertIsArray($result); $this->assertCount(2, $result); $this->assertEquals('romanb', $result[0]['u_name']); $this->assertEquals(1, $result[0]['u_id']); diff --git a/tests/Doctrine/Tests/ORM/Hydration/SimpleObjectHydratorTest.php b/tests/Doctrine/Tests/ORM/Hydration/SimpleObjectHydratorTest.php index ffcd81e357..76c286ab54 100644 --- a/tests/Doctrine/Tests/ORM/Hydration/SimpleObjectHydratorTest.php +++ b/tests/Doctrine/Tests/ORM/Hydration/SimpleObjectHydratorTest.php @@ -14,12 +14,11 @@ class SimpleObjectHydratorTest extends HydrationTestCase { /** * @group DDC-1470 - * - * @expectedException \Doctrine\ORM\Internal\Hydration\HydrationException - * @expectedExceptionMessage The discriminator column "discr" is missing for "Doctrine\Tests\Models\Company\CompanyPerson" using the DQL alias "p". */ public function testMissingDiscriminatorColumnException() { + $this->expectException('Doctrine\ORM\Internal\Hydration\HydrationException'); + $this->expectExceptionMessage('The discriminator column "discr" is missing for "Doctrine\Tests\Models\Company\CompanyPerson" using the DQL alias "p".'); $rsm = new ResultSetMapping; $rsm->addEntityResult(CompanyPerson::class, 'p'); $rsm->addFieldResult('p', 'p__id', 'id'); @@ -64,12 +63,11 @@ public function testExtraFieldInResultSetShouldBeIgnore() /** * @group DDC-3076 - * - * @expectedException \Doctrine\ORM\Internal\Hydration\HydrationException - * @expectedExceptionMessage The discriminator value "subworker" is invalid. It must be one of "person", "manager", "employee". */ public function testInvalidDiscriminatorValueException() { + $this->expectException('Doctrine\ORM\Internal\Hydration\HydrationException'); + $this->expectExceptionMessage('The discriminator value "subworker" is invalid. It must be one of "person", "manager", "employee".'); $rsm = new ResultSetMapping; $rsm->addEntityResult(CompanyPerson::class, 'p'); diff --git a/tests/Doctrine/Tests/ORM/Id/AssignedGeneratorTest.php b/tests/Doctrine/Tests/ORM/Id/AssignedGeneratorTest.php index aa0240ebcd..86f8b5a092 100644 --- a/tests/Doctrine/Tests/ORM/Id/AssignedGeneratorTest.php +++ b/tests/Doctrine/Tests/ORM/Id/AssignedGeneratorTest.php @@ -16,7 +16,7 @@ class AssignedGeneratorTest extends OrmTestCase private $_em; private $_assignedGen; - protected function setUp() + protected function setUp() : void { $this->_em = $this->_getTestEntityManager(); $this->_assignedGen = new AssignedGenerator; diff --git a/tests/Doctrine/Tests/ORM/Internal/HydrationCompleteHandlerTest.php b/tests/Doctrine/Tests/ORM/Internal/HydrationCompleteHandlerTest.php index bd8046a99a..c3cfe4052e 100644 --- a/tests/Doctrine/Tests/ORM/Internal/HydrationCompleteHandlerTest.php +++ b/tests/Doctrine/Tests/ORM/Internal/HydrationCompleteHandlerTest.php @@ -53,7 +53,7 @@ class HydrationCompleteHandlerTest extends TestCase /** * {@inheritDoc} */ - protected function setUp() + protected function setUp() : void { $this->listenersInvoker = $this->createMock(ListenersInvoker::class); $this->entityManager = $this->createMock(EntityManagerInterface::class); diff --git a/tests/Doctrine/Tests/ORM/LazyCriteriaCollectionTest.php b/tests/Doctrine/Tests/ORM/LazyCriteriaCollectionTest.php index 9286da614f..9cde0e758a 100644 --- a/tests/Doctrine/Tests/ORM/LazyCriteriaCollectionTest.php +++ b/tests/Doctrine/Tests/ORM/LazyCriteriaCollectionTest.php @@ -34,7 +34,7 @@ class LazyCriteriaCollectionTest extends TestCase /** * {@inheritDoc} */ - protected function setUp() + protected function setUp() : void { $this->persister = $this->createMock(EntityPersister::class); $this->criteria = new Criteria(); diff --git a/tests/Doctrine/Tests/ORM/Mapping/AbstractMappingDriverTest.php b/tests/Doctrine/Tests/ORM/Mapping/AbstractMappingDriverTest.php index f9bbe629e2..2a385dfc72 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/AbstractMappingDriverTest.php +++ b/tests/Doctrine/Tests/ORM/Mapping/AbstractMappingDriverTest.php @@ -149,7 +149,7 @@ public function testEntityOptions($class) */ public function testEntitySequence($class) { - $this->assertInternalType('array', $class->sequenceGeneratorDefinition, 'No Sequence Definition set on this driver.'); + $this->assertIsArray($class->sequenceGeneratorDefinition, 'No Sequence Definition set on this driver.'); $this->assertEquals( [ 'sequenceName' => 'tablename_seq', @@ -275,10 +275,10 @@ public function testBooleanValuesForOptionIsSetCorrectly() { $class = $this->createClassMetadata(User::class); - $this->assertInternalType('bool', $class->fieldMappings['id']['options']['unsigned']); + $this->assertIsBool($class->fieldMappings['id']['options']['unsigned']); $this->assertFalse($class->fieldMappings['id']['options']['unsigned']); - $this->assertInternalType('bool', $class->fieldMappings['name']['options']['fixed']); + $this->assertIsBool($class->fieldMappings['name']['options']['fixed']); $this->assertFalse($class->fieldMappings['name']['options']['fixed']); return $class; diff --git a/tests/Doctrine/Tests/ORM/Mapping/AnnotationDriverTest.php b/tests/Doctrine/Tests/ORM/Mapping/AnnotationDriverTest.php index c23c359b74..e4be969de8 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/AnnotationDriverTest.php +++ b/tests/Doctrine/Tests/ORM/Mapping/AnnotationDriverTest.php @@ -35,12 +35,10 @@ public function testLoadMetadataForNonEntityThrowsException() $annotationDriver->loadMetadataForClass('stdClass', $cm); } - /** - * @expectedException Doctrine\ORM\Cache\CacheException - * @expectedExceptionMessage Entity association field "Doctrine\Tests\ORM\Mapping\AnnotationSLC#foo" not configured as part of the second-level cache. - */ public function testFailingSecondLevelCacheAssociation() { + $this->expectException('Doctrine\ORM\Cache\CacheException'); + $this->expectExceptionMessage('Entity association field "Doctrine\Tests\ORM\Mapping\AnnotationSLC#foo" not configured as part of the second-level cache.'); $mappingDriver = $this->_loadDriver(); $class = new ClassMetadata(AnnotationSLC::class); diff --git a/tests/Doctrine/Tests/ORM/Mapping/AnsiQuoteStrategyTest.php b/tests/Doctrine/Tests/ORM/Mapping/AnsiQuoteStrategyTest.php index f447a56195..344ba6985a 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/AnsiQuoteStrategyTest.php +++ b/tests/Doctrine/Tests/ORM/Mapping/AnsiQuoteStrategyTest.php @@ -28,7 +28,7 @@ class AnsiQuoteStrategyTest extends OrmTestCase */ private $platform; - protected function setUp() + protected function setUp() : void { parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Mapping/BasicInheritanceMappingTest.php b/tests/Doctrine/Tests/ORM/Mapping/BasicInheritanceMappingTest.php index cc95a21b64..ae5e21aae9 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/BasicInheritanceMappingTest.php +++ b/tests/Doctrine/Tests/ORM/Mapping/BasicInheritanceMappingTest.php @@ -24,7 +24,8 @@ class BasicInheritanceMappingTest extends OrmTestCase /** * {@inheritDoc} */ - protected function setUp() { + protected function setUp() : void + { $this->cmf = new ClassMetadataFactory(); $this->cmf->setEntityManager($this->_getTestEntityManager()); diff --git a/tests/Doctrine/Tests/ORM/Mapping/ClassMetadataBuilderTest.php b/tests/Doctrine/Tests/ORM/Mapping/ClassMetadataBuilderTest.php index 5b0881de42..ce42a4ef45 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/ClassMetadataBuilderTest.php +++ b/tests/Doctrine/Tests/ORM/Mapping/ClassMetadataBuilderTest.php @@ -26,7 +26,7 @@ class ClassMetadataBuilderTest extends OrmTestCase */ private $builder; - public function setUp() + protected function setUp() : void { $this->cm = new ClassMetadata(CmsUser::class); $this->cm->initializeReflection(new RuntimeReflectionService()); diff --git a/tests/Doctrine/Tests/ORM/Mapping/ClassMetadataFactoryTest.php b/tests/Doctrine/Tests/ORM/Mapping/ClassMetadataFactoryTest.php index f58010fb5a..99672bd081 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/ClassMetadataFactoryTest.php +++ b/tests/Doctrine/Tests/ORM/Mapping/ClassMetadataFactoryTest.php @@ -29,6 +29,7 @@ use Doctrine\Tests\Models\Quote; use Doctrine\Tests\OrmTestCase; use DoctrineGlobal_Article; +use ReflectionClass; class ClassMetadataFactoryTest extends OrmTestCase { @@ -411,7 +412,10 @@ public function testAcceptsEntityManagerInterfaceInstances() $classMetadataFactory->setEntityManager($entityManager); // not really the cleanest way to check it, but we won't add a getter to the CMF just for the sake of testing. - $this->assertAttributeSame($entityManager, 'em', $classMetadataFactory); + $class = new ReflectionClass(ClassMetadataFactory::class); + $property = $class->getProperty('em'); + $property->setAccessible(true); + $this->assertSame($entityManager, $property->getValue($classMetadataFactory)); } /** diff --git a/tests/Doctrine/Tests/ORM/Mapping/ClassMetadataTest.php b/tests/Doctrine/Tests/ORM/Mapping/ClassMetadataTest.php index b497655096..b5fbe23972 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/ClassMetadataTest.php +++ b/tests/Doctrine/Tests/ORM/Mapping/ClassMetadataTest.php @@ -811,12 +811,10 @@ public function testSerializeEntityListeners() $this->assertEquals($metadata->entityListeners, $unserialize->entityListeners); } - /** - * @expectedException \Doctrine\ORM\Mapping\MappingException - * @expectedExceptionMessage Query named "userById" in "Doctrine\Tests\Models\CMS\CmsUser" was already declared, but it must be declared only once - */ public function testNamingCollisionNamedQueryShouldThrowException() { + $this->expectException('Doctrine\ORM\Mapping\MappingException'); + $this->expectExceptionMessage('Query named "userById" in "Doctrine\Tests\Models\CMS\CmsUser" was already declared, but it must be declared only once'); $cm = new ClassMetadata(CMS\CmsUser::class); $cm->initializeReflection(new RuntimeReflectionService()); @@ -837,12 +835,11 @@ public function testNamingCollisionNamedQueryShouldThrowException() /** * @group DDC-1663 - * - * @expectedException \Doctrine\ORM\Mapping\MappingException - * @expectedExceptionMessage Query named "find-all" in "Doctrine\Tests\Models\CMS\CmsUser" was already declared, but it must be declared only once */ public function testNamingCollisionNamedNativeQueryShouldThrowException() { + $this->expectException('Doctrine\ORM\Mapping\MappingException'); + $this->expectExceptionMessage('Query named "find-all" in "Doctrine\Tests\Models\CMS\CmsUser" was already declared, but it must be declared only once'); $cm = new ClassMetadata(CMS\CmsUser::class); $cm->initializeReflection(new RuntimeReflectionService()); @@ -867,12 +864,11 @@ public function testNamingCollisionNamedNativeQueryShouldThrowException() /** * @group DDC-1663 - * - * @expectedException \Doctrine\ORM\Mapping\MappingException - * @expectedExceptionMessage Result set mapping named "find-all" in "Doctrine\Tests\Models\CMS\CmsUser" was already declared, but it must be declared only once */ public function testNamingCollisionSqlResultSetMappingShouldThrowException() { + $this->expectException('Doctrine\ORM\Mapping\MappingException'); + $this->expectExceptionMessage('Result set mapping named "find-all" in "Doctrine\Tests\Models\CMS\CmsUser" was already declared, but it must be declared only once'); $cm = new ClassMetadata(CMS\CmsUser::class); $cm->initializeReflection(new RuntimeReflectionService()); @@ -943,12 +939,11 @@ public function testTargetEntityNotFound() /** * @group DDC-1663 - * - * @expectedException \Doctrine\ORM\Mapping\MappingException - * @expectedExceptionMessage Query name on entity class 'Doctrine\Tests\Models\CMS\CmsUser' is not defined. */ public function testNameIsMandatoryForNamedQueryMappingException() { + $this->expectException('Doctrine\ORM\Mapping\MappingException'); + $this->expectExceptionMessage('Query name on entity class \'Doctrine\Tests\Models\CMS\CmsUser\' is not defined.'); $cm = new ClassMetadata(CMS\CmsUser::class); $cm->initializeReflection(new RuntimeReflectionService()); $cm->addNamedQuery( @@ -960,12 +955,11 @@ public function testNameIsMandatoryForNamedQueryMappingException() /** * @group DDC-1663 - * - * @expectedException \Doctrine\ORM\Mapping\MappingException - * @expectedExceptionMessage Query name on entity class 'Doctrine\Tests\Models\CMS\CmsUser' is not defined. */ public function testNameIsMandatoryForNameNativeQueryMappingException() { + $this->expectException('Doctrine\ORM\Mapping\MappingException'); + $this->expectExceptionMessage('Query name on entity class \'Doctrine\Tests\Models\CMS\CmsUser\' is not defined.'); $cm = new ClassMetadata(CMS\CmsUser::class); $cm->initializeReflection(new RuntimeReflectionService()); $cm->addNamedQuery( @@ -979,12 +973,11 @@ public function testNameIsMandatoryForNameNativeQueryMappingException() /** * @group DDC-1663 - * - * @expectedException \Doctrine\ORM\Mapping\MappingException - * @expectedExceptionMessage Result set mapping named "find-all" in "Doctrine\Tests\Models\CMS\CmsUser requires a entity class name. */ public function testNameIsMandatoryForEntityNameSqlResultSetMappingException() { + $this->expectException('Doctrine\ORM\Mapping\MappingException'); + $this->expectExceptionMessage('Result set mapping named "find-all" in "Doctrine\Tests\Models\CMS\CmsUser requires a entity class name.'); $cm = new ClassMetadata(CMS\CmsUser::class); $cm->initializeReflection(new RuntimeReflectionService()); $cm->addSqlResultSetMapping( @@ -999,12 +992,10 @@ public function testNameIsMandatoryForEntityNameSqlResultSetMappingException() ); } - /** - * @expectedException \Doctrine\ORM\Mapping\MappingException - * @expectedExceptionMessage Discriminator column name on entity class 'Doctrine\Tests\Models\CMS\CmsUser' is not defined. - */ public function testNameIsMandatoryForDiscriminatorColumnsMappingException() { + $this->expectException('Doctrine\ORM\Mapping\MappingException'); + $this->expectExceptionMessage('Discriminator column name on entity class \'Doctrine\Tests\Models\CMS\CmsUser\' is not defined.'); $cm = new ClassMetadata(CMS\CmsUser::class); $cm->initializeReflection(new RuntimeReflectionService()); $cm->setDiscriminatorColumn([]); @@ -1082,11 +1073,11 @@ public function testInvalidCascade() /** * @group DDC-964 - * @expectedException Doctrine\ORM\Mapping\MappingException - * @expectedExceptionMessage Invalid field override named 'invalidPropertyName' for class 'Doctrine\Tests\Models\DDC964\DDC964Admin */ public function testInvalidPropertyAssociationOverrideNameException() { + $this->expectException('Doctrine\ORM\Mapping\MappingException'); + $this->expectExceptionMessage('Invalid field override named \'invalidPropertyName\' for class \'Doctrine\Tests\Models\DDC964\DDC964Admin'); $cm = new ClassMetadata(DDC964Admin::class); $cm->initializeReflection(new RuntimeReflectionService()); $cm->mapManyToOne(['fieldName' => 'address', 'targetEntity' => 'DDC964Address']); @@ -1096,11 +1087,11 @@ public function testInvalidPropertyAssociationOverrideNameException() /** * @group DDC-964 - * @expectedException Doctrine\ORM\Mapping\MappingException - * @expectedExceptionMessage Invalid field override named 'invalidPropertyName' for class 'Doctrine\Tests\Models\DDC964\DDC964Guest'. */ public function testInvalidPropertyAttributeOverrideNameException() { + $this->expectException('Doctrine\ORM\Mapping\MappingException'); + $this->expectExceptionMessage('Invalid field override named \'invalidPropertyName\' for class \'Doctrine\Tests\Models\DDC964\DDC964Guest\'.'); $cm = new ClassMetadata(DDC964Guest::class); $cm->initializeReflection(new RuntimeReflectionService()); $cm->mapField(['fieldName' => 'name']); @@ -1110,11 +1101,11 @@ public function testInvalidPropertyAttributeOverrideNameException() /** * @group DDC-964 - * @expectedException Doctrine\ORM\Mapping\MappingException - * @expectedExceptionMessage The column type of attribute 'name' on class 'Doctrine\Tests\Models\DDC964\DDC964Guest' could not be changed. */ public function testInvalidOverrideAttributeFieldTypeException() { + $this->expectException('Doctrine\ORM\Mapping\MappingException'); + $this->expectExceptionMessage('The column type of attribute \'name\' on class \'Doctrine\Tests\Models\DDC964\DDC964Guest\' could not be changed.'); $cm = new ClassMetadata(DDC964Guest::class); $cm->initializeReflection(new RuntimeReflectionService()); $cm->mapField(['fieldName' => 'name', 'type'=>'string']); @@ -1124,12 +1115,11 @@ public function testInvalidOverrideAttributeFieldTypeException() /** * @group DDC-1955 - * - * @expectedException Doctrine\ORM\Mapping\MappingException - * @expectedExceptionMessage Entity Listener "\InvalidClassName" declared on "Doctrine\Tests\Models\CMS\CmsUser" not found. */ public function testInvalidEntityListenerClassException() { + $this->expectException('Doctrine\ORM\Mapping\MappingException'); + $this->expectExceptionMessage('Entity Listener "\InvalidClassName" declared on "Doctrine\Tests\Models\CMS\CmsUser" not found.'); $cm = new ClassMetadata(CMS\CmsUser::class); $cm->initializeReflection(new RuntimeReflectionService()); @@ -1138,12 +1128,11 @@ public function testInvalidEntityListenerClassException() /** * @group DDC-1955 - * - * @expectedException Doctrine\ORM\Mapping\MappingException - * @expectedExceptionMessage Entity Listener "\Doctrine\Tests\Models\Company\CompanyContractListener" declared on "Doctrine\Tests\Models\CMS\CmsUser" has no method "invalidMethod". */ public function testInvalidEntityListenerMethodException() { + $this->expectException('Doctrine\ORM\Mapping\MappingException'); + $this->expectExceptionMessage('Entity Listener "\Doctrine\Tests\Models\Company\CompanyContractListener" declared on "Doctrine\Tests\Models\CMS\CmsUser" has no method "invalidMethod".'); $cm = new ClassMetadata(CMS\CmsUser::class); $cm->initializeReflection(new RuntimeReflectionService()); diff --git a/tests/Doctrine/Tests/ORM/Mapping/EntityListenerResolverTest.php b/tests/Doctrine/Tests/ORM/Mapping/EntityListenerResolverTest.php index cca629b940..878ab11379 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/EntityListenerResolverTest.php +++ b/tests/Doctrine/Tests/ORM/Mapping/EntityListenerResolverTest.php @@ -16,7 +16,7 @@ class EntityListenerResolverTest extends OrmTestCase */ private $resolver; - protected function setUp() + protected function setUp() : void { parent::setUp(); $this->resolver = new DefaultEntityListenerResolver(); @@ -74,7 +74,7 @@ public function testClearAll() $this->assertInstanceOf($className1, $obj1); $this->assertInstanceOf($className2, $obj2); - + $this->assertSame($obj1, $this->resolver->resolve($className1)); $this->assertSame($obj2, $this->resolver->resolve($className2)); @@ -82,17 +82,15 @@ public function testClearAll() $this->assertInstanceOf($className1, $this->resolver->resolve($className1)); $this->assertInstanceOf($className2, $this->resolver->resolve($className2)); - + $this->assertNotSame($obj1, $this->resolver->resolve($className1)); $this->assertNotSame($obj2, $this->resolver->resolve($className2)); } - /** - * @expectedException InvalidArgumentException - * @expectedExceptionMessage An object was expected, but got "string". - */ public function testRegisterStringException() { + $this->expectException('InvalidArgumentException'); + $this->expectExceptionMessage('An object was expected, but got "string".'); $this->resolver->register('CompanyContractListener'); } } diff --git a/tests/Doctrine/Tests/ORM/Mapping/PHPMappingDriverTest.php b/tests/Doctrine/Tests/ORM/Mapping/PHPMappingDriverTest.php index fbd22a1a5c..5a30fc36f0 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/PHPMappingDriverTest.php +++ b/tests/Doctrine/Tests/ORM/Mapping/PHPMappingDriverTest.php @@ -35,12 +35,10 @@ public function testinvalidEntityOrMappedSuperClassShouldMentionParentClasses() self::assertInstanceOf(ClassMetadata::class, $this->createClassMetadata(DDC889Class::class)); } - /** - * @expectedException Doctrine\ORM\Cache\CacheException - * @expectedExceptionMessage Entity association field "Doctrine\Tests\ORM\Mapping\PHPSLC#foo" not configured as part of the second-level cache. - */ public function testFailingSecondLevelCacheAssociation() { + $this->expectException('Doctrine\ORM\Cache\CacheException'); + $this->expectExceptionMessage('Entity association field "Doctrine\Tests\ORM\Mapping\PHPSLC#foo" not configured as part of the second-level cache.'); $mappingDriver = $this->_loadDriver(); $class = new ClassMetadata(Mapping\PHPSLC::class); diff --git a/tests/Doctrine/Tests/ORM/Mapping/QuoteStrategyTest.php b/tests/Doctrine/Tests/ORM/Mapping/QuoteStrategyTest.php index c264e98e7b..37ff16d4de 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/QuoteStrategyTest.php +++ b/tests/Doctrine/Tests/ORM/Mapping/QuoteStrategyTest.php @@ -28,7 +28,7 @@ class QuoteStrategyTest extends OrmTestCase */ private $platform; - protected function setUp() + protected function setUp() : void { parent::setUp(); $em = $this->_getTestEntityManager(); diff --git a/tests/Doctrine/Tests/ORM/Mapping/Symfony/AbstractDriverTest.php b/tests/Doctrine/Tests/ORM/Mapping/Symfony/AbstractDriverTest.php index c905929a7e..99e2d0230f 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/Symfony/AbstractDriverTest.php +++ b/tests/Doctrine/Tests/ORM/Mapping/Symfony/AbstractDriverTest.php @@ -63,13 +63,13 @@ public function testFindMappingNamespaceNotFound() $driver->getLocator()->findMappingFile('MyOtherNamespace\MySubnamespace\Entity\Foo'); } - protected function setUp() + protected function setUp() : void { $this->dir = sys_get_temp_dir().'/abstract_driver_test'; @mkdir($this->dir, 0777, true); } - protected function tearDown() + protected function tearDown() : void { $iterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($this->dir), \RecursiveIteratorIterator::CHILD_FIRST); diff --git a/tests/Doctrine/Tests/ORM/Mapping/Symfony/YamlDriverTest.php b/tests/Doctrine/Tests/ORM/Mapping/Symfony/YamlDriverTest.php index f167132f6b..f0b4decdfc 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/Symfony/YamlDriverTest.php +++ b/tests/Doctrine/Tests/ORM/Mapping/Symfony/YamlDriverTest.php @@ -20,7 +20,7 @@ protected function getFileExtension() protected function getDriver(array $paths = []) { $driver = new SimplifiedYamlDriver(array_flip($paths)); - $this->expectDeprecationMessage('YAML mapping driver is deprecated and will be removed in Doctrine ORM 3.0, please migrate to annotation or XML driver.'); + $this->expectDeprecationMessageSame('YAML mapping driver is deprecated and will be removed in Doctrine ORM 3.0, please migrate to annotation or XML driver.'); return $driver; } diff --git a/tests/Doctrine/Tests/ORM/Mapping/XmlMappingDriverTest.php b/tests/Doctrine/Tests/ORM/Mapping/XmlMappingDriverTest.php index 8c6d562eac..30180a9909 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/XmlMappingDriverTest.php +++ b/tests/Doctrine/Tests/ORM/Mapping/XmlMappingDriverTest.php @@ -42,12 +42,10 @@ public function testClassTableInheritanceDiscriminatorMap() $this->assertEquals($expectedMap, $class->discriminatorMap); } - /** - * @expectedException \Doctrine\ORM\Cache\CacheException - * @expectedExceptionMessage Entity association field "Doctrine\Tests\ORM\Mapping\XMLSLC#foo" not configured as part of the second-level cache. - */ public function testFailingSecondLevelCacheAssociation() { + $this->expectException('Doctrine\ORM\Cache\CacheException'); + $this->expectExceptionMessage('Entity association field "Doctrine\Tests\ORM\Mapping\XMLSLC#foo" not configured as part of the second-level cache.'); $mappingDriver = $this->_loadDriver(); $class = new ClassMetadata(XMLSLC::class); @@ -137,12 +135,11 @@ public function testEmbeddedMapping() /** * @group DDC-1468 - * - * @expectedException \Doctrine\Persistence\Mapping\MappingException - * @expectedExceptionMessage Invalid mapping file 'Doctrine.Tests.Models.Generic.SerializationModel.dcm.xml' for class 'Doctrine\Tests\Models\Generic\SerializationModel'. */ public function testInvalidMappingFileException() { + $this->expectException('Doctrine\Persistence\Mapping\MappingException'); + $this->expectExceptionMessage('Invalid mapping file \'Doctrine.Tests.Models.Generic.SerializationModel.dcm.xml\' for class \'Doctrine\Tests\Models\Generic\SerializationModel\'.'); $this->createClassMetadata(SerializationModel::class); } @@ -211,11 +208,11 @@ public function testManyToManyDefaultOrderByAsc() : void /** * @group DDC-889 - * @expectedException \Doctrine\Persistence\Mapping\MappingException - * @expectedExceptionMessage Invalid mapping file 'Doctrine.Tests.Models.DDC889.DDC889Class.dcm.xml' for class 'Doctrine\Tests\Models\DDC889\DDC889Class'. */ public function testinvalidEntityOrMappedSuperClassShouldMentionParentClasses() { + $this->expectException('Doctrine\Persistence\Mapping\MappingException'); + $this->expectExceptionMessage('Invalid mapping file \'Doctrine.Tests.Models.DDC889.DDC889Class.dcm.xml\' for class \'Doctrine\Tests\Models\DDC889\DDC889Class\'.'); $this->createClassMetadata(DDC889Class::class); } } diff --git a/tests/Doctrine/Tests/ORM/Mapping/YamlMappingDriverTest.php b/tests/Doctrine/Tests/ORM/Mapping/YamlMappingDriverTest.php index fc97d29d33..1edc4a1010 100644 --- a/tests/Doctrine/Tests/ORM/Mapping/YamlMappingDriverTest.php +++ b/tests/Doctrine/Tests/ORM/Mapping/YamlMappingDriverTest.php @@ -51,12 +51,11 @@ public function testJoinTablesWithMappedSuperclassForYamlDriver() /** * @group DDC-1468 - * - * @expectedException Doctrine\Persistence\Mapping\MappingException - * @expectedExceptionMessage Invalid mapping file 'Doctrine.Tests.Models.Generic.SerializationModel.dcm.yml' for class 'Doctrine\Tests\Models\Generic\SerializationModel'. */ public function testInvalidMappingFileException() { + $this->expectException('Doctrine\Persistence\Mapping\MappingException'); + $this->expectExceptionMessage('Invalid mapping file \'Doctrine.Tests.Models.Generic.SerializationModel.dcm.yml\' for class \'Doctrine\Tests\Models\Generic\SerializationModel\'.'); $this->createClassMetadata(SerializationModel::class); } @@ -86,9 +85,8 @@ public function testSpacesShouldBeIgnoredWhenUseExplode() public function testDeprecation() : void { $this->createClassMetadata(DDC2069Entity::class); - $this->expectDeprecationMessage('YAML mapping driver is deprecated and will be removed in Doctrine ORM 3.0, please migrate to annotation or XML driver.'); + $this->expectDeprecationMessageSame('YAML mapping driver is deprecated and will be removed in Doctrine ORM 3.0, please migrate to annotation or XML driver.'); } - } class DDC2069Entity diff --git a/tests/Doctrine/Tests/ORM/Performance/SecondLevelCacheTest.php b/tests/Doctrine/Tests/ORM/Performance/SecondLevelCacheTest.php index f954d4f479..568bd56b8d 100644 --- a/tests/Doctrine/Tests/ORM/Performance/SecondLevelCacheTest.php +++ b/tests/Doctrine/Tests/ORM/Performance/SecondLevelCacheTest.php @@ -15,7 +15,7 @@ */ class SecondLevelCacheTest extends OrmFunctionalTestCase { - protected function setUp() + protected function setUp() : void { parent::useModelSet('cache'); parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/PersistentCollectionTest.php b/tests/Doctrine/Tests/ORM/PersistentCollectionTest.php index bfee130f0b..b8a1523cb0 100644 --- a/tests/Doctrine/Tests/ORM/PersistentCollectionTest.php +++ b/tests/Doctrine/Tests/ORM/PersistentCollectionTest.php @@ -30,7 +30,7 @@ class PersistentCollectionTest extends OrmTestCase */ private $_emMock; - protected function setUp() + protected function setUp() : void { parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Persisters/BasicEntityPersisterCompositeTypeParametersTest.php b/tests/Doctrine/Tests/ORM/Persisters/BasicEntityPersisterCompositeTypeParametersTest.php index 000eb637eb..e427318ad8 100644 --- a/tests/Doctrine/Tests/ORM/Persisters/BasicEntityPersisterCompositeTypeParametersTest.php +++ b/tests/Doctrine/Tests/ORM/Persisters/BasicEntityPersisterCompositeTypeParametersTest.php @@ -24,7 +24,7 @@ class BasicEntityPersisterCompositeTypeParametersTest extends OrmTestCase /** * {@inheritDoc} */ - protected function setUp() + protected function setUp() : void { parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Persisters/BasicEntityPersisterCompositeTypeSqlTest.php b/tests/Doctrine/Tests/ORM/Persisters/BasicEntityPersisterCompositeTypeSqlTest.php index 9392b8ee50..2d7592d1c4 100644 --- a/tests/Doctrine/Tests/ORM/Persisters/BasicEntityPersisterCompositeTypeSqlTest.php +++ b/tests/Doctrine/Tests/ORM/Persisters/BasicEntityPersisterCompositeTypeSqlTest.php @@ -22,7 +22,7 @@ class BasicEntityPersisterCompositeTypeSqlTest extends OrmTestCase /** * {@inheritDoc} */ - protected function setUp() + protected function setUp() : void { parent::setUp(); @@ -48,11 +48,9 @@ public function testSelectConditionStatementNeqNull() $this->assertEquals('t0.admin1 IS NOT NULL AND t0.country IS NOT NULL', $statement); } - /** - * @expectedException Doctrine\ORM\ORMException - */ public function testSelectConditionStatementIn() { + $this->expectException('Doctrine\ORM\ORMException'); $this->_persister->getSelectConditionStatementSQL('admin1', [], [], Comparison::IN); } } diff --git a/tests/Doctrine/Tests/ORM/Persisters/BasicEntityPersisterTypeValueSqlTest.php b/tests/Doctrine/Tests/ORM/Persisters/BasicEntityPersisterTypeValueSqlTest.php index ba1d18051e..d721c25cc4 100644 --- a/tests/Doctrine/Tests/ORM/Persisters/BasicEntityPersisterTypeValueSqlTest.php +++ b/tests/Doctrine/Tests/ORM/Persisters/BasicEntityPersisterTypeValueSqlTest.php @@ -27,7 +27,7 @@ class BasicEntityPersisterTypeValueSqlTest extends OrmTestCase /** * {@inheritDoc} */ - protected function setUp() + protected function setUp() : void { parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Persisters/JoinedSubclassPersisterTest.php b/tests/Doctrine/Tests/ORM/Persisters/JoinedSubclassPersisterTest.php index 4a4cec244a..a4a43cdd3c 100644 --- a/tests/Doctrine/Tests/ORM/Persisters/JoinedSubclassPersisterTest.php +++ b/tests/Doctrine/Tests/ORM/Persisters/JoinedSubclassPersisterTest.php @@ -26,7 +26,7 @@ class JoinedSubClassPersisterTest extends OrmTestCase /** * {@inheritDoc} */ - protected function setUp() + protected function setUp() : void { parent::setUp(); diff --git a/tests/Doctrine/Tests/ORM/Proxy/ProxyFactoryTest.php b/tests/Doctrine/Tests/ORM/Proxy/ProxyFactoryTest.php index c82cd68799..666edc9a46 100644 --- a/tests/Doctrine/Tests/ORM/Proxy/ProxyFactoryTest.php +++ b/tests/Doctrine/Tests/ORM/Proxy/ProxyFactoryTest.php @@ -46,7 +46,7 @@ class ProxyFactoryTest extends OrmTestCase /** * {@inheritDoc} */ - protected function setUp() + protected function setUp() : void { parent::setUp(); $this->connectionMock = new ConnectionMock([], new DriverMock()); diff --git a/tests/Doctrine/Tests/ORM/Query/CustomTreeWalkersJoinTest.php b/tests/Doctrine/Tests/ORM/Query/CustomTreeWalkersJoinTest.php index 9bc5bf5a0d..b36e713b1c 100644 --- a/tests/Doctrine/Tests/ORM/Query/CustomTreeWalkersJoinTest.php +++ b/tests/Doctrine/Tests/ORM/Query/CustomTreeWalkersJoinTest.php @@ -18,7 +18,7 @@ class CustomTreeWalkersJoinTest extends OrmTestCase { private $em; - protected function setUp() + protected function setUp() : void { $this->em = $this->_getTestEntityManager(); } diff --git a/tests/Doctrine/Tests/ORM/Query/CustomTreeWalkersTest.php b/tests/Doctrine/Tests/ORM/Query/CustomTreeWalkersTest.php index 4c2898141a..4b8d525bad 100644 --- a/tests/Doctrine/Tests/ORM/Query/CustomTreeWalkersTest.php +++ b/tests/Doctrine/Tests/ORM/Query/CustomTreeWalkersTest.php @@ -20,7 +20,7 @@ class CustomTreeWalkersTest extends OrmTestCase { private $_em; - protected function setUp() + protected function setUp() : void { $this->_em = $this->_getTestEntityManager(); } diff --git a/tests/Doctrine/Tests/ORM/Query/DeleteSqlGenerationTest.php b/tests/Doctrine/Tests/ORM/Query/DeleteSqlGenerationTest.php index ee5f98ac52..0e4cd6aeb0 100644 --- a/tests/Doctrine/Tests/ORM/Query/DeleteSqlGenerationTest.php +++ b/tests/Doctrine/Tests/ORM/Query/DeleteSqlGenerationTest.php @@ -21,7 +21,8 @@ class DeleteSqlGenerationTest extends OrmTestCase { private $_em; - protected function setUp() { + protected function setUp() : void + { $this->_em = $this->_getTestEntityManager(); } diff --git a/tests/Doctrine/Tests/ORM/Query/ExprTest.php b/tests/Doctrine/Tests/ORM/Query/ExprTest.php index 37a4b70a65..de2273f3a8 100644 --- a/tests/Doctrine/Tests/ORM/Query/ExprTest.php +++ b/tests/Doctrine/Tests/ORM/Query/ExprTest.php @@ -25,7 +25,7 @@ class ExprTest extends OrmTestCase */ private $_expr; - protected function setUp() + protected function setUp() : void { $this->_em = $this->_getTestEntityManager(); $this->_expr = new Expr; @@ -334,11 +334,9 @@ public function testOrderByAsc() $this->assertEquals('u.username ASC', (string) $orderExpr); } - /** - * @expectedException \InvalidArgumentException - */ public function testAddThrowsException() { + $this->expectException('InvalidArgumentException'); $orExpr = $this->_expr->orX(); $orExpr->add($this->_expr->quot(5, 2)); } diff --git a/tests/Doctrine/Tests/ORM/Query/FilterCollectionTest.php b/tests/Doctrine/Tests/ORM/Query/FilterCollectionTest.php index 0e47f6e82d..22aec4007a 100644 --- a/tests/Doctrine/Tests/ORM/Query/FilterCollectionTest.php +++ b/tests/Doctrine/Tests/ORM/Query/FilterCollectionTest.php @@ -18,7 +18,7 @@ class FilterCollectionTest extends OrmTestCase */ private $em; - protected function setUp() + protected function setUp() : void { $this->em = $this->_getTestEntityManager(); $this->em->getConfiguration()->addFilter('testFilter', MyFilter::class); @@ -63,11 +63,9 @@ public function testIsEnabled() $this->assertTrue($filterCollection->isEnabled('testFilter')); } - /** - * @expectedException InvalidArgumentException - */ public function testGetFilterInvalidArgument() { + $this->expectException('InvalidArgumentException'); $filterCollection = $this->em->getFilters(); $filterCollection->getFilter('testFilter'); } diff --git a/tests/Doctrine/Tests/ORM/Query/LanguageRecognitionTest.php b/tests/Doctrine/Tests/ORM/Query/LanguageRecognitionTest.php index 50a4653b3a..35ad12d051 100644 --- a/tests/Doctrine/Tests/ORM/Query/LanguageRecognitionTest.php +++ b/tests/Doctrine/Tests/ORM/Query/LanguageRecognitionTest.php @@ -15,7 +15,7 @@ class LanguageRecognitionTest extends OrmTestCase */ private $_em; - protected function setUp() + protected function setUp() : void { $this->_em = $this->_getTestEntityManager(); } diff --git a/tests/Doctrine/Tests/ORM/Query/LexerTest.php b/tests/Doctrine/Tests/ORM/Query/LexerTest.php index 904b897878..8140d621d1 100644 --- a/tests/Doctrine/Tests/ORM/Query/LexerTest.php +++ b/tests/Doctrine/Tests/ORM/Query/LexerTest.php @@ -7,9 +7,10 @@ class LexerTest extends OrmTestCase { - //private $_lexer; + private $_lexer; - protected function setUp() { + protected function setUp() : void + { } /** diff --git a/tests/Doctrine/Tests/ORM/Query/ParserResultTest.php b/tests/Doctrine/Tests/ORM/Query/ParserResultTest.php index 1b74654430..c0b33bbc0d 100644 --- a/tests/Doctrine/Tests/ORM/Query/ParserResultTest.php +++ b/tests/Doctrine/Tests/ORM/Query/ParserResultTest.php @@ -11,7 +11,7 @@ class ParserResultTest extends TestCase { public $parserResult; - public function setUp() + protected function setUp() : void { $this->parserResult = new ParserResult(); } @@ -39,7 +39,7 @@ public function testGetSqlParameterPosition() public function testGetParameterMappings() { - $this->assertInternalType('array', $this->parserResult->getParameterMappings()); + $this->assertIsArray($this->parserResult->getParameterMappings()); $this->parserResult->addParameterMapping(1, 1); $this->parserResult->addParameterMapping(1, 2); diff --git a/tests/Doctrine/Tests/ORM/Query/QueryExpressionVisitorTest.php b/tests/Doctrine/Tests/ORM/Query/QueryExpressionVisitorTest.php index 27dce7d6d9..2a8832f0c4 100644 --- a/tests/Doctrine/Tests/ORM/Query/QueryExpressionVisitorTest.php +++ b/tests/Doctrine/Tests/ORM/Query/QueryExpressionVisitorTest.php @@ -26,7 +26,7 @@ class QueryExpressionVisitorTest extends TestCase /** * {@inheritDoc} */ - protected function setUp() + protected function setUp() : void { $this->visitor = new QueryExpressionVisitor(['o','p']); } diff --git a/tests/Doctrine/Tests/ORM/Query/QueryTest.php b/tests/Doctrine/Tests/ORM/Query/QueryTest.php index 57492eb80f..a3dac3500b 100644 --- a/tests/Doctrine/Tests/ORM/Query/QueryTest.php +++ b/tests/Doctrine/Tests/ORM/Query/QueryTest.php @@ -7,6 +7,7 @@ use Doctrine\Common\Collections\ArrayCollection; use Doctrine\DBAL\Types\Type; use Doctrine\ORM\Internal\Hydration\IterableResult; +use Doctrine\ORM\Query; use Doctrine\ORM\Query\Parameter; use Doctrine\ORM\Query\QueryException; use Doctrine\ORM\UnitOfWork; @@ -17,13 +18,14 @@ use Doctrine\Tests\Models\CMS\CmsUser; use Doctrine\Tests\Models\Generic\DateTimeModel; use Doctrine\Tests\OrmTestCase; +use ReflectionClass; class QueryTest extends OrmTestCase { /** @var EntityManagerMock */ protected $_em; - protected function setUp() + protected function setUp() : void { $this->_em = $this->_getTestEntityManager(); } @@ -132,20 +134,16 @@ public function testQueryDefaultResultCache() $this->assertSame($this->_em->getConfiguration()->getResultCacheImpl(), $q->getQueryCacheProfile()->getResultCacheDriver()); } - /** - * @expectedException Doctrine\ORM\Query\QueryException - **/ public function testIterateWithNoDistinctAndWrongSelectClause() { + $this->expectException('Doctrine\ORM\Query\QueryException'); $q = $this->_em->createQuery("select u, a from Doctrine\Tests\Models\CMS\CmsUser u LEFT JOIN u.articles a"); $q->iterate(); } - /** - * @expectedException Doctrine\ORM\Query\QueryException - **/ public function testIterateWithNoDistinctAndWithValidSelectClause() { + $this->expectException('Doctrine\ORM\Query\QueryException'); $q = $this->_em->createQuery("select u from Doctrine\Tests\Models\CMS\CmsUser u LEFT JOIN u.articles a"); $q->iterate(); } @@ -400,7 +398,10 @@ public function testResultCacheProfileCanBeRemovedViaSetter() : void $query->enableResultCache(); $query->setResultCacheProfile(); - self::assertAttributeSame(null, '_queryCacheProfile', $query); + $class = new ReflectionClass(Query::class); + $property = $class->getProperty('_queryCacheProfile'); + $property->setAccessible(true); + self::assertNull($property->getValue($query)); } /** @group 7527 */ diff --git a/tests/Doctrine/Tests/ORM/Query/SelectSqlGenerationTest.php b/tests/Doctrine/Tests/ORM/Query/SelectSqlGenerationTest.php index 92ba2fe0dd..c26a71aeec 100644 --- a/tests/Doctrine/Tests/ORM/Query/SelectSqlGenerationTest.php +++ b/tests/Doctrine/Tests/ORM/Query/SelectSqlGenerationTest.php @@ -26,7 +26,7 @@ class SelectSqlGenerationTest extends OrmTestCase { private $_em; - protected function setUp() + protected function setUp() : void { $this->_em = $this->_getTestEntityManager(); } @@ -910,11 +910,9 @@ public function testOrderBySupportsSingleValuedPathExpressionOwningSide() ); } - /** - * @expectedException \Doctrine\ORM\Query\QueryException - */ public function testOrderBySupportsSingleValuedPathExpressionInverseSide() { + $this->expectException('Doctrine\ORM\Query\QueryException'); $q = $this->_em->createQuery("select u from Doctrine\Tests\Models\CMS\CmsUser u order by u.address"); $q->getSQL(); } diff --git a/tests/Doctrine/Tests/ORM/Query/SqlWalkerTest.php b/tests/Doctrine/Tests/ORM/Query/SqlWalkerTest.php index e23ee0117f..e2f924f256 100644 --- a/tests/Doctrine/Tests/ORM/Query/SqlWalkerTest.php +++ b/tests/Doctrine/Tests/ORM/Query/SqlWalkerTest.php @@ -22,7 +22,7 @@ class SqlWalkerTest extends OrmTestCase /** * {@inheritDoc} */ - protected function setUp() + protected function setUp() : void { $this->sqlWalker = new SqlWalker(new Query($this->_getTestEntityManager()), new ParserResult(), []); } diff --git a/tests/Doctrine/Tests/ORM/Query/UpdateSqlGenerationTest.php b/tests/Doctrine/Tests/ORM/Query/UpdateSqlGenerationTest.php index 7044929e94..5fd200c26f 100644 --- a/tests/Doctrine/Tests/ORM/Query/UpdateSqlGenerationTest.php +++ b/tests/Doctrine/Tests/ORM/Query/UpdateSqlGenerationTest.php @@ -24,7 +24,8 @@ class UpdateSqlGenerationTest extends OrmTestCase { private $_em; - protected function setUp() { + protected function setUp() : void + { if (DBALType::hasType('negative_to_positive')) { DBALType::overrideType('negative_to_positive', NegativeToPositiveType::class); } else { diff --git a/tests/Doctrine/Tests/ORM/QueryBuilderTest.php b/tests/Doctrine/Tests/ORM/QueryBuilderTest.php index 17d10f4b2d..e2f10e3f62 100644 --- a/tests/Doctrine/Tests/ORM/QueryBuilderTest.php +++ b/tests/Doctrine/Tests/ORM/QueryBuilderTest.php @@ -30,7 +30,7 @@ class QueryBuilderTest extends OrmTestCase */ private $_em; - protected function setUp() + protected function setUp() : void { $this->_em = $this->_getTestEntityManager(); } diff --git a/tests/Doctrine/Tests/ORM/Repository/DefaultRepositoryFactoryTest.php b/tests/Doctrine/Tests/ORM/Repository/DefaultRepositoryFactoryTest.php index 85a6340461..bb2b5a78fb 100644 --- a/tests/Doctrine/Tests/ORM/Repository/DefaultRepositoryFactoryTest.php +++ b/tests/Doctrine/Tests/ORM/Repository/DefaultRepositoryFactoryTest.php @@ -35,7 +35,7 @@ class DefaultRepositoryFactoryTest extends TestCase /** * {@inheritDoc} */ - protected function setUp() + protected function setUp() : void { $this->configuration = $this->createMock(Configuration::class); $this->entityManager = $this->createEntityManager(); diff --git a/tests/Doctrine/Tests/ORM/Tools/AttachEntityListenersListenerTest.php b/tests/Doctrine/Tests/ORM/Tools/AttachEntityListenersListenerTest.php index db4da0b5d8..b1b1d4ab73 100644 --- a/tests/Doctrine/Tests/ORM/Tools/AttachEntityListenersListenerTest.php +++ b/tests/Doctrine/Tests/ORM/Tools/AttachEntityListenersListenerTest.php @@ -24,7 +24,7 @@ class AttachEntityListenersListenerTest extends OrmTestCase */ private $factory; - public function setUp() + protected function setUp() : void { $this->listener = new AttachEntityListenersListener(); $driver = $this->createAnnotationDriver(); @@ -90,12 +90,10 @@ public function testAttachToExistingEntityListeners() $this->assertEquals(AttachEntityListenersListenerTestListener2::class, $metadata->entityListeners['postPersist'][1]['class']); } - /** - * @expectedException \Doctrine\ORM\Mapping\MappingException - * @expectedExceptionMessage Entity Listener "Doctrine\Tests\ORM\Tools\AttachEntityListenersListenerTestListener#postPersist()" in "Doctrine\Tests\ORM\Tools\AttachEntityListenersListenerTestFooEntity" was already declared, but it must be declared only once. - */ public function testDuplicateEntityListenerException() { + $this->expectException('Doctrine\ORM\Mapping\MappingException'); + $this->expectExceptionMessage('Entity Listener "Doctrine\Tests\ORM\Tools\AttachEntityListenersListenerTestListener#postPersist()" in "Doctrine\Tests\ORM\Tools\AttachEntityListenersListenerTestFooEntity" was already declared, but it must be declared only once.'); $this->listener->addEntityListener( AttachEntityListenersListenerTestFooEntity::class, AttachEntityListenersListenerTestListener::class, diff --git a/tests/Doctrine/Tests/ORM/Tools/Console/Command/ClearCacheCollectionRegionCommandTest.php b/tests/Doctrine/Tests/ORM/Tools/Console/Command/ClearCacheCollectionRegionCommandTest.php index f8c17b318b..c105be1128 100644 --- a/tests/Doctrine/Tests/ORM/Tools/Console/Command/ClearCacheCollectionRegionCommandTest.php +++ b/tests/Doctrine/Tests/ORM/Tools/Console/Command/ClearCacheCollectionRegionCommandTest.php @@ -25,7 +25,7 @@ class ClearCacheCollectionRegionCommandTest extends OrmFunctionalTestCase */ private $command; - protected function setUp() + protected function setUp() : void { $this->enableSecondLevelCache(); parent::setUp(); @@ -50,7 +50,7 @@ public function testClearAllRegion() ['decorated' => false] ); - self::assertContains(' // Clearing all second-level cache collection regions', $tester->getDisplay()); + self::assertStringContainsString(' // Clearing all second-level cache collection regions', $tester->getDisplay()); } public function testClearByOwnerEntityClassName() @@ -67,7 +67,7 @@ public function testClearByOwnerEntityClassName() ['decorated' => false] ); - self::assertContains( + self::assertStringContainsString( ' // Clearing second-level cache for collection "Doctrine\Tests\Models\Cache\State#cities"', $tester->getDisplay() ); @@ -88,12 +88,12 @@ public function testClearCacheEntryName() ['decorated' => false] ); - self::assertContains( + self::assertStringContainsString( ' // Clearing second-level cache entry for collection "Doctrine\Tests\Models\Cache\State#cities" owner', $tester->getDisplay() ); - self::assertContains(' // entity identified by "1"', $tester->getDisplay()); + self::assertStringContainsString(' // entity identified by "1"', $tester->getDisplay()); } public function testFlushRegionName() @@ -111,7 +111,7 @@ public function testFlushRegionName() ['decorated' => false] ); - self::assertContains( + self::assertStringContainsString( ' // Flushing cache provider configured for "Doctrine\Tests\Models\Cache\State#cities"', $tester->getDisplay() ); diff --git a/tests/Doctrine/Tests/ORM/Tools/Console/Command/ClearCacheEntityRegionCommandTest.php b/tests/Doctrine/Tests/ORM/Tools/Console/Command/ClearCacheEntityRegionCommandTest.php index b1d8d386b2..f7493e6eb8 100644 --- a/tests/Doctrine/Tests/ORM/Tools/Console/Command/ClearCacheEntityRegionCommandTest.php +++ b/tests/Doctrine/Tests/ORM/Tools/Console/Command/ClearCacheEntityRegionCommandTest.php @@ -25,7 +25,7 @@ class ClearCacheEntityRegionCommandTest extends OrmFunctionalTestCase */ private $command; - protected function setUp() + protected function setUp() : void { $this->enableSecondLevelCache(); parent::setUp(); @@ -50,7 +50,7 @@ public function testClearAllRegion() ['decorated' => false] ); - self::assertContains(' // Clearing all second-level cache entity regions', $tester->getDisplay()); + self::assertStringContainsString(' // Clearing all second-level cache entity regions', $tester->getDisplay()); } public function testClearByEntityClassName() @@ -66,7 +66,7 @@ public function testClearByEntityClassName() ['decorated' => false] ); - self::assertContains( + self::assertStringContainsString( ' // Clearing second-level cache for entity "Doctrine\Tests\Models\Cache\Country"', $tester->getDisplay() ); @@ -86,12 +86,12 @@ public function testClearCacheEntryName() ['decorated' => false] ); - self::assertContains( + self::assertStringContainsString( ' // Clearing second-level cache entry for entity "Doctrine\Tests\Models\Cache\Country" identified by', $tester->getDisplay() ); - self::assertContains(' // "1"', $tester->getDisplay()); + self::assertStringContainsString(' // "1"', $tester->getDisplay()); } public function testFlushRegionName() @@ -108,7 +108,7 @@ public function testFlushRegionName() ['decorated' => false] ); - self::assertContains( + self::assertStringContainsString( ' // Flushing cache provider configured for entity named "Doctrine\Tests\Models\Cache\Country"', $tester->getDisplay() ); diff --git a/tests/Doctrine/Tests/ORM/Tools/Console/Command/ClearCacheQueryRegionCommandTest.php b/tests/Doctrine/Tests/ORM/Tools/Console/Command/ClearCacheQueryRegionCommandTest.php index 1d761260cb..61802ea6e9 100644 --- a/tests/Doctrine/Tests/ORM/Tools/Console/Command/ClearCacheQueryRegionCommandTest.php +++ b/tests/Doctrine/Tests/ORM/Tools/Console/Command/ClearCacheQueryRegionCommandTest.php @@ -24,7 +24,7 @@ class ClearCacheQueryRegionCommandTest extends OrmFunctionalTestCase */ private $command; - protected function setUp() + protected function setUp() : void { $this->enableSecondLevelCache(); parent::setUp(); @@ -49,7 +49,7 @@ public function testClearAllRegion() ['decorated' => false] ); - self::assertContains(' // Clearing all second-level cache query regions', $tester->getDisplay()); + self::assertStringContainsString(' // Clearing all second-level cache query regions', $tester->getDisplay()); } public function testClearDefaultRegionName() @@ -65,7 +65,7 @@ public function testClearDefaultRegionName() ['decorated' => false] ); - self::assertContains( + self::assertStringContainsString( ' // Clearing second-level cache query region named "query_cache_region"', $tester->getDisplay() ); @@ -84,7 +84,7 @@ public function testClearByRegionName() ['decorated' => false] ); - self::assertContains( + self::assertStringContainsString( ' // Clearing second-level cache query region named "my_region"', $tester->getDisplay() ); @@ -104,7 +104,7 @@ public function testFlushRegionName() ['decorated' => false] ); - self::assertContains( + self::assertStringContainsString( ' // Flushing cache provider configured for second-level cache query region named "my_region"', $tester->getDisplay() ); diff --git a/tests/Doctrine/Tests/ORM/Tools/Console/Command/GenerateRepositoriesCommandTest.php b/tests/Doctrine/Tests/ORM/Tools/Console/Command/GenerateRepositoriesCommandTest.php index bf7d823fc3..b487cba566 100644 --- a/tests/Doctrine/Tests/ORM/Tools/Console/Command/GenerateRepositoriesCommandTest.php +++ b/tests/Doctrine/Tests/ORM/Tools/Console/Command/GenerateRepositoriesCommandTest.php @@ -28,7 +28,7 @@ class GenerateRepositoriesCommandTest extends OrmFunctionalTestCase /** * @inheritdoc */ - protected function setUp() + protected function setUp() : void { parent::setUp(); @@ -47,7 +47,7 @@ protected function setUp() /** * @inheritdoc */ - public function tearDown() + public function tearDown() : void { $dirs = []; @@ -172,7 +172,7 @@ public function testNoMetadataClassesToProcess() : void ] ); - self::assertContains('Command orm:generate-repositories is deprecated and will be removed in Doctrine ORM 3.0.', $tester->getDisplay()); - self::assertContains('[OK] No Metadata Classes to process.', $tester->getDisplay()); + self::assertStringContainsString('Command orm:generate-repositories is deprecated and will be removed in Doctrine ORM 3.0.', $tester->getDisplay()); + self::assertStringContainsString('[OK] No Metadata Classes to process.', $tester->getDisplay()); } } diff --git a/tests/Doctrine/Tests/ORM/Tools/Console/Command/InfoCommandTest.php b/tests/Doctrine/Tests/ORM/Tools/Console/Command/InfoCommandTest.php index 0e8c613c51..2139017b53 100644 --- a/tests/Doctrine/Tests/ORM/Tools/Console/Command/InfoCommandTest.php +++ b/tests/Doctrine/Tests/ORM/Tools/Console/Command/InfoCommandTest.php @@ -32,7 +32,7 @@ class InfoCommandTest extends OrmFunctionalTestCase */ private $tester; - protected function setUp() + protected function setUp() : void { parent::setUp(); @@ -49,8 +49,8 @@ public function testListAllClasses() { $this->tester->execute(['command' => $this->command->getName()]); - self::assertContains(AttractionInfo::class, $this->tester->getDisplay()); - self::assertContains(City::class, $this->tester->getDisplay()); + self::assertStringContainsString(AttractionInfo::class, $this->tester->getDisplay()); + self::assertStringContainsString(City::class, $this->tester->getDisplay()); } public function testEmptyEntityClassNames() : void @@ -77,12 +77,12 @@ public function testEmptyEntityClassNames() : void $tester->execute(['command' => $command->getName()]); - self::assertContains( + self::assertStringContainsString( ' ! [CAUTION] You do not have any mapped Doctrine ORM entities according to the current configuration', $tester->getDisplay() ); - self::assertContains( + self::assertStringContainsString( ' ! If you have entities or mapping files you should check your mapping configuration for errors.', $tester->getDisplay() ); @@ -116,7 +116,7 @@ public function testInvalidEntityClassMetadata() : void $tester->execute(['command' => $command->getName()]); - self::assertContains('[FAIL] InvalidEntity', $tester->getDisplay()); - self::assertContains('exception message', $tester->getDisplay()); + self::assertStringContainsString('[FAIL] InvalidEntity', $tester->getDisplay()); + self::assertStringContainsString('exception message', $tester->getDisplay()); } } diff --git a/tests/Doctrine/Tests/ORM/Tools/Console/Command/MappingDescribeCommandTest.php b/tests/Doctrine/Tests/ORM/Tools/Console/Command/MappingDescribeCommandTest.php index f73456b47a..156b9aee5f 100644 --- a/tests/Doctrine/Tests/ORM/Tools/Console/Command/MappingDescribeCommandTest.php +++ b/tests/Doctrine/Tests/ORM/Tools/Console/Command/MappingDescribeCommandTest.php @@ -32,7 +32,7 @@ class MappingDescribeCommandTest extends OrmFunctionalTestCase */ private $tester; - protected function setUp() + protected function setUp() : void { parent::setUp(); @@ -55,16 +55,14 @@ public function testShowSpecificFuzzySingle() $display = $this->tester->getDisplay(); - self::assertContains(AttractionInfo::class, $display); - self::assertContains('Root entity name', $display); + self::assertStringContainsString(AttractionInfo::class, $display); + self::assertStringContainsString('Root entity name', $display); } - /** - * @expectedException \InvalidArgumentException - * @expectedExceptionMessage possible matches - */ public function testShowSpecificFuzzyAmbiguous() { + $this->expectException('InvalidArgumentException'); + $this->expectExceptionMessage('possible matches'); $this->tester->execute( [ 'command' => $this->command->getName(), @@ -73,12 +71,10 @@ public function testShowSpecificFuzzyAmbiguous() ); } - /** - * @expectedException \InvalidArgumentException - * @expectedExceptionMessage Could not find any mapped Entity classes matching "AttractionFooBar" - */ public function testShowSpecificNotFound() { + $this->expectException('InvalidArgumentException'); + $this->expectExceptionMessage('Could not find any mapped Entity classes matching "AttractionFooBar"'); $this->tester->execute( [ 'command' => $this->command->getName(), diff --git a/tests/Doctrine/Tests/ORM/Tools/Console/Command/RunDqlCommandTest.php b/tests/Doctrine/Tests/ORM/Tools/Console/Command/RunDqlCommandTest.php index 552c678739..7ffc15fe84 100644 --- a/tests/Doctrine/Tests/ORM/Tools/Console/Command/RunDqlCommandTest.php +++ b/tests/Doctrine/Tests/ORM/Tools/Console/Command/RunDqlCommandTest.php @@ -32,7 +32,7 @@ class RunDqlCommandTest extends OrmFunctionalTestCase */ private $tester; - protected function setUp() + protected function setUp() : void { $this->useModelSet('generic'); @@ -67,7 +67,7 @@ public function testWillRunQuery() ) ); - self::assertContains(DateTimeModel::class, $this->tester->getDisplay()); + self::assertStringContainsString(DateTimeModel::class, $this->tester->getDisplay()); } public function testWillShowQuery() diff --git a/tests/Doctrine/Tests/ORM/Tools/ConvertDoctrine1SchemaTest.php b/tests/Doctrine/Tests/ORM/Tools/ConvertDoctrine1SchemaTest.php index 291228687f..fe7959ca36 100644 --- a/tests/Doctrine/Tests/ORM/Tools/ConvertDoctrine1SchemaTest.php +++ b/tests/Doctrine/Tests/ORM/Tools/ConvertDoctrine1SchemaTest.php @@ -83,7 +83,7 @@ public function testTest() $this->assertHasDeprecationMessages(); } - public function tearDown() + public function tearDown() : void { @unlink(__DIR__ . '/convert/User.dcm.yml'); @unlink(__DIR__ . '/convert/Profile.dcm.yml'); diff --git a/tests/Doctrine/Tests/ORM/Tools/EntityGeneratorTest.php b/tests/Doctrine/Tests/ORM/Tools/EntityGeneratorTest.php index 58e19db209..37cb4c1c78 100644 --- a/tests/Doctrine/Tests/ORM/Tools/EntityGeneratorTest.php +++ b/tests/Doctrine/Tests/ORM/Tools/EntityGeneratorTest.php @@ -26,7 +26,7 @@ class EntityGeneratorTest extends OrmTestCase private $_tmpDir; private $_namespace; - public function setUp() + protected function setUp() : void { $this->_namespace = uniqid("doctrine_"); $this->_tmpDir = \sys_get_temp_dir(); @@ -40,7 +40,7 @@ public function setUp() $this->_generator->setFieldVisibility(EntityGenerator::FIELD_VISIBLE_PROTECTED); } - public function tearDown() + public function tearDown() : void { $ri = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($this->_tmpDir . '/' . $this->_namespace)); foreach ($ri AS $file) { @@ -247,7 +247,7 @@ public function testEmbeddedEntityWithNamedColumnPrefix() $docComment = $refClass->getProperty('testEmbedded')->getDocComment(); $needle = sprintf('@Embedded(class="%s", columnPrefix="%s")', $testMetadata->name, $columnPrefix); - self::assertContains($needle, $docComment); + self::assertStringContainsString($needle, $docComment); } /** @@ -263,7 +263,7 @@ public function testEmbeddedEntityWithoutColumnPrefix() $docComment = $refClass->getProperty('testEmbedded')->getDocComment(); $needle = sprintf('@Embedded(class="%s", columnPrefix=false)', $testMetadata->name); - self::assertContains($needle, $docComment); + self::assertStringContainsString($needle, $docComment); } public function testGeneratedEntityClass() @@ -314,7 +314,7 @@ public function testGeneratedEntityClass() $this->assertInstanceOf($metadata->name, $book->addComment($comment)); $this->assertInstanceOf(ArrayCollection::class, $book->getComments()); $this->assertEquals(new ArrayCollection([$comment]), $book->getComments()); - $this->assertInternalType('boolean', $book->removeComment($comment)); + $this->assertIsBool($book->removeComment($comment)); $this->assertEquals(new ArrayCollection([]), $book->getComments()); $this->newInstance($isbnMetadata); @@ -609,10 +609,13 @@ public function testGenerateEntityWithSequenceGenerator() $reflection = new \ReflectionProperty($metadata->name, 'id'); $docComment = $reflection->getDocComment(); - $this->assertContains('@Id', $docComment); - $this->assertContains('@Column(name="id", type="integer")', $docComment); - $this->assertContains('@GeneratedValue(strategy="SEQUENCE")', $docComment); - $this->assertContains('@SequenceGenerator(sequenceName="DDC1784_ID_SEQ", allocationSize=1, initialValue=2)', $docComment); + $this->assertStringContainsString('@Id', $docComment); + $this->assertStringContainsString('@Column(name="id", type="integer")', $docComment); + $this->assertStringContainsString('@GeneratedValue(strategy="SEQUENCE")', $docComment); + $this->assertStringContainsString( + '@SequenceGenerator(sequenceName="DDC1784_ID_SEQ", allocationSize=1, initialValue=2)', + $docComment + ); } /** @@ -653,11 +656,23 @@ public function testGenerateEntityWithMultipleInverseJoinColumns() $docComment = $property->getDocComment(); //joinColumns - $this->assertContains('@JoinColumn(name="idorcamento", referencedColumnName="idorcamento"),', $docComment); - $this->assertContains('@JoinColumn(name="idunidade", referencedColumnName="idunidade")', $docComment); + $this->assertStringContainsString( + '@JoinColumn(name="idorcamento", referencedColumnName="idorcamento"),', + $docComment + ); + $this->assertStringContainsString( + '@JoinColumn(name="idunidade", referencedColumnName="idunidade")', + $docComment + ); //inverseJoinColumns - $this->assertContains('@JoinColumn(name="idcentrocusto", referencedColumnName="idcentrocusto"),', $docComment); - $this->assertContains('@JoinColumn(name="idpais", referencedColumnName="idpais")', $docComment); + $this->assertStringContainsString( + '@JoinColumn(name="idcentrocusto", referencedColumnName="idcentrocusto"),', + $docComment + ); + $this->assertStringContainsString( + '@JoinColumn(name="idpais", referencedColumnName="idpais")', + $docComment + ); } @@ -1233,7 +1248,7 @@ public function testOptionsAreGeneratedProperly(string $expectedAnnotation, arra $property = new \ReflectionProperty($metadata->name, 'test'); $docComment = $property->getDocComment(); - self::assertContains($expectedAnnotation, $docComment); + self::assertStringContainsString($expectedAnnotation, $docComment); } public function columnOptionsProvider() : array diff --git a/tests/Doctrine/Tests/ORM/Tools/EntityRepositoryGeneratorTest.php b/tests/Doctrine/Tests/ORM/Tools/EntityRepositoryGeneratorTest.php index d020cc6e07..73f2d40e2d 100644 --- a/tests/Doctrine/Tests/ORM/Tools/EntityRepositoryGeneratorTest.php +++ b/tests/Doctrine/Tests/ORM/Tools/EntityRepositoryGeneratorTest.php @@ -32,7 +32,7 @@ class EntityRepositoryGeneratorTest extends OrmTestCase /** * @inheritdoc */ - public function setUp() + protected function setUp() : void { $this->_namespace = uniqid('doctrine_'); $this->_tmpDir = \sys_get_temp_dir() . DIRECTORY_SEPARATOR . $this->_namespace; @@ -52,7 +52,7 @@ public function setUp() /** * @inheritdoc */ - public function tearDown() + public function tearDown() : void { $dirs = []; diff --git a/tests/Doctrine/Tests/ORM/Tools/Pagination/PaginationTestCase.php b/tests/Doctrine/Tests/ORM/Tools/Pagination/PaginationTestCase.php index a4791cd175..3cddf5c7a9 100644 --- a/tests/Doctrine/Tests/ORM/Tools/Pagination/PaginationTestCase.php +++ b/tests/Doctrine/Tests/ORM/Tools/Pagination/PaginationTestCase.php @@ -11,7 +11,7 @@ abstract class PaginationTestCase extends OrmTestCase */ public $entityManager; - protected function setUp() + protected function setUp() : void { $this->entityManager = $this->_getTestEntityManager(); } diff --git a/tests/Doctrine/Tests/ORM/Tools/ResolveTargetEntityListenerTest.php b/tests/Doctrine/Tests/ORM/Tools/ResolveTargetEntityListenerTest.php index 910df27f87..9189e53dec 100644 --- a/tests/Doctrine/Tests/ORM/Tools/ResolveTargetEntityListenerTest.php +++ b/tests/Doctrine/Tests/ORM/Tools/ResolveTargetEntityListenerTest.php @@ -24,7 +24,7 @@ class ResolveTargetEntityListenerTest extends OrmTestCase */ private $factory; - public function setUp() + protected function setUp() : void { $annotationDriver = $this->createAnnotationDriver(); diff --git a/tests/Doctrine/Tests/ORM/Tools/SchemaValidatorTest.php b/tests/Doctrine/Tests/ORM/Tools/SchemaValidatorTest.php index 682ee896d1..40f12a72e4 100644 --- a/tests/Doctrine/Tests/ORM/Tools/SchemaValidatorTest.php +++ b/tests/Doctrine/Tests/ORM/Tools/SchemaValidatorTest.php @@ -18,7 +18,7 @@ class SchemaValidatorTest extends OrmTestCase */ private $validator = null; - public function setUp() + protected function setUp() : void { $this->em = $this->_getTestEntityManager(); $this->validator = new SchemaValidator($this->em); diff --git a/tests/Doctrine/Tests/ORM/Tools/SetupTest.php b/tests/Doctrine/Tests/ORM/Tools/SetupTest.php index 99fafe4390..f784eb7b3e 100644 --- a/tests/Doctrine/Tests/ORM/Tools/SetupTest.php +++ b/tests/Doctrine/Tests/ORM/Tools/SetupTest.php @@ -19,13 +19,13 @@ class SetupTest extends OrmTestCase private $originalAutoloaderCount; private $originalIncludePath; - public function setUp() + protected function setUp() : void { $this->originalAutoloaderCount = count(spl_autoload_functions()); $this->originalIncludePath = get_include_path(); } - public function tearDown() + public function tearDown() : void { if ( ! $this->originalIncludePath) { return; diff --git a/tests/Doctrine/Tests/ORM/UnitOfWorkTest.php b/tests/Doctrine/Tests/ORM/UnitOfWorkTest.php index b16ae4012d..a5bc32faf5 100644 --- a/tests/Doctrine/Tests/ORM/UnitOfWorkTest.php +++ b/tests/Doctrine/Tests/ORM/UnitOfWorkTest.php @@ -56,7 +56,7 @@ class UnitOfWorkTest extends OrmTestCase */ private $eventManager; - protected function setUp() + protected function setUp() : void { parent::setUp(); $this->_connectionMock = new ConnectionMock([], new DriverMock()); diff --git a/tests/Doctrine/Tests/ORM/Utility/IdentifierFlattenerTest.php b/tests/Doctrine/Tests/ORM/Utility/IdentifierFlattenerTest.php index 86b6503d37..a1ceccfdab 100644 --- a/tests/Doctrine/Tests/ORM/Utility/IdentifierFlattenerTest.php +++ b/tests/Doctrine/Tests/ORM/Utility/IdentifierFlattenerTest.php @@ -25,7 +25,7 @@ class IdentifierFlattenerTest extends OrmFunctionalTestCase */ private $identifierFlattener; - protected function setUp() + protected function setUp() : void { parent::setUp(); diff --git a/tests/Doctrine/Tests/OrmFunctionalTestCase.php b/tests/Doctrine/Tests/OrmFunctionalTestCase.php index 6252b07649..66b6cfda30 100644 --- a/tests/Doctrine/Tests/OrmFunctionalTestCase.php +++ b/tests/Doctrine/Tests/OrmFunctionalTestCase.php @@ -19,6 +19,7 @@ use Doctrine\Tests\EventListener\CacheMetadataListener; use Doctrine\Tests\Models; use PHPUnit\Framework\AssertionFailedError; +use Throwable; /** * Base testcase class for all functional ORM testcases. @@ -330,7 +331,7 @@ protected function useModelSet($setName) * * @return void */ - protected function tearDown() + protected function tearDown() : void { $conn = static::$_sharedConn; @@ -639,7 +640,7 @@ protected function setUpEntitySchema(array $classNames) * * @return void */ - protected function setUp() + protected function setUp() : void { $this->setUpDBALTypes(); @@ -782,13 +783,9 @@ protected function _getEntityManager( } /** - * @param \Throwable $e - * - * @return void - * * @throws \Throwable */ - protected function onNotSuccessfulTest(\Throwable $e) + protected function onNotSuccessfulTest(Throwable $e) : void { if ($e instanceof AssertionFailedError) { throw $e; diff --git a/tests/Doctrine/Tests/VerifyDeprecations.php b/tests/Doctrine/Tests/VerifyDeprecations.php index bd71337832..9404af22d0 100644 --- a/tests/Doctrine/Tests/VerifyDeprecations.php +++ b/tests/Doctrine/Tests/VerifyDeprecations.php @@ -67,7 +67,7 @@ protected function ignoreDeprecationMessage(string $message) : void $this->ignoredDeprecations[] = $message; } - protected function expectDeprecationMessage(string $message) : void + protected function expectDeprecationMessageSame(string $message) : void { $this->expectedDeprecations[] = $message; } From f4ebded63c04a0b27c4be5d0f65bee8b034477e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Romain=20Gr=C3=A9goire?= <39792844+rogregoire@users.noreply.github.com> Date: Tue, 10 Nov 2020 10:53:01 +0100 Subject: [PATCH 132/136] Fix SQL alias generation regression for simple inheritance (#8329) This fixes a regression from 099c5b42e15b4997d50b5b19ffba6fee96c52ff3. Without the fix, "where part" in SQL is generated with incorrect aliases. See https://github.com/doctrine/orm/issues/8229#issuecomment-722942180. --- .../Entity/BasicEntityPersister.php | 2 +- .../ORM/Functional/Ticket/GH8229Test.php | 41 +++++++++++++++++++ 2 files changed, 42 insertions(+), 1 deletion(-) diff --git a/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php b/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php index ec08ac839e..163be61248 100644 --- a/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php +++ b/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php @@ -1698,7 +1698,7 @@ private function getSelectConditionStatementColumnSQL($field, $assoc = null) if (isset($this->class->fieldMappings[$field])) { // Fix for bug GH-8229 (id column from parent class renamed in child class): // Use the correct metadata and name for the id column - if (isset($this->class->fieldMappings[$field]['inherited'])) { + if (isset($this->class->fieldMappings[$field]['inherited']) && $this->class->inheritanceType !== ClassMetadata::INHERITANCE_TYPE_NONE) { $className = $this->class->fieldMappings[$field]['inherited']; $class = $this->em->getClassMetadata($className); } else { diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/GH8229Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/GH8229Test.php index e32ff11c59..c03e7edfc8 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/GH8229Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/GH8229Test.php @@ -23,6 +23,8 @@ protected function setUp() : void [ GH8229Resource::class, GH8229User::class, + GH8229EntityWithoutDiscriminator::class, + EntityExtendingGH8229EntityWithoutDiscriminator::class, ] ); } @@ -183,6 +185,19 @@ public function testCorrectColumnNamesInPessimisticWriteLock() self::assertEquals($identifier, $entity->id); } + + /** this test check alias generation not altered by inheritance in ResolvedTargetEntities mapped classes + */ + public function testBasicEntityPersisterAliasGenerationWithSimpleInheritance() + { + $this->expectNotToPerformAssertions(); + + $entity = new EntityExtendingGH8229EntityWithoutDiscriminator(); + $this->_em->persist($entity); + $this->_em->flush(); + + $this->_em->getRepository(EntityExtendingGH8229EntityWithoutDiscriminator::class)->findOneBy(['id' => $entity->getId()]); + } } @@ -244,3 +259,29 @@ public function __construct($username) $this->username = $username; } } + +/** + * @Entity + * @Table(name="gh8229_replacedentity") + */ +class GH8229EntityWithoutDiscriminator +{ + /** + * @Id + * @GeneratedValue + * @Column(type="integer") + */ + public $id; + + public function getId() + { + return $this->id; + } +} + +/** + * @Entity + */ +final class EntityExtendingGH8229EntityWithoutDiscriminator extends GH8229EntityWithoutDiscriminator +{ +} From b1ac293a5026664a7f6eef24c95967f22969c5cd Mon Sep 17 00:00:00 2001 From: Roma Date: Tue, 10 Nov 2020 21:37:36 +0200 Subject: [PATCH 133/136] Add missing backtick in rst markup (#8335) --- docs/en/reference/second-level-cache.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/reference/second-level-cache.rst b/docs/en/reference/second-level-cache.rst index 5b97c131e1..994561ced1 100644 --- a/docs/en/reference/second-level-cache.rst +++ b/docs/en/reference/second-level-cache.rst @@ -278,7 +278,7 @@ Entity cache definition * Entity cache configuration allows you to define the caching strategy and region for an entity. * ``usage`` specifies the caching strategy: ``READ_ONLY``, -`NONSTRICT_READ_WRITE``, ``READ_WRITE``. +``NONSTRICT_READ_WRITE``, ``READ_WRITE``. See :ref:`reference-second-level-cache-mode`. * ``region`` is an optional value that specifies the name of the second level cache region. From 011d3c21eb203cb2a93edaf9df7254fb927907c5 Mon Sep 17 00:00:00 2001 From: Claudio Zizza <859964+SenseException@users.noreply.github.com> Date: Tue, 24 Nov 2020 22:39:42 +0100 Subject: [PATCH 134/136] Update functionality of code examples (#8336) --- docs/en/cookbook/aggregate-fields.rst | 102 ++++++++++++++++---------- 1 file changed, 64 insertions(+), 38 deletions(-) diff --git a/docs/en/cookbook/aggregate-fields.rst b/docs/en/cookbook/aggregate-fields.rst index 6295c77916..a198e80d87 100644 --- a/docs/en/cookbook/aggregate-fields.rst +++ b/docs/en/cookbook/aggregate-fields.rst @@ -32,30 +32,39 @@ Our entities look like: .. code-block:: php no = $no; $this->maxCredit = $maxCredit; @@ -64,31 +73,35 @@ Our entities look like: } /** - * @Entity + * @ORM\Entity */ class Entry { - /** @Id @GeneratedValue @Column(type="integer") */ - private $id; + /** + * @ORM\Id + * @ORM\GeneratedValue + * @ORM\Column(type="integer") + */ + private ?int $id; /** - * @ManyToOne(targetEntity="Account", inversedBy="entries") + * @ORM\ManyToOne(targetEntity="Account", inversedBy="entries") */ - private $account; + private Account $account; /** - * @Column(type="integer") + * @ORM\Column(type="integer") */ - private $amount; + private int $amount; - public function __construct($account, $amount) + public function __construct(Account $account, int $amount) { $this->account = $account; $this->amount = $amount; // more stuff here, from/to whom, stated reason, execution date and such } - public function getAmount() + public function getAmount(): Amount { return $this->amount; } @@ -146,12 +159,14 @@ collection, which means we can compute this value at runtime: class Account { // .. previous code - public function getBalance() + + public function getBalance(): int { $balance = 0; foreach ($this->entries as $entry) { $balance += $entry->getAmount(); } + return $balance; } } @@ -175,13 +190,12 @@ relation with this method: assertAcceptEntryAllowed($amount); $e = new Entry($this, $amount); $this->entries[] = $e; - return $e; } } @@ -190,7 +204,10 @@ Now look at the following test-code for our entities: .. code-block:: php setExpectedException("Exception"); + $this->expectException(Exception::class); $account->addEntry(-1000); } } @@ -219,9 +236,12 @@ To enforce our rule we can now implement the assertion in .. code-block:: php getBalance() + $amount; $allowedMinimalBalance = ($this->maxCredit * -1); @@ -266,23 +286,22 @@ entries collection) we want to add an aggregate field called class Account { /** - * @Column(type="integer") + * @ORM\Column(type="integer") */ - private $balance = 0; + private int $balance = 0; - public function getBalance() + public function getBalance(): int { return $this->balance; } - public function addEntry($amount) + public function addEntry(int $amount): void { $this->assertAcceptEntryAllowed($amount); $e = new Entry($this, $amount); $this->entries[] = $e; $this->balance += $amount; - return $e; } } @@ -306,12 +325,15 @@ potentially lead to inconsistent state. See this example: .. code-block:: php find('Bank\Entities\Account', $accId); + $account1 = $em->find(Account::class, $accId); // request 2 account - $account2 = $em->find('Bank\Entities\Account', $accId); + $account2 = $em->find(Account::class, $accId); $account1->addEntry(-200); $account2->addEntry(-200); @@ -332,10 +354,14 @@ Optimistic locking is as easy as adding a version column: .. code-block:: php find('Bank\Entities\Account', $accId, LockMode::PESSIMISTIC_READ); + + $account = $em->find(Account::class, $accId, LockMode::PESSIMISTIC_READ); Keeping Updates and Deletes in Sync ----------------------------------- @@ -372,5 +400,3 @@ field that offers serious performance benefits over iterating all the related objects that make up an aggregate value. Finally I showed how you can ensure that your aggregate fields do not get out of sync due to race-conditions and concurrent access. - - From 80a7df4ddc9b406f8edb4322f7998d9f4b0762ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Gawro=C5=84ski?= Date: Wed, 27 Mar 2019 22:43:52 +0100 Subject: [PATCH 135/136] Fix CommitOrderCalculator::visit() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fixes a commit order when persisting many entities with cyclic associations within one flush. Before the fix, when multiple cycles were presented in the precedence graph and more than two classes existed in within a cycle the calculated commit order was likely to be wrong, resulting in not null constraint violation when saving to a database. An example of such situation is provided in CommitOrderCalculatorTest::testCommitOrdering4() - this is a test case with won’t pass without the introduced fix. Prior to the fix the weight of an edge in a class precedence graph was compared only to the weight of the subsequent edges. Therefore, in case of cycles containing more than two classes the result was unpredictable. The fixed code uses also the weight of further nodes in the precedence graph. It is achieved by adding minimum weight argument to the visitor function of CommitOrderCalulator – edges having weight below the minimum weight are ignored. The minimum weight is increased each time a node is revisited, i. e. a cycle is detected. It guarantees that edges of highest priority representing not nullable relationships are processed first. --- .../ORM/Internal/CommitOrderCalculator.php | 25 +++------- .../Tests/ORM/CommitOrderCalculatorTest.php | 50 +++++++++++++++++++ 2 files changed, 57 insertions(+), 18 deletions(-) mode change 100644 => 100755 lib/Doctrine/ORM/Internal/CommitOrderCalculator.php mode change 100644 => 100755 tests/Doctrine/Tests/ORM/CommitOrderCalculatorTest.php diff --git a/lib/Doctrine/ORM/Internal/CommitOrderCalculator.php b/lib/Doctrine/ORM/Internal/CommitOrderCalculator.php old mode 100644 new mode 100755 index 30b9caa820..43702ea066 --- a/lib/Doctrine/ORM/Internal/CommitOrderCalculator.php +++ b/lib/Doctrine/ORM/Internal/CommitOrderCalculator.php @@ -149,11 +149,15 @@ public function sort() * * @param \stdClass $vertex */ - private function visit($vertex) + private function visit($vertex, int $minimumWeight = 0) { $vertex->state = self::IN_PROGRESS; foreach ($vertex->dependencyList as $edge) { + if ($edge->weight < $minimumWeight) { + // Skip edges of weight below minimum weight, useful when revisiting + continue; + } $adjacentVertex = $this->nodeList[$edge->to]; switch ($adjacentVertex->state) { @@ -162,23 +166,8 @@ private function visit($vertex) break; case self::IN_PROGRESS: - if (isset($adjacentVertex->dependencyList[$vertex->hash]) && - $adjacentVertex->dependencyList[$vertex->hash]->weight < $edge->weight) { - - // If we have some non-visited dependencies in the in-progress dependency, we - // need to visit them before adding the node. - foreach ($adjacentVertex->dependencyList as $adjacentEdge) { - $adjacentEdgeVertex = $this->nodeList[$adjacentEdge->to]; - - if ($adjacentEdgeVertex->state === self::NOT_VISITED) { - $this->visit($adjacentEdgeVertex); - } - } - - $adjacentVertex->state = self::VISITED; - - $this->sortedNodeList[] = $adjacentVertex->value; - } + // Revisit increasing minimum weight + $this->visit($adjacentVertex, $minimumWeight + 1); break; case self::NOT_VISITED: diff --git a/tests/Doctrine/Tests/ORM/CommitOrderCalculatorTest.php b/tests/Doctrine/Tests/ORM/CommitOrderCalculatorTest.php old mode 100644 new mode 100755 index c967beb8b6..a4f826bcd7 --- a/tests/Doctrine/Tests/ORM/CommitOrderCalculatorTest.php +++ b/tests/Doctrine/Tests/ORM/CommitOrderCalculatorTest.php @@ -100,6 +100,56 @@ public function testCommitOrdering3() // We want to perform a strict comparison of the array $this->assertContains($sorted, $correctOrders, '', false, true, true); } + + public function testCommitOrdering4() + { + // testing Fixed commit order + $class1 = new ClassMetadata(NodeClass1::class); + $class2 = new ClassMetadata(NodeClass2::class); + $class3 = new ClassMetadata(NodeClass3::class); + $class4 = new ClassMetadata(NodeClass4::class); + + $this->_calc->addNode($class1->name, $class1); + $this->_calc->addNode($class2->name, $class2); + $this->_calc->addNode($class3->name, $class3); + $this->_calc->addNode($class4->name, $class4); + + $this->_calc->addDependency($class1->name, $class2->name, 0); + $this->_calc->addDependency($class2->name, $class3->name, 0); + $this->_calc->addDependency($class3->name, $class1->name, 0); + $this->_calc->addDependency($class2->name, $class4->name, 0); + $this->_calc->addDependency($class4->name, $class1->name, 1); + + /* + +---------+ + | | + +--+ Class 4 <---+ + | | | | + 1 | +---------+ | 0 + | | + v | + +---+-----+ +-----+---+ + | | | | + | Class 1 +--->+ Class 2 | + | | 0 | | + +---+-----+ +-----+---+ + ^ | + | | + 0 | | 0 + | +---------+ | + | | | | + +--+ Class 3 +<--+ + | | + +---------+ + */ + + $sorted = $this->_calc->sort(); + $index1 = array_search($class1, $sorted, true); + $index4 = array_search($class4, $sorted, true); + + $this->assertLessThan($index1, $index4); + + } } class NodeClass1 {} From 7e79973714a3f8251b391d3e16fb2eecd3f0fb14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Gawro=C5=84ski?= Date: Sat, 24 Oct 2020 03:27:01 -0400 Subject: [PATCH 136/136] Fix CommitOrderCalculator::addDependency() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It may happen that an entity class A has multiple many-to-one associations with the same target entity B. These associations may differ in “nullable” parameter. In such situation CommitOrderCalculator::addDependency() is called multiple times for the same pair of $fromHash and $toHash, with different value of $weight argument. Before the fix the subsequent call to CommitOrderCalculator::addDependency() for the same $fromHash and $toHash overrode $weight set at the previous call. It caused unpredictable commit order of entities which resulted in not null constraint violation when saving to a database. Fixed code preserves the highest value of weight argument. If at subsequent call the weight is lower than previously established weight the addition of edge to the dependency list is skipped. --- .../ORM/Internal/CommitOrderCalculator.php | 5 +++ .../Tests/ORM/CommitOrderCalculatorTest.php | 40 ++++++++++++++++++- 2 files changed, 44 insertions(+), 1 deletion(-) diff --git a/lib/Doctrine/ORM/Internal/CommitOrderCalculator.php b/lib/Doctrine/ORM/Internal/CommitOrderCalculator.php index 43702ea066..024d936856 100755 --- a/lib/Doctrine/ORM/Internal/CommitOrderCalculator.php +++ b/lib/Doctrine/ORM/Internal/CommitOrderCalculator.php @@ -107,6 +107,11 @@ public function addNode($hash, $node) public function addDependency($fromHash, $toHash, $weight) { $vertex = $this->nodeList[$fromHash]; + + if (isset($vertex->dependencyList[$toHash]) && $vertex->dependencyList[$toHash]->weight >= $weight) { + return; + } + $edge = new \stdClass(); $edge->from = $fromHash; diff --git a/tests/Doctrine/Tests/ORM/CommitOrderCalculatorTest.php b/tests/Doctrine/Tests/ORM/CommitOrderCalculatorTest.php index a4f826bcd7..bca25aab10 100755 --- a/tests/Doctrine/Tests/ORM/CommitOrderCalculatorTest.php +++ b/tests/Doctrine/Tests/ORM/CommitOrderCalculatorTest.php @@ -17,7 +17,7 @@ class CommitOrderCalculatorTest extends OrmTestCase { private $_calc; - protected function setUp() + protected function setUp() : void { $this->_calc = new CommitOrderCalculator(); } @@ -150,6 +150,44 @@ public function testCommitOrdering4() $this->assertLessThan($index1, $index4); } + + public function testCommitOrdering5() + { + // testing Fixed commit order with multiple edges of different priority + // between two certain nodes + $class1 = new ClassMetadata(NodeClass1::class); + $class2 = new ClassMetadata(NodeClass2::class); + + + $this->_calc->addNode($class1->name, $class1); + $this->_calc->addNode($class2->name, $class2); + + + $this->_calc->addDependency($class1->name, $class2->name, 0); + $this->_calc->addDependency($class2->name, $class1->name, 1); + $this->_calc->addDependency($class2->name, $class1->name, 0); + + /* + 1 + +----------------+ + v | + +---+-----+ +-----+---+ + | | | | + | Class 1 +--->+ Class 2 | + | | 0 | | + +---+-----+ +-----+---+ + ^ | + +----------------+ + 0 + */ + + $sorted = $this->_calc->sort(); + $index1 = array_search($class1, $sorted, true); + $index2 = array_search($class2, $sorted, true); + + $this->assertLessThan($index1, $index2); + + } } class NodeClass1 {}