N°8910 - Upgrade Symfony packages (#811)

This commit is contained in:
Benjamin Dalsass
2026-02-23 06:54:26 +01:00
committed by GitHub
parent b91e6c384a
commit 4853ca444e
224 changed files with 4758 additions and 1778 deletions

View File

@@ -120,16 +120,11 @@ class OrderedHashMap implements \ArrayAccess, \IteratorAggregate, \Countable
public function offsetSet(mixed $key, mixed $value): void
{
if (null === $key || !isset($this->elements[$key])) {
if (null === $key) {
$key = [] === $this->orderedKeys
// If the array is empty, use 0 as key
? 0
// Imitate PHP behavior of generating a key that equals
// the highest existing integer key + 1
: 1 + (int) max($this->orderedKeys);
}
if (null === $key) {
$this->elements[] = $value;
$key = array_key_last($this->elements);
$this->orderedKeys[] = (string) $key;
} elseif (!\array_key_exists($key, $this->elements)) {
$this->orderedKeys[] = (string) $key;
}