Skip to content

Commit abc20ac

Browse files
committed
Merge remote-tracking branch 'origin/2.1.x' into 3.0.x
2 parents efaccb4 + 8ae2c49 commit abc20ac

File tree

19 files changed

+55
-47
lines changed

19 files changed

+55
-47
lines changed

.github/workflows/test-application.yaml

Lines changed: 14 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,11 +46,16 @@ 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.*'
5253
php-bench: true
54+
- php-version: '8.5'
55+
dependencies: highest
56+
symfony-version: '8.*'
57+
jackalope-version: '2.*'
58+
php-bench: true
5359

5460
steps:
5561
- name: Checkout project
@@ -111,6 +117,7 @@ jobs:
111117
- '8.2'
112118
- '8.3'
113119
- '8.4'
120+
- '8.5'
114121
dependencies: [highest]
115122
symfony-version: ['*']
116123
jackalope-version: ['1.*']
@@ -125,11 +132,16 @@ jobs:
125132
- php-version: '8.2'
126133
dependencies: highest
127134
symfony-version: '6.*'
128-
- php-version: '8.4'
135+
- php-version: '8.5'
129136
dependencies: highest
130137
symfony-version: '7.*'
131138
jackalope-version: '2.*'
132139
php-bench: true
140+
- php-version: '8.5'
141+
dependencies: highest
142+
symfony-version: '8.*'
143+
jackalope-version: '2.*'
144+
php-bench: true
133145

134146
steps:
135147
- name: Checkout project

CHANGELOG.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,17 @@ Changelog
1010
2.x
1111
===
1212

13+
2.1.1
14+
-----
15+
16+
* Compatibility with Symfony 8.
17+
* Test with PHP 8.5 and fix deprecations.
18+
19+
2.1.0
20+
-----
21+
22+
* Removed accidentally added unused dependency to `doctrine/data-fixtures`.
23+
1324
2.0.1
1425
-----
1526

@@ -503,4 +514,4 @@ maintenance release of the 1.0 family with bugfixes
503514
->execute(Query::HYDRATE_PHPCR);
504515
* CreateQuery($statement, $language) has NOT been implemented in the new query builder.
505516
It is, however, still available in the DocumentManager.
506-
* DocumentManager->getDocumentsByQuery renamed to getDocumentsByPhpcrQuery()
517+
* DocumentManager->getDocumentsByQuery renamed to getDocumentsByPhpcrQuery()

composer.json

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,27 +22,26 @@
2222
"php": "^8.1",
2323
"doctrine/collections": "^2.0",
2424
"doctrine/common": "^2.4 || ^3.0",
25-
"doctrine/data-fixtures": "^1.0",
2625
"doctrine/event-manager": "^1.0 || ^2.0",
2726
"doctrine/persistence": "^3.0",
2827
"phpcr/phpcr": "^2.1.1",
2928
"phpcr/phpcr-implementation": "^2.1",
3029
"phpcr/phpcr-utils": "^1.3.0 || ^2.0",
3130
"doctrine/instantiator": "^1.0.1 || ^2.0",
32-
"symfony/console": "^3.4 || ^4.3 || ^5.0 || ^6.0 || ^7.0",
31+
"symfony/console": "^3.4 || ^4.3 || ^5.0 || ^6.0 || ^7.0 || ^8.0",
3332
"psr/cache": "^1.0 || ^2.0 || ^3.0"
3433
},
3534
"require-dev": {
36-
"symfony/cache": "^5.4 || ^6.0.19 || ^7.0",
37-
"symfony/yaml": "^5.4 || ^6.0.19 || ^7.0",
38-
"symfony/phpunit-bridge": "^5.4.21 || ^6.0.19 || ^7.0",
3935
"liip/rmt": "^1.7.3",
40-
"phpunit/phpunit": "^9.6.15"
36+
"phpunit/phpunit": "^9.6.15",
37+
"symfony/cache": "^5.4 || ^6.0.19 || ^7.0 || ^8.0",
38+
"symfony/yaml": "^5.4 || ^6.0.19 || ^7.0 || ^8.0",
39+
"symfony/phpunit-bridge": "^5.4.21 || ^6.0.19 || ^7.0 || ^8.0"
4140
},
4241
"suggest": {
43-
"symfony/yaml": "^5.4 || ^6.0 || ^7.0",
4442
"jackalope/jackalope-doctrine-dbal": "^1.3 || ^2.0",
45-
"jackalope/jackalope-jackrabbit": "^1.3 || ^2.0"
43+
"jackalope/jackalope-jackrabbit": "^1.3 || ^2.0",
44+
"symfony/yaml": "^5.4 || ^6.0 || ^7.0 || ^8.0"
4645
},
4746
"conflict": {
4847
"jackalope/jackalope-doctrine-dbal": "<1.1.5",

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
}

0 commit comments

Comments
 (0)