Skip to content

Commit a9eb0dd

Browse files
GromNaNIonBazan
andauthored
Run tests with PHP 8.5 (#2917)
* Test with PHP 8.5 * Fix 'Using null as an array offset is deprecated, use an empty string instead' --------- Co-authored-by: Ion Bazan <[email protected]>
1 parent 1a86e7d commit a9eb0dd

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

.github/workflows/continuous-integration.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ jobs:
2323
- "8.2"
2424
- "8.3"
2525
- "8.4"
26+
- "8.5"
2627
mongodb-version:
2728
- "8.0"
2829
- "7.0"

src/Aggregation/Stage/VectorSearch.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public function getExpression(): array
8282
}
8383

8484
if ($this->queryVector !== null) {
85-
$params['queryVector'] = Type::getType($this->persister->getClassMetadata()->fieldMappings[$this->path]['type'] ?? Type::RAW)->convertToDatabaseValue($this->queryVector);
85+
$params['queryVector'] = Type::getType($this->persister->getClassMetadata()->fieldMappings[$this->path ?? '']['type'] ?? Type::RAW)->convertToDatabaseValue($this->queryVector);
8686
}
8787

8888
return [$this->getStageName() => $params];

src/Persisters/DocumentPersister.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -706,7 +706,7 @@ private function loadEmbedManyCollection(PersistentCollectionInterface $collecti
706706
$this->uow->setParentAssociation($embeddedDocumentObject, $mapping, $owner, $mapping['name'] . '.' . $key);
707707

708708
$data = $this->hydratorFactory->hydrate($embeddedDocumentObject, $embeddedDocument, $collection->getHints());
709-
$id = $data[$embeddedMetadata->identifier] ?? null;
709+
$id = $data[$embeddedMetadata->identifier ?? ''] ?? null;
710710

711711
if (empty($collection->getHints()[Query::HINT_READ_ONLY])) {
712712
$this->uow->registerManaged($embeddedDocumentObject, $id, $data);
@@ -994,7 +994,7 @@ public function prepareFieldName(string $fieldName): string
994994
*/
995995
public function addDiscriminatorToPreparedQuery(array $preparedQuery): array
996996
{
997-
if (isset($preparedQuery[$this->class->discriminatorField]) || $this->class->discriminatorField === null) {
997+
if ($this->class->discriminatorField === null || isset($preparedQuery[$this->class->discriminatorField])) {
998998
return $preparedQuery;
999999
}
10001000

0 commit comments

Comments
 (0)