Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
Christoph Weygand committed Jan 24, 2024
2 parents 8a7ced8 + 66e6a60 commit 253b195
Show file tree
Hide file tree
Showing 39 changed files with 120 additions and 41 deletions.
82 changes: 80 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,74 +11,96 @@ a release.

```markdown
## [3.6.1] - 2022-07-26

### Fixed

- Sortable: Fix issue with add+delete position synchronization (#1932)
```

---

## [Unreleased]

### Added

- SoftDeleteable: `Gedmo\SoftDeleteable\Event\PreSoftDeleteEventArgs` and
`Gedmo\SoftDeleteable\Event\PostSoftDeleteEventArgs` classes.

## Changed
- Allow string[] as `$sortByField` and `$direction` parameter in `\Gedmo\Tree\Entity\Repository\NestedTreeRepository::reorder` and `\Gedmo\Tree\Entity\Repository\NestedTreeRepository::reorderAll`

- Make doctrine/annotations an optional dependency.
- Allow string[] as `$sortByField` and `$direction` parameter in `\Gedmo\Tree\Entity\Repository\NestedTreeRepository::reorder` and `\Gedmo\Tree\Entity\Repository\NestedTreeRepository::reorderAll`

### Deprecated

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

## [3.14.0]

### Added

- Support for Symfony 7
- Tree: Added `@template` and `@template-extends` annotations to the Tree repositories

### Changed

- Dropped support for PHP < 7.4
- Dropped support for Symfony < 5.4
- Dropped support for doctrine/dbal < 3.2

### Deprecated
- 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()`)

- 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()`)
- Calling `Gedmo\Uploadable\Event\UploadableBaseEventArgs::getEntityManager()` and `getEntity()`. Call `getObjectManager()` and `getObject()` instead.

## [3.13.0] - 2023-09-06

### Fixed

- References: fixed condition in `XML` Driver that did not allow to retrieve from the entity definition the `mappedBy` and `inversedBy` fields.
- Fix bug collecting metadata for inherited mapped classes

## [3.12.0] - 2023-07-08

### Added

- Tree: `setSibling()` and `getSibling()` methods in the `Node` interface through the BC `@method` annotation
- Tree: Support array of fields and directions in the `$sortByField` and `$direction` parameters at `AbstractTreeRepository::recover()`
- Loggable: Support for composite identifiers

### Changed

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

### Fixed

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

### Deprecated

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

## [3.11.1] - 2023-02-20

### Fixed

- Loggable: Remove unfixable deprecation when extending `LoggableListener`
- Remove unfixable deprecations when extending repository classes
- Fix error caused by the attempt of "doctrine/annotations" parsing a `@note` annotation

## [3.11.0] - 2023-01-26

### Added

- Tree: [NestedSet] Added "base" property for tree level annotation
- Tree: [NestedSet] Added `$options` as parameter 2 in `getPathQueryBuilder()` to specify whether you want the starting node included or not
- Tree: [NestedSet] Added `getPathAsString()` method to entity repository
Expand All @@ -88,17 +110,20 @@ a release.
- Tree: [NestedSet] Verify and recover wrong levels in nested set

### Added

- Tree: Add `Nested::ALLOWED_NODE_POSITIONS` constant in order to expose the available node positions
- Support for `doctrine/collections` 2.0
- Support for `doctrine/event-manager` 2.0
- Loggable: Add `LogEntryInterface` interface in order to be implemented by log entry models

### Fixed

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

### Deprecated

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

## [3.10.0] - 2022-11-14

### Changed

- Bump "doctrine/event-manager" dependency from ^1.0 to ^1.2.

### Fixed

- Tree: TreeRoot without rootIdentifierMethod when calling getNextSiblings (#2518)
- Sortable: Fix duplicated positions when manually updating position on more than one object (#2439)

## [3.9.0] - 2022-09-22

### Fixed

- Tree: Allow sorting children by a ManyToOne relation (#2492)
- Tree: Fix passing `null` to `abs()` function
- Timestampable: Use an attribute in Timestampable attribute docs

### Deprecated

- Tree: Passing `null` as argument 8 to `Nested::shiftRangeRL()`

## [3.8.0] - 2022-07-17

### Added

- Sluggable: Add support for `DateTimeImmutable` fields
- Tree: [NestedSet] `childrenQueryBuilder()` to allow specifying sort order separately for each field
- Tree: [NestedSet] Added option to reorder only direct children in `reorder()` method

### Changed

- 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`.

### Fixed

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

## [3.7.0] - 2022-05-17

### Added

- Add support for doctrine/persistence 3

### Changed

- Removed call to deprecated `ClassMetadataFactory::getCacheDriver()` method.
- Dropped support for doctrine/mongodb-odm < 2.3.
- Make doctrine/cache an optional dependency.

### Fixed

- Loggable: Fix `appendNumber` renaming for files without extension (#2228)

## [3.6.0] - 2022-03-19

### Added

- 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.

### Fixed

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

## [3.5.0] - 2022-01-10

### Added

- SoftDeleteable: Support to use annotations as attributes on PHP >= 8.0.
- Blameable: Support to use annotations as attributes on PHP >= 8.0.
- IpTraceable: Support to use annotations as attributes on PHP >= 8.0.
Expand All @@ -183,6 +227,7 @@ a release.
- `Gedmo\Mapping\Event\AdapterInterface::getObject()` method.

### Fixed

- Blameable, IpTraceable, Timestampable: Type handling for the tracked field values configured in the origin field.
- Loggable: Using only PHP 8 attributes.
- References: Avoid deprecations using LazyCollection with PHP 8.1
Expand All @@ -194,6 +239,7 @@ a release.
method accessing a non-existing key.

### Deprecated

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

### Changed

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

## [3.4.0] - 2021-12-05

### Added

- PHP 8 Attributes support for Doctrine MongoDB to document & traits.
- Support for doctrine/dbal >=3.2.
- Timestampable: Support to use annotations as attributes on PHP >= 8.0.
- Loggable: Support to use annotations as attributes on PHP >= 8.0.

### Changed

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

## [3.3.1] - 2021-11-18

### Fixed

- Translatable: Using ORM/ODM attribute mapping and translatable annotations.
- Tree: Missing support for `tree-path-hash` fields in XML mapping.
- Tree: Check for affected rows at `ClosureTreeRepository::cleanUpClosure()` and `Closure::updateNode()`.
Expand All @@ -232,14 +284,18 @@ a release.
- Loggable: Missing support for `versioned` fields at `attribute-override` in XML mapping.

## [3.3.0] - 2021-11-15

### Added

- Support to use Translatable annotations as attributes on PHP >= 8.0.

### Deprecated

- `Gedmo\Mapping\Driver\File::$_paths` property and `Gedmo\Mapping\Driver\File::setPaths()` method are deprecated and will
be removed in version 4.0, as they are not used.

### Fixed

- Value passed in the `--config` option to `fix-cs` Composer script.
- Return value for `replaceRelative()` and `replaceInverseRelative()` at `Gedmo\Sluggable\Mapping\Event\Adapter\ODM` if the
query result does not implement `Doctrine\ODM\MongoDB\Iterator\Iterator`.
Expand All @@ -248,40 +304,55 @@ a release.
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.

## [3.2.0] - 2021-10-05

### Added

- PHP 8 Attributes for Doctrine ORM to entities & traits (#2251)

### Fixed

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

## [3.1.0] - 2021-06-22

### Fixed

- Allow installing doctrine/cache 2.0 (thanks @alcaeus!)
- Make doctrine/cache a dev dependency

## [3.0.5] - 2021-04-23

### Fixed

- Use path_separator when removing children (#2217)

## [3.0.4] - 2021-03-27

### Fixed

- Add hacky measure to resolve incompatibility with DoctrineBundle 2.3 [#2211](https://github.com/doctrine-extensions/DoctrineExtensions/pull/2211)

## [3.0.3] - 2021-01-23

### Fixed

- Add PHP 8 compatibility to `composer.json`, resolving minor function parameter deprecations [#2194](https://github.com/Atlantic18/DoctrineExtensions/pull/2194)

## [3.0.2] - 2021-01-23

- Ignore; tag & version mismatch

## [3.0.1] - 2021-01-23

- Ignore; wrong branch published

## [3.0.0] - 2020-09-23

### Notable & Breaking Changes

- Minimum PHP version requirement of 7.2
- Source files moved from `/lib/Gedmo` to `/src`
- Added compatibility for `doctrine/common` 3.0 and `doctrine/persistence` 2.0
Expand All @@ -292,18 +363,25 @@ a release.
Changes below marked ⚠️ may also be breaking, if you have extended DoctrineExtensions.

### MongoDB

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

### Global / Shared

#### Fixed

- Removed `null` parameter from `Doctrine\Common\Cache\Cache::save()` calls (#1996)

### Tree

#### Fixed

- The value of path source property is cast to string type for Materialized Path Tree strategy (#2061)

### SoftDeleteable

#### Changed

- ⚠️ Generate different Date values based on column type (#2115)
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
"require": {
"php": "^7.4 || ^8.0",
"behat/transliterator": "^1.2",
"doctrine/annotations": "^1.13 || ^2.0",
"doctrine/collections": "^1.2 || ^2.0",
"doctrine/common": "^2.13 || ^3.0",
"doctrine/event-manager": "^1.2 || ^2.0",
Expand All @@ -52,6 +51,7 @@
"symfony/deprecation-contracts": "^2.1 || ^3.0"
},
"require-dev": {
"doctrine/annotations": "^1.13 || ^2.0",
"doctrine/cache": "^1.11 || ^2.0",
"doctrine/dbal": "^3.2",
"doctrine/doctrine-bundle": "^2.3",
Expand All @@ -63,12 +63,13 @@
"phpstan/phpstan-doctrine": "^1.0",
"phpstan/phpstan-phpunit": "^1.0",
"phpunit/phpunit": "^9.6",
"rector/rector": "^0.18",
"rector/rector": "^0.19",
"symfony/console": "^5.4 || ^6.0 || ^7.0",
"symfony/phpunit-bridge": "^6.0 || ^7.0",
"symfony/yaml": "^5.4 || ^6.0 || ^7.0"
},
"conflict": {
"doctrine/annotations": "<1.13 || >=3.0",
"doctrine/dbal": "<3.2",
"doctrine/mongodb-odm": "<2.3",
"doctrine/orm": "<2.14.0 || 2.16.0 || 2.16.1",
Expand Down
2 changes: 1 addition & 1 deletion tests/Gedmo/Blameable/Fixture/Document/Article.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class Article
/**
* @ODM\ReferenceOne(targetDocument="Gedmo\Tests\Blameable\Fixture\Document\Type")
*/
#[Odm\ReferenceOne(targetDocument: Type::class)]
#[ODM\ReferenceOne(targetDocument: Type::class)]
private ?Type $type = null;

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/Gedmo/IpTraceable/Fixture/Document/Article.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class Article
* @ODM\ReferenceOne(targetDocument="Gedmo\Tests\IpTraceable\Fixture\Document\Type")
*/
#[ODM\ReferenceOne(targetDocument: Type::class)]
private ?\Gedmo\Tests\IpTraceable\Fixture\Document\Type $type = null;
private ?Type $type = null;

/**
* @ODM\Field(type="string")
Expand Down
Loading

0 comments on commit 253b195

Please sign in to comment.