Skip to content

Commit 253b195

Browse files
author
Christoph Weygand
committed
Merge remote-tracking branch 'upstream/main'
2 parents 8a7ced8 + 66e6a60 commit 253b195

File tree

39 files changed

+120
-41
lines changed

39 files changed

+120
-41
lines changed

CHANGELOG.md

Lines changed: 80 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,74 +11,96 @@ a release.
1111

1212
```markdown
1313
## [3.6.1] - 2022-07-26
14+
1415
### Fixed
16+
1517
- Sortable: Fix issue with add+delete position synchronization (#1932)
1618
```
1719

1820
---
1921

2022
## [Unreleased]
23+
2124
### Added
25+
2226
- SoftDeleteable: `Gedmo\SoftDeleteable\Event\PreSoftDeleteEventArgs` and
2327
`Gedmo\SoftDeleteable\Event\PostSoftDeleteEventArgs` classes.
2428

2529
## Changed
26-
- Allow string[] as `$sortByField` and `$direction` parameter in `\Gedmo\Tree\Entity\Repository\NestedTreeRepository::reorder` and `\Gedmo\Tree\Entity\Repository\NestedTreeRepository::reorderAll`
30+
31+
- Make doctrine/annotations an optional dependency.
32+
- Allow string[] as `$sortByField` and `$direction` parameter in `\Gedmo\Tree\Entity\Repository\NestedTreeRepository::reorder` and `\Gedmo\Tree\Entity\Repository\NestedTreeRepository::reorderAll`
2733

2834
### Deprecated
35+
2936
- Do not add type-hinted parameters `Gedmo\SoftDeleteable\Event\PreSoftDeleteEventArgs` and
3037
`Gedmo\SoftDeleteable\Event\PostSoftDeleteEventArgs` classes to `preSoftDelete` and `postSoftDelete` events.
3138
- The `createLifecycleEventArgsInstance()` method on `Gedmo\Mapping\Event\AdapterInterface`
3239
implementations is deprecated, use your own subclass of `Doctrine\Persistence\Event\LifecycleEventArgs` as needed.
3340

3441
## [3.14.0]
42+
3543
### Added
44+
3645
- Support for Symfony 7
3746
- Tree: Added `@template` and `@template-extends` annotations to the Tree repositories
3847

3948
### Changed
49+
4050
- Dropped support for PHP < 7.4
4151
- Dropped support for Symfony < 5.4
4252
- Dropped support for doctrine/dbal < 3.2
4353

4454
### Deprecated
45-
- Calling `Gedmo\Mapping\Event\Adapter\ORM::getObjectManager()` and `getObject()` on EventArgs that do not implement `getObjectManager()` and `getObject()` (such as old EventArgs implementing `getEntityManager()` and `getEntity()`)
55+
56+
- Calling `Gedmo\Mapping\Event\Adapter\ORM::getObjectManager()` and `getObject()` on EventArgs that do not implement `getObjectManager()` and `getObject()` (such as old EventArgs implementing `getEntityManager()` and `getEntity()`)
4657
- Calling `Gedmo\Uploadable\Event\UploadableBaseEventArgs::getEntityManager()` and `getEntity()`. Call `getObjectManager()` and `getObject()` instead.
4758

4859
## [3.13.0] - 2023-09-06
60+
4961
### Fixed
62+
5063
- References: fixed condition in `XML` Driver that did not allow to retrieve from the entity definition the `mappedBy` and `inversedBy` fields.
5164
- Fix bug collecting metadata for inherited mapped classes
5265

5366
## [3.12.0] - 2023-07-08
67+
5468
### Added
69+
5570
- Tree: `setSibling()` and `getSibling()` methods in the `Node` interface through the BC `@method` annotation
5671
- Tree: Support array of fields and directions in the `$sortByField` and `$direction` parameters at `AbstractTreeRepository::recover()`
5772
- Loggable: Support for composite identifiers
5873

5974
### Changed
75+
6076
- Named arguments have precedence over the values passed in the `$data` array in annotation classes at `Gedmo\Mapping\Annotation\`
6177
namespace
6278
- Removed conflict against "doctrine/cache" < 1.11, as this library is not used
6379
- Return type from `TranslationProxy::__set()` (from `TranslationProxy` to `void`)
6480

6581
### Fixed
82+
6683
- Tree: Creation of dynamic `Node::$sibling` property, which is deprecated as of PHP >= 8.2
6784
- Return type from `TranslationProxy::__set()` in order to honor its original signature (`void`)
6885

6986
### Deprecated
87+
7088
- Tree: Not implementing `Node` interface in classes that are used as nodes
7189
- Implementing the `Gedmo\Tool\WrapperInterface::getIdentifier()` method without the second argument (`$flatten`) is deprecated and will
7290
be required in version 4.0
7391

7492
## [3.11.1] - 2023-02-20
93+
7594
### Fixed
95+
7696
- Loggable: Remove unfixable deprecation when extending `LoggableListener`
7797
- Remove unfixable deprecations when extending repository classes
7898
- Fix error caused by the attempt of "doctrine/annotations" parsing a `@note` annotation
7999

80100
## [3.11.0] - 2023-01-26
101+
81102
### Added
103+
82104
- Tree: [NestedSet] Added "base" property for tree level annotation
83105
- Tree: [NestedSet] Added `$options` as parameter 2 in `getPathQueryBuilder()` to specify whether you want the starting node included or not
84106
- Tree: [NestedSet] Added `getPathAsString()` method to entity repository
@@ -88,17 +110,20 @@ a release.
88110
- Tree: [NestedSet] Verify and recover wrong levels in nested set
89111

90112
### Added
113+
91114
- Tree: Add `Nested::ALLOWED_NODE_POSITIONS` constant in order to expose the available node positions
92115
- Support for `doctrine/collections` 2.0
93116
- Support for `doctrine/event-manager` 2.0
94117
- Loggable: Add `LogEntryInterface` interface in order to be implemented by log entry models
95118

96119
### Fixed
120+
97121
- Sortable: Fix return value check of Comparable interface (#2541)
98122
- Uploadable: Retrieve the correct metadata when uploading entities of different classes (#2071)
99123
- Translatable: Fix property existence check at `TranslatableListener::getTranslatableLocale()`
100124

101125
### Deprecated
126+
102127
- In order to close the API, `@final` and `@internal` annotations were added to all non base classes, which means that extending
103128
these classes is deprecated and can not be inherited in version 4.0.
104129
- Sortable: Accepting a return type other than "integer" from `Comparable::compareTo()` is deprecated in `SortableListener::postFlush()`.
@@ -112,61 +137,80 @@ a release.
112137
instead.
113138

114139
## [3.10.0] - 2022-11-14
140+
115141
### Changed
142+
116143
- Bump "doctrine/event-manager" dependency from ^1.0 to ^1.2.
117144

118145
### Fixed
146+
119147
- Tree: TreeRoot without rootIdentifierMethod when calling getNextSiblings (#2518)
120148
- Sortable: Fix duplicated positions when manually updating position on more than one object (#2439)
121149

122150
## [3.9.0] - 2022-09-22
151+
123152
### Fixed
153+
124154
- Tree: Allow sorting children by a ManyToOne relation (#2492)
125155
- Tree: Fix passing `null` to `abs()` function
126156
- Timestampable: Use an attribute in Timestampable attribute docs
127157

128158
### Deprecated
159+
129160
- Tree: Passing `null` as argument 8 to `Nested::shiftRangeRL()`
130161

131162
## [3.8.0] - 2022-07-17
163+
132164
### Added
165+
133166
- Sluggable: Add support for `DateTimeImmutable` fields
134167
- Tree: [NestedSet] `childrenQueryBuilder()` to allow specifying sort order separately for each field
135168
- Tree: [NestedSet] Added option to reorder only direct children in `reorder()` method
136169

137170
### Changed
171+
138172
- Tree: In `ClosureTreeRepository::removeFromTree()` and `NestedTreeRepository::removeFromTree()` when something fails in the transaction, it uses the `code` from the original exception to construct the `\Gedmo\Exception\RuntimeException` instance instead of `null`.
139173

140174
### Fixed
175+
141176
- Sluggable: Cast slug to string before passing it as argument 2 to `preg_match()` (#2473)
142177
- Sortable: [SortableGroup] Fix sorting date columns in SQLite (#2462).
143178
- PHPDoc of `AbstractMaterializedPath::removeNode()` and `AbstractMaterializedPath::getChildren()`
144179
- Retrieving the proper metadata cache from Doctrine when using a CacheWarmer.
145180

146181
## [3.7.0] - 2022-05-17
182+
147183
### Added
184+
148185
- Add support for doctrine/persistence 3
149186

150187
### Changed
188+
151189
- Removed call to deprecated `ClassMetadataFactory::getCacheDriver()` method.
152190
- Dropped support for doctrine/mongodb-odm < 2.3.
153191
- Make doctrine/cache an optional dependency.
154192

155193
### Fixed
194+
156195
- Loggable: Fix `appendNumber` renaming for files without extension (#2228)
157196

158197
## [3.6.0] - 2022-03-19
198+
159199
### Added
200+
160201
- Translatable: Add defaultTranslationValue option to allow null or string value (#2167). TranslatableListener can hydrate object properties with null value, but it may cause a Type error for non-nullable getter upon a missing translation.
161202

162203
### Fixed
204+
163205
- Uploadable: `FileInfoInterface::getSize()` return type declaration (#2413).
164206
- Tree: Setting a new Tree Root when Tree Parent is `null`.
165207
- Tree: update cache key used by Closure to match Doctrine's one (#2416).
166208
- Tree: persist order does not affect entities on Closure (#2432)
167209

168210
## [3.5.0] - 2022-01-10
211+
169212
### Added
213+
170214
- SoftDeleteable: Support to use annotations as attributes on PHP >= 8.0.
171215
- Blameable: Support to use annotations as attributes on PHP >= 8.0.
172216
- IpTraceable: Support to use annotations as attributes on PHP >= 8.0.
@@ -183,6 +227,7 @@ a release.
183227
- `Gedmo\Mapping\Event\AdapterInterface::getObject()` method.
184228

185229
### Fixed
230+
186231
- Blameable, IpTraceable, Timestampable: Type handling for the tracked field values configured in the origin field.
187232
- Loggable: Using only PHP 8 attributes.
188233
- References: Avoid deprecations using LazyCollection with PHP 8.1
@@ -194,6 +239,7 @@ a release.
194239
method accessing a non-existing key.
195240

196241
### Deprecated
242+
197243
- Tree: When using Closure tree strategy, it is deprecated not defining the mapping associations of the closure entity.
198244
- `Gedmo\Tool\Logging\DBAL\QueryAnalizer` class without replacement.
199245
- Using YAML mapping is deprecated, you SHOULD migrate to attributes, annotations or XML.
@@ -202,17 +248,21 @@ a release.
202248
- `Gedmo\Tool\Wrapper\WrapperInterface::populate()` method.
203249

204250
### Changed
251+
205252
- In order to use a custom cache for storing configuration of an extension, the user has to call `setCacheItemPool()`
206253
on the extension listener passing an instance of `Psr\Cache\CacheItemPoolInterface`.
207254

208255
## [3.4.0] - 2021-12-05
256+
209257
### Added
258+
210259
- PHP 8 Attributes support for Doctrine MongoDB to document & traits.
211260
- Support for doctrine/dbal >=3.2.
212261
- Timestampable: Support to use annotations as attributes on PHP >= 8.0.
213262
- Loggable: Support to use annotations as attributes on PHP >= 8.0.
214263

215264
### Changed
265+
216266
- Translatable: Dropped support for other values than "true", "false", "1" and "0" in the `fallback` attribute of the `translatable`
217267
element in the XML mapping.
218268
- Tree: Dropped support for other values than "true", "false", "1" and "0" in the `activate-locking` attribute of the `tree`
@@ -223,7 +273,9 @@ a release.
223273
- The third argument of `Gedmo\SoftDeleteable\Query\TreeWalker\Exec\MultiTableDeleteExecutor::__construct()` requires a `Doctrine\ORM\Mapping\ClassMetadata` instance.
224274

225275
## [3.3.1] - 2021-11-18
276+
226277
### Fixed
278+
227279
- Translatable: Using ORM/ODM attribute mapping and translatable annotations.
228280
- Tree: Missing support for `tree-path-hash` fields in XML mapping.
229281
- Tree: Check for affected rows at `ClosureTreeRepository::cleanUpClosure()` and `Closure::updateNode()`.
@@ -232,14 +284,18 @@ a release.
232284
- Loggable: Missing support for `versioned` fields at `attribute-override` in XML mapping.
233285

234286
## [3.3.0] - 2021-11-15
287+
235288
### Added
289+
236290
- Support to use Translatable annotations as attributes on PHP >= 8.0.
237291

238292
### Deprecated
293+
239294
- `Gedmo\Mapping\Driver\File::$_paths` property and `Gedmo\Mapping\Driver\File::setPaths()` method are deprecated and will
240295
be removed in version 4.0, as they are not used.
241296

242297
### Fixed
298+
243299
- Value passed in the `--config` option to `fix-cs` Composer script.
244300
- Return value for `replaceRelative()` and `replaceInverseRelative()` at `Gedmo\Sluggable\Mapping\Event\Adapter\ODM` if the
245301
query result does not implement `Doctrine\ODM\MongoDB\Iterator\Iterator`.
@@ -248,40 +304,55 @@ a release.
248304
As `Doctrine\ODM\MongoDB\UnitOfWork` from doctrine/mongodb-odm still uses `spl_object_hash()`, all `spl_object_hash()` calls were replaced by `spl_object_id()` to make it work with both ORM and ODM managers.
249305

250306
## [3.2.0] - 2021-10-05
307+
251308
### Added
309+
252310
- PHP 8 Attributes for Doctrine ORM to entities & traits (#2251)
253311

254312
### Fixed
313+
255314
- Removed legacy checks targeting older versions of PHP (#2201)
256315
- Added missing XSD definitions (#2244)
257316
- Replaced undefined constants from `Doctrine\DBAL\Types\Type` at `Gedmo\Translatable\Mapping\Event\Adapter\ORM::foreignKey()` (#2250)
258317
- Add conflict against "doctrine/orm" >=2.10 in order to guarantee the schema extension (see https://github.com/doctrine/orm/pull/8852) (#2255)
259318

260319
## [3.1.0] - 2021-06-22
320+
261321
### Fixed
322+
262323
- Allow installing doctrine/cache 2.0 (thanks @alcaeus!)
263324
- Make doctrine/cache a dev dependency
264325

265326
## [3.0.5] - 2021-04-23
327+
266328
### Fixed
329+
267330
- Use path_separator when removing children (#2217)
268331

269332
## [3.0.4] - 2021-03-27
333+
270334
### Fixed
335+
271336
- Add hacky measure to resolve incompatibility with DoctrineBundle 2.3 [#2211](https://github.com/doctrine-extensions/DoctrineExtensions/pull/2211)
272337

273338
## [3.0.3] - 2021-01-23
339+
274340
### Fixed
341+
275342
- Add PHP 8 compatibility to `composer.json`, resolving minor function parameter deprecations [#2194](https://github.com/Atlantic18/DoctrineExtensions/pull/2194)
276343

277344
## [3.0.2] - 2021-01-23
345+
278346
- Ignore; tag & version mismatch
279347

280348
## [3.0.1] - 2021-01-23
349+
281350
- Ignore; wrong branch published
282351

283352
## [3.0.0] - 2020-09-23
353+
284354
### Notable & Breaking Changes
355+
285356
- Minimum PHP version requirement of 7.2
286357
- Source files moved from `/lib/Gedmo` to `/src`
287358
- Added compatibility for `doctrine/common` 3.0 and `doctrine/persistence` 2.0
@@ -292,18 +363,25 @@ a release.
292363
Changes below marked ⚠️ may also be breaking, if you have extended DoctrineExtensions.
293364

294365
### MongoDB
366+
295367
- Requires the `ext-mongodb` PHP extension. Usage of `ext-mongo` is deprecated and will be removed in the next major version.
296368
- Minimum Doctrine MongoDB ODM requirement of 2.0
297369
- Usages of `\MongoDate` replaced with `MongoDB\BSON\UTCDateTime`
298370

299371
### Global / Shared
372+
300373
#### Fixed
374+
301375
- Removed `null` parameter from `Doctrine\Common\Cache\Cache::save()` calls (#1996)
302376

303377
### Tree
378+
304379
#### Fixed
380+
305381
- The value of path source property is cast to string type for Materialized Path Tree strategy (#2061)
306382

307383
### SoftDeleteable
384+
308385
#### Changed
386+
309387
- ⚠️ Generate different Date values based on column type (#2115)

composer.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
"require": {
4343
"php": "^7.4 || ^8.0",
4444
"behat/transliterator": "^1.2",
45-
"doctrine/annotations": "^1.13 || ^2.0",
4645
"doctrine/collections": "^1.2 || ^2.0",
4746
"doctrine/common": "^2.13 || ^3.0",
4847
"doctrine/event-manager": "^1.2 || ^2.0",
@@ -52,6 +51,7 @@
5251
"symfony/deprecation-contracts": "^2.1 || ^3.0"
5352
},
5453
"require-dev": {
54+
"doctrine/annotations": "^1.13 || ^2.0",
5555
"doctrine/cache": "^1.11 || ^2.0",
5656
"doctrine/dbal": "^3.2",
5757
"doctrine/doctrine-bundle": "^2.3",
@@ -63,12 +63,13 @@
6363
"phpstan/phpstan-doctrine": "^1.0",
6464
"phpstan/phpstan-phpunit": "^1.0",
6565
"phpunit/phpunit": "^9.6",
66-
"rector/rector": "^0.18",
66+
"rector/rector": "^0.19",
6767
"symfony/console": "^5.4 || ^6.0 || ^7.0",
6868
"symfony/phpunit-bridge": "^6.0 || ^7.0",
6969
"symfony/yaml": "^5.4 || ^6.0 || ^7.0"
7070
},
7171
"conflict": {
72+
"doctrine/annotations": "<1.13 || >=3.0",
7273
"doctrine/dbal": "<3.2",
7374
"doctrine/mongodb-odm": "<2.3",
7475
"doctrine/orm": "<2.14.0 || 2.16.0 || 2.16.1",

tests/Gedmo/Blameable/Fixture/Document/Article.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class Article
3838
/**
3939
* @ODM\ReferenceOne(targetDocument="Gedmo\Tests\Blameable\Fixture\Document\Type")
4040
*/
41-
#[Odm\ReferenceOne(targetDocument: Type::class)]
41+
#[ODM\ReferenceOne(targetDocument: Type::class)]
4242
private ?Type $type = null;
4343

4444
/**

tests/Gedmo/IpTraceable/Fixture/Document/Article.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class Article
3939
* @ODM\ReferenceOne(targetDocument="Gedmo\Tests\IpTraceable\Fixture\Document\Type")
4040
*/
4141
#[ODM\ReferenceOne(targetDocument: Type::class)]
42-
private ?\Gedmo\Tests\IpTraceable\Fixture\Document\Type $type = null;
42+
private ?Type $type = null;
4343

4444
/**
4545
* @ODM\Field(type="string")

0 commit comments

Comments
 (0)