Skip to content

Commit 3291ba2

Browse files
committed
Merge branch '5.4' into 6.0
* 5.4: fix SQLSRV throws for method_exists() [HttpKernel] Add basic support for language negotiation [Messenger] Add a middleware to log when transaction has been left open [HttpClient] Add method to set response factory in mock client Move array_merge calls out of loops to improve performance Remove references to DBALException [VarDumper] Fix handling of "new" in initializers on PHP 8.1
2 parents 0afabf4 + 91eb974 commit 3291ba2

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

DebugClassLoader.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -803,7 +803,7 @@ private function setReturnType(string $types, string $class, string $method, str
803803
continue;
804804
}
805805

806-
$docTypes = array_merge($docTypes, $t);
806+
$docTypes[] = $t;
807807

808808
if ('mixed' === $n || 'void' === $n) {
809809
$nullable = false;
@@ -820,6 +820,7 @@ private function setReturnType(string $types, string $class, string $method, str
820820
$phpTypes[] = $n;
821821
}
822822
}
823+
$docTypes = array_merge([], ...$docTypes);
823824

824825
if (!$phpTypes) {
825826
return;

ErrorEnhancer/ClassNotFoundErrorEnhancer.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,19 +93,19 @@ private function getClassCandidates(string $class): array
9393
if ($function[0] instanceof ClassLoader) {
9494
foreach ($function[0]->getPrefixes() as $prefix => $paths) {
9595
foreach ($paths as $path) {
96-
$classes = array_merge($classes, $this->findClassInPath($path, $class, $prefix));
96+
$classes[] = $this->findClassInPath($path, $class, $prefix);
9797
}
9898
}
9999

100100
foreach ($function[0]->getPrefixesPsr4() as $prefix => $paths) {
101101
foreach ($paths as $path) {
102-
$classes = array_merge($classes, $this->findClassInPath($path, $class, $prefix));
102+
$classes[] = $this->findClassInPath($path, $class, $prefix);
103103
}
104104
}
105105
}
106106
}
107107

108-
return array_unique($classes);
108+
return array_unique(array_merge([], ...$classes));
109109
}
110110

111111
private function findClassInPath(string $path, string $class, string $prefix): array

0 commit comments

Comments
 (0)