Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 3ec79a6

Browse filesBrowse files
committed
Merge remote-tracking branch 'upstream/5.4' into feature/path-component
2 parents d0e33e8 + 839d1ac commit 3ec79a6
Copy full SHA for 3ec79a6

File tree

938 files changed

+6359
-3447
lines changed
Filter options

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Dismiss banner

938 files changed

+6359
-3447
lines changed

‎.github/patch-types.php

Copy file name to clipboardExpand all lines: .github/patch-types.php
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,15 @@
1616
case false !== strpos($file = realpath($file), '/vendor/'):
1717
case false !== strpos($file, '/src/Symfony/Bridge/PhpUnit/'):
1818
case false !== strpos($file, '/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Validation/Article.php'):
19+
case false !== strpos($file, '/src/Symfony/Component/Cache/Tests/Fixtures/DriverWrapper.php'):
1920
case false !== strpos($file, '/src/Symfony/Component/Config/Tests/Fixtures/BadFileName.php'):
2021
case false !== strpos($file, '/src/Symfony/Component/Config/Tests/Fixtures/BadParent.php'):
2122
case false !== strpos($file, '/src/Symfony/Component/Config/Tests/Fixtures/ParseError.php'):
2223
case false !== strpos($file, '/src/Symfony/Component/DependencyInjection/Tests/Compiler/OptionalServiceClass.php'):
2324
case false !== strpos($file, '/src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/autowiring_classes.php'):
25+
case false !== strpos($file, '/src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/intersectiontype_classes.php'):
2426
case false !== strpos($file, '/src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/MultipleArgumentsOptionalScalarNotReallyOptional.php'):
27+
case false !== strpos($file, '/src/Symfony/Component/DependencyInjection/Tests/Fixtures/CheckTypeDeclarationsPass/IntersectionConstructor.php'):
2528
case false !== strpos($file, '/src/Symfony/Component/DependencyInjection/Tests/Fixtures/ParentNotExists.php'):
2629
case false !== strpos($file, '/src/Symfony/Component/DependencyInjection/Tests/Fixtures/Preload/'):
2730
case false !== strpos($file, '/src/Symfony/Component/DependencyInjection/Tests/Fixtures/Prototype/BadClasses/MissingParent.php'):
@@ -32,6 +35,7 @@
3235
case false !== strpos($file, '/src/Symfony/Component/Runtime/Internal/ComposerPlugin.php'):
3336
case false !== strpos($file, '/src/Symfony/Component/Serializer/Tests/Normalizer/Features/ObjectOuter.php'):
3437
case false !== strpos($file, '/src/Symfony/Component/VarDumper/Tests/Fixtures/NotLoadableClass.php'):
38+
case false !== strpos($file, '/src/Symfony/Component/VarDumper/Tests/Fixtures/ReflectionIntersectionTypeFixture.php'):
3539
continue 2;
3640
}
3741

‎.github/workflows/integration-tests.yml

Copy file name to clipboardExpand all lines: .github/workflows/integration-tests.yml
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ jobs:
123123
with:
124124
coverage: "none"
125125
extensions: "json,couchbase,memcached,mongodb,redis,rdkafka,xsl,ldap"
126-
ini-values: "memory_limit=-1"
126+
ini-values: date.timezone=Europe/Paris,memory_limit=-1,default_socket_timeout=10,session.gc_probability=0,apc.enable_cli=1,zend.assertions=1
127127
php-version: "${{ matrix.php }}"
128128
tools: pecl
129129

@@ -136,7 +136,7 @@ jobs:
136136
uses: docker://bitnami/openldap
137137
with:
138138
entrypoint: /bin/bash
139-
args: -c "(/opt/bitnami/openldap/bin/ldapwhoami -h localhost:3389 -D cn=admin,dc=symfony,dc=com -w symfony||sleep 5) && /opt/bitnami/openldap/bin/ldapadd -h ldap:3389 -D cn=admin,dc=symfony,dc=com -w symfony -f src/Symfony/Component/Ldap/Tests/Fixtures/data/fixtures.ldif && /opt/bitnami/openldap/bin/ldapdelete -h ldap:3389 -D cn=admin,dc=symfony,dc=com -w symfony cn=a,ou=users,dc=symfony,dc=com"
139+
args: -c "(/opt/bitnami/openldap/bin/ldapwhoami -H ldap://ldap:3389 -D cn=admin,dc=symfony,dc=com -w symfony||sleep 5) && /opt/bitnami/openldap/bin/ldapadd -H ldap://ldap:3389 -D cn=admin,dc=symfony,dc=com -w symfony -f src/Symfony/Component/Ldap/Tests/Fixtures/data/fixtures.ldif && /opt/bitnami/openldap/bin/ldapdelete -H ldap://ldap:3389 -D cn=admin,dc=symfony,dc=com -w symfony cn=a,ou=users,dc=symfony,dc=com"
140140

141141
- name: Install dependencies
142142
run: |

‎.github/workflows/phpunit-bridge.yml

Copy file name to clipboard
+31Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: PhpUnitBridge
2+
3+
on:
4+
push:
5+
paths:
6+
- 'src/Symfony/Bridge/PhpUnit/**'
7+
pull_request:
8+
paths:
9+
- 'src/Symfony/Bridge/PhpUnit/**'
10+
11+
defaults:
12+
run:
13+
shell: bash
14+
15+
jobs:
16+
lint:
17+
name: Lint
18+
runs-on: Ubuntu-20.04
19+
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v2
23+
24+
- name: Setup PHP
25+
uses: shivammathur/setup-php@v2
26+
with:
27+
coverage: "none"
28+
php-version: "7.1"
29+
30+
- name: Lint
31+
run: find ./src/Symfony/Bridge/PhpUnit -name '*.php' | grep -v -e /Tests/ -e ForV7 -e ForV8 -e ForV9 -e ConstraintLogicTrait | parallel -j 4 php -l {}

‎.github/workflows/unit-tests.yml

Copy file name to clipboardExpand all lines: .github/workflows/unit-tests.yml
+9-7Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
uses: shivammathur/setup-php@v2
4747
with:
4848
coverage: "none"
49-
ini-values: date.timezone=Europe/Paris,memory_limit=-1,default_socket_timeout=10,session.gc_probability=0,apc.enable_cli=1
49+
ini-values: date.timezone=Europe/Paris,memory_limit=-1,default_socket_timeout=10,session.gc_probability=0,apc.enable_cli=1,zend.assertions=1
5050
php-version: "${{ matrix.php }}"
5151
extensions: "${{ env.extensions }}"
5252
tools: flex
@@ -139,7 +139,7 @@ jobs:
139139
if: "${{ matrix.php == '8.0' && ! matrix.mode }}"
140140
run: |
141141
sed -i 's/"\*\*\/Tests\/"//' composer.json
142-
composer install --optimize-autoloader
142+
composer install -q --optimize-autoloader
143143
SYMFONY_PATCH_TYPE_DECLARATIONS=force=1 php .github/patch-types.php
144144
SYMFONY_PATCH_TYPE_DECLARATIONS=force=1 php .github/patch-types.php # ensure the script is idempotent
145145
echo PHPUNIT="$PHPUNIT,legacy" >> $GITHUB_ENV
@@ -184,24 +184,26 @@ jobs:
184184
# matrix.mode = high-deps
185185
echo "$COMPONENTS" | xargs -n1 | parallel -j +3 "_run_tests {} 'cd {} && $COMPOSER_UP && $PHPUNIT$LEGACY'" || X=1
186186
187+
# get a list of the patched components (relies on .github/build-packages.php being called in the previous step)
187188
(cd src/Symfony/Component/HttpFoundation; mv composer.bak composer.json)
188-
COMPONENTS=$(git diff --name-only src/ | grep composer.json || true)
189+
PATCHED_COMPONENTS=$(git diff --name-only src/ | grep composer.json || true)
189190
190-
if [[ $COMPONENTS && $SYMFONY_VERSION = *.4 ]]; then
191+
# for x.4 branches, checkout and test previous major with the patched components (only for patched components)
192+
if [[ $PATCHED_COMPONENTS && $SYMFONY_VERSION = *.4 ]]; then
191193
export FLIP='^'
192194
SYMFONY_VERSION=$(echo $SYMFONY_VERSION | awk '{print $1 - 1}')
193195
echo -e "\\n\\e[33;1mChecking out Symfony $SYMFONY_VERSION and running tests with patched components as deps\\e[0m"
194196
export COMPOSER_ROOT_VERSION=$SYMFONY_VERSION.x-dev
195197
export SYMFONY_REQUIRE=">=$SYMFONY_VERSION"
196198
git fetch --depth=2 origin $SYMFONY_VERSION
197199
git checkout -m FETCH_HEAD
198-
COMPONENTS=$(echo "$COMPONENTS" | xargs dirname | xargs -n1 -I{} bash -c "[ -e '{}/phpunit.xml.dist' ] && echo '{}'" | sort || true)
200+
PATCHED_COMPONENTS=$(echo "$PATCHED_COMPONENTS" | xargs dirname | xargs -n1 -I{} bash -c "[ -e '{}/phpunit.xml.dist' ] && echo '{}'" | sort || true)
199201
(cd src/Symfony/Component/HttpFoundation; composer require --dev --no-update mongodb/mongodb)
200-
if [[ $COMPONENTS ]]; then
202+
if [[ $PATCHED_COMPONENTS ]]; then
201203
echo "::group::install phpunit"
202204
./phpunit install
203205
echo "::endgroup::"
204-
echo "$COMPONENTS" | parallel -j +3 "_run_tests {} 'cd {} && rm composer.lock vendor/ -Rf && $COMPOSER_UP && $PHPUNIT$LEGACY'" || X=1
206+
echo "$PATCHED_COMPONENTS" | parallel -j +3 "_run_tests {} 'cd {} && rm composer.lock vendor/ -Rf && $COMPOSER_UP && $PHPUNIT$LEGACY'" || X=1
205207
fi
206208
fi
207209

‎UPGRADE-5.2.md

Copy file name to clipboardExpand all lines: UPGRADE-5.2.md
+11-11Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,22 +22,22 @@ Form
2222

2323
* Deprecated `PropertyPathMapper` in favor of `DataMapper` and `PropertyPathAccessor`.
2424

25-
Before:
25+
Before:
2626

27-
```php
28-
use Symfony\Component\Form\Extension\Core\DataMapper\PropertyPathMapper;
27+
```php
28+
use Symfony\Component\Form\Extension\Core\DataMapper\PropertyPathMapper;
2929

30-
$builder->setDataMapper(new PropertyPathMapper());
31-
```
30+
$builder->setDataMapper(new PropertyPathMapper());
31+
```
3232

33-
After:
33+
After:
3434

35-
```php
36-
use Symfony\Component\Form\Extension\Core\DataAccessor\PropertyPathAccessor;
37-
use Symfony\Component\Form\Extension\Core\DataMapper\DataMapper;
35+
```php
36+
use Symfony\Component\Form\Extension\Core\DataAccessor\PropertyPathAccessor;
37+
use Symfony\Component\Form\Extension\Core\DataMapper\DataMapper;
3838

39-
$builder->setDataMapper(new DataMapper(new PropertyPathAccessor()));
40-
```
39+
$builder->setDataMapper(new DataMapper(new PropertyPathAccessor()));
40+
```
4141

4242
HttpFoundation
4343
--------------

‎UPGRADE-5.4.md

Copy file name to clipboardExpand all lines: UPGRADE-5.4.md
+34Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
UPGRADE FROM 5.3 to 5.4
22
=======================
33

4+
Cache
5+
-----
6+
7+
* Deprecate `DoctrineProvider` because this class has been added to the `doctrine/cache` package`
8+
9+
Finder
10+
------
11+
12+
* Deprecate `Comparator::setTarget()` and `Comparator::setOperator()`
13+
* Add a constructor to `Comparator` that allows setting target and operator
14+
415
FrameworkBundle
516
---------------
617

@@ -11,3 +22,26 @@ HttpKernel
1122
----------
1223

1324
* Deprecate `AbstractTestSessionListener::getSession` inject a session in the request instead
25+
26+
Messenger
27+
---------
28+
29+
* Deprecate not setting the `delete_after_ack` config option (or DSN parameter) using the Redis transport,
30+
its default value will change to `true` in 6.0
31+
32+
SecurityBundle
33+
--------------
34+
35+
* Deprecate the `always_authenticate_before_granting` option
36+
37+
Security
38+
--------
39+
40+
* Deprecate setting the 4th argument (`$alwaysAuthenticate`) to `true` and not setting the
41+
5th argument (`$exceptionOnNoToken`) to `false` of `AuthorizationChecker` (this is the default
42+
behavior when using `enable_authenticator_manager: true`)
43+
* Deprecate not setting the 5th argument (`$exceptionOnNoToken`) of `AccessListener` to `false`
44+
(this is the default behavior when using `enable_authenticator_manager: true`)
45+
* Deprecate `TokenInterface:isAuthenticated()` and `setAuthenticated()` methods without replacement.
46+
Security tokens won't have an "authenticated" flag anymore, so they will always be considered authenticated
47+
* Deprecate `DeauthenticatedEvent`, use `TokenDeauthenticatedEvent` instead

‎UPGRADE-6.0.md

Copy file name to clipboardExpand all lines: UPGRADE-6.0.md
+18Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ DoctrineBridge
1111

1212
* Remove `UserLoaderInterface::loadUserByUsername()` in favor of `UserLoaderInterface::loadUserByIdentifier()`
1313

14+
Cache
15+
-----
16+
17+
* Remove `DoctrineProvider` because it has been added to the `doctrine/cache` package
18+
1419
Config
1520
------
1621

@@ -55,6 +60,12 @@ EventDispatcher
5560

5661
* Removed `LegacyEventDispatcherProxy`. Use the event dispatcher without the proxy.
5762

63+
Finder
64+
------
65+
66+
* Remove `Comparator::setTarget()` and `Comparator::setOperator()`
67+
* The `$target` parameter of `Comparator::__construct()` is now mandatory
68+
5869
Form
5970
----
6071

@@ -141,6 +152,7 @@ Messenger
141152
* The signature of method `RetryStrategyInterface::getWaitingTime()` has been updated to `RetryStrategyInterface::getWaitingTime(Envelope $message, \Throwable $throwable = null)`.
142153
* Removed the `prefetch_count` parameter in the AMQP bridge.
143154
* Removed the use of TLS option for Redis Bridge, use `rediss://127.0.0.1` instead of `redis://127.0.0.1?tls=1`
155+
* The `delete_after_ack` config option of the Redis transport now defaults to `true`
144156

145157
Mime
146158
----
@@ -194,6 +206,8 @@ Routing
194206
Security
195207
--------
196208

209+
* Remove the 4th and 5th argument of `AuthorizationChecker`
210+
* Remove the 5th argument of `AccessListener`
197211
* Remove class `User`, use `InMemoryUser` or your own implementation instead.
198212
If you are using the `isAccountNonLocked()`, `isAccountNonExpired()` or `isCredentialsNonExpired()` method, consider re-implementing them
199213
in your own user class as they are not part of the `InMemoryUser` API
@@ -309,10 +323,14 @@ Security
309323
`UsernamePasswordFormAuthenticationListener`, `UsernamePasswordJsonAuthenticationListener` and `X509AuthenticationListener`
310324
from security-http, use the new authenticator system instead
311325
* Remove the Guard component, use the new authenticator system instead
326+
* Remove `TokenInterface:isAuthenticated()` and `setAuthenticated()` methods without replacement.
327+
Security tokens won't have an "authenticated" flag anymore, so they will always be considered authenticated
328+
* Remove `DeauthenticatedEvent`, use `TokenDeauthenticatedEvent` instead
312329

313330
SecurityBundle
314331
--------------
315332

333+
* Remove the `always_authenticate_before_granting` option
316334
* Remove the `UserPasswordEncoderCommand` class and the corresponding `user:encode-password` command,
317335
use `UserPasswordHashCommand` and `user:hash-password` instead
318336
* Remove the `security.encoder_factory.generic` service, the `security.encoder_factory` and `Symfony\Component\Security\Core\Encoder\EncoderFactoryInterface` aliases,

‎composer.json

Copy file name to clipboardExpand all lines: composer.json
+5-5Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"psr/event-dispatcher-implementation": "1.0",
2424
"psr/http-client-implementation": "1.0",
2525
"psr/link-implementation": "1.0",
26-
"psr/log-implementation": "1.0",
26+
"psr/log-implementation": "1.0|2.0",
2727
"psr/simple-cache-implementation": "1.0",
2828
"symfony/cache-implementation": "1.0|2.0",
2929
"symfony/event-dispatcher-implementation": "2.0",
@@ -42,7 +42,7 @@
4242
"psr/container": "^1.0",
4343
"psr/event-dispatcher": "^1.0",
4444
"psr/link": "^1.0",
45-
"psr/log": "~1.0",
45+
"psr/log": "^1|^2",
4646
"symfony/contracts": "^2.1",
4747
"symfony/polyfill-ctype": "~1.8",
4848
"symfony/polyfill-intl-grapheme": "~1.0",
@@ -51,7 +51,7 @@
5151
"symfony/polyfill-intl-normalizer": "~1.0",
5252
"symfony/polyfill-mbstring": "~1.0",
5353
"symfony/polyfill-php73": "^1.11",
54-
"symfony/polyfill-php80": "^1.15",
54+
"symfony/polyfill-php80": "^1.16",
5555
"symfony/polyfill-php81": "^1.22",
5656
"symfony/polyfill-uuid": "^1.15"
5757
},
@@ -125,7 +125,7 @@
125125
"cache/integration-tests": "dev-master",
126126
"composer/package-versions-deprecated": "^1.8",
127127
"doctrine/annotations": "^1.12",
128-
"doctrine/cache": "^1.6|^2.0",
128+
"doctrine/cache": "^1.11|^2.0",
129129
"doctrine/collections": "~1.0",
130130
"doctrine/data-fixtures": "^1.1",
131131
"doctrine/dbal": "^2.10|^3.0",
@@ -192,7 +192,7 @@
192192
"url": "src/Symfony/Contracts",
193193
"options": {
194194
"versions": {
195-
"symfony/contracts": "2.4.x-dev"
195+
"symfony/contracts": "2.5.x-dev"
196196
}
197197
}
198198
},

‎phpunit.xml.dist

Copy file name to clipboardExpand all lines: phpunit.xml.dist
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
<directory>./src/Symfony/Bridge/*/Tests/</directory>
3232
<directory>./src/Symfony/Component/*/Tests/</directory>
3333
<directory>./src/Symfony/Component/*/*/Tests/</directory>
34+
<directory>./src/Symfony/Component/*/*/*/Tests/</directory>
3435
<directory>./src/Symfony/Contract/*/Tests/</directory>
3536
<directory>./src/Symfony/Bundle/*/Tests/</directory>
3637
</testsuite>

‎src/Symfony/Bridge/Doctrine/ContainerAwareEventManager.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Doctrine/ContainerAwareEventManager.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public function dispatchEvent($eventName, EventArgs $eventArgs = null)
5858
return;
5959
}
6060

61-
$eventArgs = null === $eventArgs ? EventArgs::getEmptyInstance() : $eventArgs;
61+
$eventArgs = $eventArgs ?? EventArgs::getEmptyInstance();
6262

6363
if (!isset($this->initialized[$eventName])) {
6464
$this->initializeListeners($eventName);

‎src/Symfony/Bridge/Doctrine/DependencyInjection/AbstractDoctrineExtension.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Doctrine/DependencyInjection/AbstractDoctrineExtension.php
+21-1Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Symfony\Bridge\Doctrine\DependencyInjection;
1313

14+
use Symfony\Component\Config\Resource\GlobResource;
1415
use Symfony\Component\DependencyInjection\Alias;
1516
use Symfony\Component\DependencyInjection\ContainerBuilder;
1617
use Symfony\Component\DependencyInjection\Definition;
@@ -88,6 +89,25 @@ protected function loadMappingInformation(array $objectManager, ContainerBuilder
8889
if (!$mappingConfig) {
8990
continue;
9091
}
92+
} elseif (!$mappingConfig['type'] && \PHP_VERSION_ID < 80000) {
93+
$mappingConfig['type'] = 'annotation';
94+
} elseif (!$mappingConfig['type']) {
95+
$mappingConfig['type'] = 'attribute';
96+
97+
$glob = new GlobResource($mappingConfig['dir'], '*', true);
98+
$container->addResource($glob);
99+
100+
foreach ($glob as $file) {
101+
$content = file_get_contents($file);
102+
103+
if (preg_match('/^#\[.*Entity\b/m', $content)) {
104+
break;
105+
}
106+
if (preg_match('/^ \* @.*Entity\b/m', $content)) {
107+
$mappingConfig['type'] = 'annotation';
108+
break;
109+
}
110+
}
91111
}
92112

93113
$this->assertValidMappingConfiguration($mappingConfig, $objectManager['name']);
@@ -201,7 +221,7 @@ protected function registerMappingDrivers(array $objectManager, ContainerBuilder
201221
]);
202222
}
203223
$mappingDriverDef->setPublic(false);
204-
if (false !== strpos($mappingDriverDef->getClass(), 'yml') || false !== strpos($mappingDriverDef->getClass(), 'xml')) {
224+
if (str_contains($mappingDriverDef->getClass(), 'yml') || str_contains($mappingDriverDef->getClass(), 'xml')) {
205225
$mappingDriverDef->setArguments([array_flip($driverPaths)]);
206226
$mappingDriverDef->addMethodCall('setGlobalBasename', ['mapping']);
207227
}

‎src/Symfony/Bridge/Doctrine/Form/ChoiceList/DoctrineChoiceLoader.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Doctrine/Form/ChoiceList/DoctrineChoiceLoader.php
+12-3Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,18 +91,27 @@ protected function doLoadChoicesForValues(array $values, ?callable $value): arra
9191
trigger_deprecation('symfony/doctrine-bridge', '5.1', 'Not defining explicitly the IdReader as value callback when query can be optimized is deprecated. Don\'t pass the IdReader to "%s" or define the "choice_value" option instead.', __CLASS__);
9292
}
9393

94+
$idReader = null;
95+
if (\is_array($value) && $value[0] instanceof IdReader) {
96+
$idReader = $value[0];
97+
} elseif ($value instanceof \Closure && ($rThis = (new \ReflectionFunction($value))->getClosureThis()) instanceof IdReader) {
98+
$idReader = $rThis;
99+
} elseif ($legacy) {
100+
$idReader = $this->idReader;
101+
}
102+
94103
// Optimize performance in case we have an object loader and
95104
// a single-field identifier
96-
if (($legacy || \is_array($value) && $this->idReader === $value[0]) && $this->objectLoader) {
105+
if ($idReader && $this->objectLoader) {
97106
$objects = [];
98107
$objectsById = [];
99108

100109
// Maintain order and indices from the given $values
101110
// An alternative approach to the following loop is to add the
102111
// "INDEX BY" clause to the Doctrine query in the loader,
103112
// but I'm not sure whether that's doable in a generic fashion.
104-
foreach ($this->objectLoader->getEntitiesByIds($this->idReader->getIdField(), $values) as $object) {
105-
$objectsById[$this->idReader->getIdValue($object)] = $object;
113+
foreach ($this->objectLoader->getEntitiesByIds($idReader->getIdField(), $values) as $object) {
114+
$objectsById[$idReader->getIdValue($object)] = $object;
106115
}
107116

108117
foreach ($values as $i => $id) {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.