From a9d2a58472d662ac684b15a2541f2d689932e660 Mon Sep 17 00:00:00 2001 From: Javier Spagnoletti Date: Thu, 24 Sep 2020 00:02:00 -0300 Subject: [PATCH] 3.4.0 --- CHANGELOG.md | 50 +++++++++++++++++++++++ UPGRADE-3.x.md | 3 ++ src/Admin/FieldDescription.php | 6 +-- src/Datagrid/ProxyQuery.php | 2 +- src/Filter/AbstractDateFilter.php | 4 +- src/Guesser/FilterTypeGuesser.php | 10 ++--- src/Guesser/TypeGuesser.php | 18 ++++---- src/Model/ModelManager.php | 38 ++++++++--------- src/Resources/config/doctrine_mongodb.php | 2 +- src/Util/ObjectAclManipulator.php | 2 +- tests/Model/ModelManagerTest.php | 6 +-- 11 files changed, 97 insertions(+), 44 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 10b35fd6..5ad39752 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,56 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). +## [3.4.0](https://github.com/SonataDoctrineMongoDBAdminBundle/compare/3.3.0...3.4.0) - 2020-09-24 +### Added +- [[#353](https://github.com/sonata-project/SonataDoctrineMongoDBAdminBundle/pull/353)] Allow `_sort_by` filter to not be initially defined ([@VincentLanglet](https://github.com/VincentLanglet)) +- [[#420](https://github.com/sonata-project/SonataDoctrineMongoDBAdminBundle/pull/420)] Added returning the own instance in `ProxyQuery` based on PHPDoc of `ProxyQueryInterface` ([@franmomu](https://github.com/franmomu)) +- [[#408](https://github.com/sonata-project/SonataDoctrineMongoDBAdminBundle/pull/408)] Added support for symfony/options-resolver:^5.1 ([@franmomu](https://github.com/franmomu)) +- [[#408](https://github.com/sonata-project/SonataDoctrineMongoDBAdminBundle/pull/408)] Added support for twig 3 ([@franmomu](https://github.com/franmomu)) +- [[#409](https://github.com/sonata-project/SonataDoctrineMongoDBAdminBundle/pull/409)] Added doctrine/persistence as a dependency ([@franmomu](https://github.com/franmomu)) +- [[#379](https://github.com/sonata-project/SonataDoctrineMongoDBAdminBundle/pull/379)] Added `ModelManager::getDefaultPerPageOptions()` ([@franmomu](https://github.com/franmomu)) +- [[#379](https://github.com/sonata-project/SonataDoctrineMongoDBAdminBundle/pull/379)] Added `FieldDescription::getTargetModel()` ([@franmomu](https://github.com/franmomu)) +- [[#378](https://github.com/sonata-project/SonataDoctrineMongoDBAdminBundle/pull/378)] Added `doctrine/collections` dependency ([@franmomu](https://github.com/franmomu)) +- [[#375](https://github.com/sonata-project/SonataDoctrineMongoDBAdminBundle/pull/375)] Added `sonata-project/form-extensions` dependency ([@franmomu](https://github.com/franmomu)) +- [[#346](https://github.com/sonata-project/SonataDoctrineMongoDBAdminBundle/pull/346)] "sonata.admin.manager" tag to "sonata.admin.manager.doctrine_mongodb" service ([@phansys](https://github.com/phansys)) + +### Changed +- [[#380](https://github.com/sonata-project/SonataDoctrineMongoDBAdminBundle/pull/380)] Changed `DatagridBuilder` constructor's first parameter typehint from `Symfony\Component\Form\FormFactory` to `Symfony\Component\Form\FormFactoryInterface` ([@franmomu](https://github.com/franmomu)) +- [[#373](https://github.com/sonata-project/SonataDoctrineMongoDBAdminBundle/pull/373)] Use `deprecated` tag instead of `sonata_template_deprecate` to not throw unwanted deprecation notices ([@franmomu](https://github.com/franmomu)) +- [[#373](https://github.com/sonata-project/SonataDoctrineMongoDBAdminBundle/pull/373)] Bump Twig to 2.6 ([@franmomu](https://github.com/franmomu)) +- [[#374](https://github.com/sonata-project/SonataDoctrineMongoDBAdminBundle/pull/374)] Bump Symfony to 4.4 ([@franmomu](https://github.com/franmomu)) + +### Deprecated +- [[#414](https://github.com/sonata-project/SonataDoctrineMongoDBAdminBundle/pull/414)] Deprecate creating `ObjectAclManipulator` without passing a `ManagerRegistry` object ([@franmomu](https://github.com/franmomu)) +- [[#415](https://github.com/sonata-project/SonataDoctrineMongoDBAdminBundle/pull/415)] Deprecate `ModelManager::getModelCollectionInstance()` ([@franmomu](https://github.com/franmomu)) +- [[#415](https://github.com/sonata-project/SonataDoctrineMongoDBAdminBundle/pull/415)] Deprecate `ModelManager::collectionClear()` ([@franmomu](https://github.com/franmomu)) +- [[#415](https://github.com/sonata-project/SonataDoctrineMongoDBAdminBundle/pull/415)] Deprecate `ModelManager::collectionHasElement()` ([@franmomu](https://github.com/franmomu)) +- [[#415](https://github.com/sonata-project/SonataDoctrineMongoDBAdminBundle/pull/415)] Deprecate `ModelManager::collectionAddElement()` ([@franmomu](https://github.com/franmomu)) +- [[#415](https://github.com/sonata-project/SonataDoctrineMongoDBAdminBundle/pull/415)] Deprecate `ModelManager::collectionRemoveElement()` ([@franmomu](https://github.com/franmomu)) +- [[#415](https://github.com/sonata-project/SonataDoctrineMongoDBAdminBundle/pull/415)] Deprecate `ModelManager::getPaginationParameters()` ([@franmomu](https://github.com/franmomu)) +- [[#415](https://github.com/sonata-project/SonataDoctrineMongoDBAdminBundle/pull/415)] Deprecate `ModelManager::getSortParameters()` ([@franmomu](https://github.com/franmomu)) +- [[#384](https://github.com/sonata-project/SonataDoctrineMongoDBAdminBundle/pull/384)] Deprecate `ModelManager::getParentFieldDescription()` ([@franmomu](https://github.com/franmomu)) +- [[#381](https://github.com/sonata-project/SonataDoctrineMongoDBAdminBundle/pull/381)] Deprecated passing arguments to`ProxyQuery::execute()` ([@franmomu](https://github.com/franmomu)) +- [[#368](https://github.com/sonata-project/SonataDoctrineMongoDBAdminBundle/pull/368)] Deprecated `AbstractDateFilter::typeRequiresValue` ([@franmomu](https://github.com/franmomu)) +- [[#368](https://github.com/sonata-project/SonataDoctrineMongoDBAdminBundle/pull/368)] Deprecated `ModelManager::camelize` ([@franmomu](https://github.com/franmomu)) +- [[#368](https://github.com/sonata-project/SonataDoctrineMongoDBAdminBundle/pull/368)] Deprecated constructing `ModelManager` without passing an instance of `PropertyAccessorInterface` as second argument ([@franmomu](https://github.com/franmomu)) +- [[#379](https://github.com/sonata-project/SonataDoctrineMongoDBAdminBundle/pull/379)] Deprecated `FieldDescription::getTargetEntity()` in favor of `FieldDescription::getTargetModel()` ([@franmomu](https://github.com/franmomu)) + +### Fixed +- [[#385](https://github.com/sonata-project/SonataDoctrineMongoDBAdminBundle/pull/385)] Fixed exception captured when creating `ObjectId` ([@franmomu](https://github.com/franmomu)) +- [[#377](https://github.com/sonata-project/SonataDoctrineMongoDBAdminBundle/pull/377)] Replace deprecated operator constants ([@franmomu](https://github.com/franmomu)) +- [[#372](https://github.com/sonata-project/SonataDoctrineMongoDBAdminBundle/pull/372)] Fixed passing `null` to `Doctrine\ODM\MongoDB\Query\Builder::skip` and `Doctrine\ODM\MongoDB\Query\Builder::limit` ([@franmomu](https://github.com/franmomu)) +- [[#359](https://github.com/sonata-project/SonataDoctrineMongoDBAdminBundle/pull/359)] Fixed returning `void` from methods which are intended to return values and returning values from methods which are intended to return `void`; ([@phansys](https://github.com/phansys)) +- [[#359](https://github.com/sonata-project/SonataDoctrineMongoDBAdminBundle/pull/359)] Fixed weak check at `ModelManager::getNormalizedIdentifier()` ([@phansys](https://github.com/phansys)) + +### Removed +- [[#358](https://github.com/sonata-project/SonataDoctrineMongoDBAdminBundle/pull/358)] Drop support of php 7.1 ([@VincentLanglet](https://github.com/VincentLanglet)) +- [[#424](https://github.com/sonata-project/SonataDoctrineMongoDBAdminBundle/pull/424)] Remove support for `doctrine/mongodb-odm` <2.0 ([@franmomu](https://github.com/franmomu)) +- [[#409](https://github.com/sonata-project/SonataDoctrineMongoDBAdminBundle/pull/409)] Removed deprecations coming from doctrine/common namespace ([@franmomu](https://github.com/franmomu)) +- [[#378](https://github.com/sonata-project/SonataDoctrineMongoDBAdminBundle/pull/378)] Removed `twig/extensions` dependency ([@franmomu](https://github.com/franmomu)) +- [[#378](https://github.com/sonata-project/SonataDoctrineMongoDBAdminBundle/pull/378)] Removed `jmikola/geojson` dependency ([@franmomu](https://github.com/franmomu)) +- [[#375](https://github.com/sonata-project/SonataDoctrineMongoDBAdminBundle/pull/375)] Removed SonataCoreBundle dependency ([@franmomu](https://github.com/franmomu)) + ## [3.3.0](https://github.com/sonata-project/SonataDoctrineMongoDBAdminBundle/compare/3.2.2...3.3.0) - 2020-01-08 ### Fixed - Fixed filtering by a field of an embedded object diff --git a/UPGRADE-3.x.md b/UPGRADE-3.x.md index 994f9961..c16d6ce2 100644 --- a/UPGRADE-3.x.md +++ b/UPGRADE-3.x.md @@ -4,6 +4,9 @@ UPGRADE 3.x UPGRADE FROM 3.x to 3.x ======================= +UPGRADE FROM 3.3 to 3.4 +======================= + ### Sonata\DoctrineMongoDBAdminBundle\Model\ModelManager - Deprecated `ModelManager::getModelCollectionInstance()`. diff --git a/src/Admin/FieldDescription.php b/src/Admin/FieldDescription.php index 5b669900..94dfca5e 100644 --- a/src/Admin/FieldDescription.php +++ b/src/Admin/FieldDescription.php @@ -38,12 +38,12 @@ public function setAssociationMapping($associationMapping) /** * NEXT_MAJOR: Remove this method. * - * @deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.x and will be removed in version 4.0. Use FieldDescription::getTargetModel() instead. + * @deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.4 and will be removed in version 4.0. Use FieldDescription::getTargetModel() instead. */ public function getTargetEntity() { @trigger_error(sprintf( - 'Method %s() is deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.x and will be removed in version 4.0.' + 'Method %s() is deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.4 and will be removed in version 4.0.' .' Use %s::getTargetModel() instead.', __METHOD__, __CLASS__ @@ -53,7 +53,7 @@ public function getTargetEntity() } /** - * @final since sonata-project/doctrine-mongodb-admin-bundle 3.x. + * @final since sonata-project/doctrine-mongodb-admin-bundle 3.4. */ public function getTargetModel(): ?string { diff --git a/src/Datagrid/ProxyQuery.php b/src/Datagrid/ProxyQuery.php index 857b3fb6..0fd2a566 100644 --- a/src/Datagrid/ProxyQuery.php +++ b/src/Datagrid/ProxyQuery.php @@ -67,7 +67,7 @@ public function execute(array $params = [], $hydrationMode = null) // NEXT_MAJOR : remove the `trigger_error()` call and uncomment the exception @trigger_error(sprintf( 'Passing a value different than an empty array as argument 1 or "null" as argument 2 for "%s()" is' - .' deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.x and will throw an exception' + .' deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.4 and will throw an exception' .' in 4.0. The values provided in this array are not used.', __METHOD__ ), E_USER_DEPRECATED); diff --git a/src/Filter/AbstractDateFilter.php b/src/Filter/AbstractDateFilter.php index 50c2e13d..a90e55b7 100644 --- a/src/Filter/AbstractDateFilter.php +++ b/src/Filter/AbstractDateFilter.php @@ -139,14 +139,14 @@ protected function applyType(ProxyQueryInterface $queryBuilder, $operation, $fie * * @param int $type * - * @deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.x, to be removed in 4.0.'. + * @deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.4, to be removed in 4.0.'. * * @return bool */ protected function typeRequiresValue($type) { @trigger_error(sprintf( - '"%s()" is deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.x and will be removed in version 4.0.', + '"%s()" is deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.4 and will be removed in version 4.0.', __METHOD__ ), E_USER_DEPRECATED); diff --git a/src/Guesser/FilterTypeGuesser.php b/src/Guesser/FilterTypeGuesser.php index 6473208c..208d5937 100644 --- a/src/Guesser/FilterTypeGuesser.php +++ b/src/Guesser/FilterTypeGuesser.php @@ -87,7 +87,7 @@ public function guessType($class, $property, ModelManagerInterface $modelManager return new TypeGuess(BooleanFilter::class, $options, Guess::HIGH_CONFIDENCE); case 'datetime': @trigger_error( - 'The datetime type is deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.x, to be removed in 4.0.'. + 'The datetime type is deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.4, to be removed in 4.0.'. E_USER_DEPRECATED ); @@ -106,7 +106,7 @@ public function guessType($class, $property, ModelManagerInterface $modelManager return new TypeGuess(DateFilter::class, $options, Guess::HIGH_CONFIDENCE); case 'decimal': @trigger_error( - 'The decimal type is deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.x, to be removed in 4.0.'. + 'The decimal type is deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.4, to be removed in 4.0.'. E_USER_DEPRECATED ); @@ -115,7 +115,7 @@ public function guessType($class, $property, ModelManagerInterface $modelManager return new TypeGuess(NumberFilter::class, $options, Guess::MEDIUM_CONFIDENCE); case 'bigint': @trigger_error( - 'The bigint type is deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.x, to be removed in 4.0.'. + 'The bigint type is deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.4, to be removed in 4.0.'. E_USER_DEPRECATED ); @@ -124,7 +124,7 @@ public function guessType($class, $property, ModelManagerInterface $modelManager return new TypeGuess(NumberFilter::class, $options, Guess::MEDIUM_CONFIDENCE); case 'smallint': @trigger_error( - 'The smallint type is deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.x, to be removed in 4.0.'. + 'The smallint type is deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.4, to be removed in 4.0.'. E_USER_DEPRECATED ); @@ -139,7 +139,7 @@ public function guessType($class, $property, ModelManagerInterface $modelManager return new TypeGuess(NumberFilter::class, $options, Guess::MEDIUM_CONFIDENCE); case 'text': @trigger_error( - 'The text type is deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.x, to be removed in 4.0.'. + 'The text type is deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.4, to be removed in 4.0.'. E_USER_DEPRECATED ); diff --git a/src/Guesser/TypeGuesser.php b/src/Guesser/TypeGuesser.php index a1a5e91d..99a846c1 100755 --- a/src/Guesser/TypeGuesser.php +++ b/src/Guesser/TypeGuesser.php @@ -47,7 +47,7 @@ public function guessType($class, $property, ModelManagerInterface $modelManager return new TypeGuess('array', [], Guess::HIGH_CONFIDENCE); case 'array': @trigger_error( - 'The array type is deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.x, to be removed in 4.0.'. + 'The array type is deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.4, to be removed in 4.0.'. E_USER_DEPRECATED ); @@ -57,21 +57,21 @@ public function guessType($class, $property, ModelManagerInterface $modelManager return new TypeGuess('boolean', [], Guess::HIGH_CONFIDENCE); case 'datetime': @trigger_error( - 'The datetime type is deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.x, to be removed in 4.0.'. + 'The datetime type is deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.4, to be removed in 4.0.'. E_USER_DEPRECATED ); return new TypeGuess('datetime', [], Guess::HIGH_CONFIDENCE); case 'vardatetime': @trigger_error( - 'The vardatetime type is deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.x, to be removed in 4.0.'. + 'The vardatetime type is deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.4, to be removed in 4.0.'. E_USER_DEPRECATED ); return new TypeGuess('datetime', [], Guess::HIGH_CONFIDENCE); case 'datetimetz': @trigger_error( - 'The datetimetz type is deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.x, to be removed in 4.0.'. + 'The datetimetz type is deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.4, to be removed in 4.0.'. E_USER_DEPRECATED ); @@ -83,7 +83,7 @@ public function guessType($class, $property, ModelManagerInterface $modelManager return new TypeGuess('date', [], Guess::HIGH_CONFIDENCE); case 'decimal': @trigger_error( - 'The decimal type is deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.x, to be removed in 4.0.'. + 'The decimal type is deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.4, to be removed in 4.0.'. E_USER_DEPRECATED ); @@ -95,14 +95,14 @@ public function guessType($class, $property, ModelManagerInterface $modelManager return new TypeGuess('integer', [], Guess::MEDIUM_CONFIDENCE); case 'bigint': @trigger_error( - 'The bigint type is deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.x, to be removed in 4.0.'. + 'The bigint type is deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.4, to be removed in 4.0.'. E_USER_DEPRECATED ); return new TypeGuess('integer', [], Guess::MEDIUM_CONFIDENCE); case 'smallint': @trigger_error( - 'The smallint type is deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.x, to be removed in 4.0.'. + 'The smallint type is deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.4, to be removed in 4.0.'. E_USER_DEPRECATED ); @@ -111,14 +111,14 @@ public function guessType($class, $property, ModelManagerInterface $modelManager return new TypeGuess('text', [], Guess::MEDIUM_CONFIDENCE); case 'text': @trigger_error( - 'The text type is deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.x, to be removed in 4.0.'. + 'The text type is deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.4, to be removed in 4.0.'. E_USER_DEPRECATED ); return new TypeGuess('textarea', [], Guess::MEDIUM_CONFIDENCE); case 'time': @trigger_error( - 'The time type is deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.x, to be removed in 4.0.'. + 'The time type is deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.4, to be removed in 4.0.'. E_USER_DEPRECATED ); diff --git a/src/Model/ModelManager.php b/src/Model/ModelManager.php index e677c840..4e545c7b 100755 --- a/src/Model/ModelManager.php +++ b/src/Model/ModelManager.php @@ -54,7 +54,7 @@ public function __construct(ManagerRegistry $registry, ?PropertyAccessorInterfac if (!$propertyAccessor instanceof PropertyAccessorInterface) { @trigger_error(sprintf( 'Not passing an object implementing "%s" as argument 2 for "%s()" is deprecated since' - .' sonata-project/doctrine-mongodb-admin-bundle 3.x and will throw a %s error in 4.0.', + .' sonata-project/doctrine-mongodb-admin-bundle 3.4 and will throw a %s error in 4.0.', PropertyAccessorInterface::class, __METHOD__, \TypeError::class @@ -214,12 +214,12 @@ public function getDocumentManager($class) /** * NEXT_MAJOR: Remove this method. * - * @deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.x and will be removed in version 4.0 + * @deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.4 and will be removed in version 4.0 */ public function getParentFieldDescription($parentAssociationMapping, $class) { @trigger_error(sprintf( - 'Method "%s()" is deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.x' + 'Method "%s()" is deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.4' .' and will be removed in 4.0', __METHOD__ ), E_USER_DEPRECATED); @@ -363,12 +363,12 @@ public function getModelInstance($class) /** * NEXT_MAJOR: Remove this method. * - * @deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.x and will be removed in version 4.0. + * @deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.4 and will be removed in version 4.0. */ public function getSortParameters(FieldDescriptionInterface $fieldDescription, DatagridInterface $datagrid) { @trigger_error(sprintf( - 'Method %s() is deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.x and will be removed in version 4.0.', + 'Method %s() is deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.4 and will be removed in version 4.0.', __METHOD__ ), E_USER_DEPRECATED); @@ -392,12 +392,12 @@ public function getSortParameters(FieldDescriptionInterface $fieldDescription, D /** * NEXT_MAJOR: Remove this method. * - * @deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.x and will be removed in version 4.0. + * @deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.4 and will be removed in version 4.0. */ public function getPaginationParameters(DatagridInterface $datagrid, $page) { @trigger_error(sprintf( - 'Method %s() is deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.x and will be removed in version 4.0.', + 'Method %s() is deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.4 and will be removed in version 4.0.', __METHOD__ ), E_USER_DEPRECATED); @@ -448,12 +448,12 @@ public function modelReverseTransform($class, array $array = []) /** * NEXT_MAJOR: Remove this method. * - * @deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.x and will be removed in version 4.0. + * @deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.4 and will be removed in version 4.0. */ public function getModelCollectionInstance($class) { @trigger_error(sprintf( - 'Method %s() is deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.x and will be removed in version 4.0.', + 'Method %s() is deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.4 and will be removed in version 4.0.', __METHOD__ ), E_USER_DEPRECATED); @@ -463,12 +463,12 @@ public function getModelCollectionInstance($class) /** * NEXT_MAJOR: Remove this method. * - * @deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.x and will be removed in version 4.0. + * @deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.4 and will be removed in version 4.0. */ public function collectionClear(&$collection) { @trigger_error(sprintf( - 'Method %s() is deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.x and will be removed in version 4.0.', + 'Method %s() is deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.4 and will be removed in version 4.0.', __METHOD__ ), E_USER_DEPRECATED); @@ -478,12 +478,12 @@ public function collectionClear(&$collection) /** * NEXT_MAJOR: Remove this method. * - * @deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.x and will be removed in version 4.0. + * @deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.4 and will be removed in version 4.0. */ public function collectionHasElement(&$collection, &$element) { @trigger_error(sprintf( - 'Method %s() is deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.x and will be removed in version 4.0.', + 'Method %s() is deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.4 and will be removed in version 4.0.', __METHOD__ ), E_USER_DEPRECATED); @@ -493,12 +493,12 @@ public function collectionHasElement(&$collection, &$element) /** * NEXT_MAJOR: Remove this method. * - * @deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.x and will be removed in version 4.0. + * @deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.4 and will be removed in version 4.0. */ public function collectionAddElement(&$collection, &$element) { @trigger_error(sprintf( - 'Method %s() is deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.x and will be removed in version 4.0.', + 'Method %s() is deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.4 and will be removed in version 4.0.', __METHOD__ ), E_USER_DEPRECATED); @@ -508,12 +508,12 @@ public function collectionAddElement(&$collection, &$element) /** * NEXT_MAJOR: Remove this method. * - * @deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.x and will be removed in version 4.0. + * @deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.4 and will be removed in version 4.0. */ public function collectionRemoveElement(&$collection, &$element) { @trigger_error(sprintf( - 'Method %s() is deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.x and will be removed in version 4.0.', + 'Method %s() is deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.4 and will be removed in version 4.0.', __METHOD__ ), E_USER_DEPRECATED); @@ -523,7 +523,7 @@ public function collectionRemoveElement(&$collection, &$element) /** * NEXT_MAJOR: Remove this method. * - * @deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.x, to be removed in 4.0.'. + * @deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.4, to be removed in 4.0.'. * * @param string $property * @@ -532,7 +532,7 @@ public function collectionRemoveElement(&$collection, &$element) protected function camelize($property) { @trigger_error(sprintf( - 'Method "%s()" is deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.x and will be removed in version 4.0.', + 'Method "%s()" is deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.4 and will be removed in version 4.0.', __METHOD__ ), E_USER_DEPRECATED); diff --git a/src/Resources/config/doctrine_mongodb.php b/src/Resources/config/doctrine_mongodb.php index c411c408..9c08485f 100644 --- a/src/Resources/config/doctrine_mongodb.php +++ b/src/Resources/config/doctrine_mongodb.php @@ -49,7 +49,7 @@ ->tag('sonata.admin.guesser.doctrine_mongodb_list') ->set('sonata.admin.guesser.doctrine_mongodb_list_filter', FilterTypeGuesser::class) - ->deprecate('The "%service_id%" service is deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.x and will be removed in 4.0. Use "sonata.admin.guesser.doctrine_mongodb_datagrid" service instead.') + ->deprecate('The "%service_id%" service is deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.4 and will be removed in 4.0. Use "sonata.admin.guesser.doctrine_mongodb_datagrid" service instead.') ->set('sonata.admin.guesser.doctrine_mongodb_list_chain', TypeGuesserChain::class) ->args([ diff --git a/src/Util/ObjectAclManipulator.php b/src/Util/ObjectAclManipulator.php index 3c6cddd8..536753f3 100644 --- a/src/Util/ObjectAclManipulator.php +++ b/src/Util/ObjectAclManipulator.php @@ -37,7 +37,7 @@ public function __construct(?ManagerRegistry $registry = null) if (null === $registry) { @trigger_error(sprintf( 'Not passing a "%s" instance as argument 1 for "%s()" is deprecated since' - .' sonata-project/doctrine-mongodb-admin-bundle 3.x and will throw a %s error in 4.0.', + .' sonata-project/doctrine-mongodb-admin-bundle 3.4 and will throw a %s error in 4.0.', ManagerRegistry::class, __METHOD__, \TypeError::class diff --git a/tests/Model/ModelManagerTest.php b/tests/Model/ModelManagerTest.php index 3369dddd..d9372ad8 100644 --- a/tests/Model/ModelManagerTest.php +++ b/tests/Model/ModelManagerTest.php @@ -132,7 +132,7 @@ public function testSortParameters(): void '_sort_order' => 'ASC', ]); - $this->expectDeprecation('Method Sonata\DoctrineMongoDBAdminBundle\Model\ModelManager::getSortParameters() is deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.x and will be removed in version 4.0.'); + $this->expectDeprecation('Method Sonata\DoctrineMongoDBAdminBundle\Model\ModelManager::getSortParameters() is deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.4 and will be removed in version 4.0.'); $parameters = $manager->getSortParameters($field1, $datagrid1); $this->assertSame('DESC', $parameters['filter']['_sort_order']); @@ -261,7 +261,7 @@ public function testCollections(): void { $model = new ModelManager($this->registry, $this->propertyAccessor); - $this->expectDeprecation('Method Sonata\DoctrineMongoDBAdminBundle\Model\ModelManager::getModelCollectionInstance() is deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.x and will be removed in version 4.0.'); + $this->expectDeprecation('Method Sonata\DoctrineMongoDBAdminBundle\Model\ModelManager::getModelCollectionInstance() is deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.4 and will be removed in version 4.0.'); $collection = $model->getModelCollectionInstance('whyDoWeEvenHaveThisParameter'); $this->assertInstanceOf(ArrayCollection::class, $collection); @@ -311,7 +311,7 @@ public function testGetPaginationParameters(): void $model = new ModelManager($this->registry, $this->propertyAccessor); - $this->expectDeprecation('Method Sonata\DoctrineMongoDBAdminBundle\Model\ModelManager::getPaginationParameters() is deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.x and will be removed in version 4.0.'); + $this->expectDeprecation('Method Sonata\DoctrineMongoDBAdminBundle\Model\ModelManager::getPaginationParameters() is deprecated since sonata-project/doctrine-mongodb-admin-bundle 3.4 and will be removed in version 4.0.'); $result = $model->getPaginationParameters($datagrid, $page = 5); $this->assertSame($page, $result['filter']['_page']);