Skip to content

Commit 0872ebe

Browse files
authored
Merge pull request #880 from doctrine/php85
test with php 8.5
2 parents 9768398 + 63fe724 commit 0872ebe

File tree

17 files changed

+30
-37
lines changed

17 files changed

+30
-37
lines changed

.github/workflows/test-application.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ jobs:
3131
- '8.2'
3232
- '8.3'
3333
- '8.4'
34+
- '8.5'
3435
dependencies: [highest]
3536
symfony-version: ['*']
3637
jackalope-version: ['1.*']
@@ -45,7 +46,7 @@ jobs:
4546
- php-version: '8.2'
4647
dependencies: highest
4748
symfony-version: '6.*'
48-
- php-version: '8.4'
49+
- php-version: '8.5'
4950
dependencies: highest
5051
symfony-version: '7.*'
5152
jackalope-version: '2.*'
@@ -111,6 +112,7 @@ jobs:
111112
- '8.2'
112113
- '8.3'
113114
- '8.4'
115+
- '8.5'
114116
dependencies: [highest]
115117
symfony-version: ['*']
116118
jackalope-version: ['1.*']
@@ -125,7 +127,7 @@ jobs:
125127
- php-version: '8.2'
126128
dependencies: highest
127129
symfony-version: '6.*'
128-
- php-version: '8.4'
130+
- php-version: '8.5'
129131
dependencies: highest
130132
symfony-version: '7.*'
131133
jackalope-version: '2.*'

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ Changelog
44
2.x
55
===
66

7+
2.1.1
8+
-----
9+
10+
* Test with PHP 8.5 and fix deprecations.
11+
712
2.1.0
813
-----
914

lib/Doctrine/ODM/PHPCR/Document/AbstractFile.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* This class represents an abstract "file".
1111
*/
1212
#[PHPCR\MappedSuperclass(mixins: ['mix:created'])]
13-
abstract class AbstractFile implements HierarchyInterface
13+
abstract class AbstractFile implements \Stringable, HierarchyInterface
1414
{
1515
#[PHPCR\Id(strategy: 'parent')]
1616
protected string $id;

lib/Doctrine/ODM/PHPCR/Document/Generic.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* You can not use this to create nodes as it has no type mapping.
1616
*/
1717
#[PHPCR\Document]
18-
class Generic
18+
class Generic implements \Stringable
1919
{
2020
/**
2121
* Id (path) of this document.

lib/Doctrine/ODM/PHPCR/Document/Resource.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* @see http://wiki.apache.org/jackrabbit/nt:resource
1313
*/
1414
#[PHPCR\Document(nodeType: 'nt:resource')]
15-
class Resource
15+
class Resource implements \Stringable
1616
{
1717
#[PHPCR\Id]
1818
protected string $id;

lib/Doctrine/ODM/PHPCR/Mapping/ClassMetadata.php

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,6 @@ public function wakeupReflection(ReflectionService $reflService): void
315315
$reflField = array_key_exists('declared', $this->mappings[$fieldName])
316316
? new \ReflectionProperty($this->mappings[$fieldName]['declared'], $fieldName)
317317
: $this->reflClass->getProperty($fieldName);
318-
$reflField->setAccessible(true);
319318
$this->reflFields[$fieldName] = $reflField;
320319
}
321320
}
@@ -888,7 +887,7 @@ private function validateAndCompleteFieldMapping(array $mapping, ?self $inherite
888887
$mapping['assocNulls'] = $mapping['property'].'Nulls';
889888
}
890889

891-
if (array_key_exists($mapping['fieldName'], $this->mappings)) {
890+
if ($mapping['fieldName'] && array_key_exists($mapping['fieldName'], $this->mappings)) {
892891
if (!$isField
893892
|| empty($mapping['type'])
894893
|| empty($this->mappings[$mapping['fieldName']])
@@ -909,7 +908,6 @@ private function validateAndCompleteFieldMapping(array $mapping, ?self $inherite
909908
}
910909

911910
$reflProp = $this->reflClass->getProperty($mapping['fieldName']);
912-
$reflProp->setAccessible(true);
913911
$this->reflFields[$mapping['fieldName']] = $reflProp;
914912
$this->mappings[$mapping['fieldName']] = $mapping;
915913

@@ -1212,7 +1210,7 @@ public function hasField($fieldName): bool
12121210
|| $this->versionCreatedField === $fieldName;
12131211
}
12141212

1215-
public function hasAssociation($fieldName): bool
1213+
public function hasAssociation(string $fieldName): bool
12161214
{
12171215
return array_key_exists($fieldName, $this->mappings)
12181216
&& in_array($this->mappings[$fieldName]['type'], [self::MANY_TO_ONE, self::MANY_TO_MANY, 'referrers', 'mixedreferrers', 'children', 'child', 'parent'], true);
@@ -1232,14 +1230,14 @@ public function getAssociation(string $fieldName): array
12321230
return $this->mappings[$fieldName];
12331231
}
12341232

1235-
public function isSingleValuedAssociation($fieldName): bool
1233+
public function isSingleValuedAssociation(string $fieldName): bool
12361234
{
12371235
return array_key_exists($fieldName, $this->childMappings)
12381236
|| $fieldName === $this->parentMapping
12391237
|| array_key_exists($fieldName, $this->referenceMappings) && self::MANY_TO_ONE === $this->mappings[$fieldName]['type'];
12401238
}
12411239

1242-
public function isCollectionValuedAssociation($fieldName): bool
1240+
public function isCollectionValuedAssociation(string $fieldName): bool
12431241
{
12441242
return array_key_exists($fieldName, $this->referenceMappings) && self::MANY_TO_MANY === $this->mappings[$fieldName]['type']
12451243
|| array_key_exists($fieldName, $this->referrersMappings)
@@ -1362,7 +1360,7 @@ public function isNullable(string $fieldName): bool
13621360
*/
13631361
public function mapField(array $mapping, ?self $inherited = null): void
13641362
{
1365-
$parentMapping = array_key_exists('fieldName', $mapping) && array_key_exists($mapping['fieldName'], $this->mappings)
1363+
$parentMapping = array_key_exists('fieldName', $mapping) && null !== $mapping['fieldName'] && array_key_exists($mapping['fieldName'], $this->mappings)
13661364
? $this->mappings[$mapping['fieldName']]
13671365
: null;
13681366

@@ -1547,7 +1545,7 @@ public function newInstance(): object
15471545

15481546
public function setIdentifierValue(object $document, string $id): void
15491547
{
1550-
if (array_key_exists($this->identifier, $this->reflFields)) {
1548+
if (null !== $this->identifier && array_key_exists($this->identifier, $this->reflFields)) {
15511549
$this->reflFields[$this->identifier]->setValue($document, $id);
15521550
}
15531551
}

lib/Doctrine/ODM/PHPCR/PersistentCollection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
/**
99
* @author Benjamin Eberlei <kontakt@beberlei.de>
1010
*/
11-
abstract class PersistentCollection implements Collection
11+
abstract class PersistentCollection implements \Stringable, Collection
1212
{
1313
protected const INITIALIZED_NONE = 'not initialized';
1414

lib/Doctrine/ODM/PHPCR/Proxy/ProxyFactory.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,6 @@ private function createCloner(PhpcrClassMetadata $classMetadata, ?\ReflectionPro
169169
$propertyName = $reflectionProperty->getName();
170170

171171
if ($classMetadata->hasField($propertyName) || $classMetadata->hasAssociation($propertyName)) {
172-
$reflectionProperty->setAccessible(true);
173172
$reflectionProperty->setValue($cloned, $reflectionProperty->getValue($original));
174173
}
175174
}

lib/Doctrine/ODM/PHPCR/Query/Builder/ConverterPhpcr.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ protected function walkOperandStaticLiteral(OperandStaticLiteral $node): Literal
307307
'uuid' => 'string',
308308
];
309309

310-
if (array_key_exists($type, $typeMapping)) {
310+
if ($type && array_key_exists($type, $typeMapping)) {
311311
settype($value, $typeMapping[$type]);
312312
}
313313
}

lib/Doctrine/ODM/PHPCR/Query/Builder/QueryBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
*
2929
* @author Daniel Leech <daniel@dantleech.com>
3030
*/
31-
class QueryBuilder extends QBConstants
31+
class QueryBuilder extends QBConstants implements \Stringable
3232
{
3333
private ?ConverterInterface $converter = null;
3434
private int $firstResult = 0;

0 commit comments

Comments
 (0)