Skip to content

Rely on default mapping type #1472

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 8, 2023
Merged

Conversation

franmomu
Copy link
Contributor

@franmomu franmomu commented Jan 8, 2023

@symfony-recipes-bot symfony-recipes-bot enabled auto-merge (squash) January 8, 2023 08:34
@github-actions
Copy link

github-actions bot commented Jan 8, 2023

Thanks for the PR 😍

How to test these changes in your application

  1. Define the SYMFONY_ENDPOINT environment variable:

    # On Unix-like (BSD, Linux and macOS)
    export SYMFONY_ENDPOINT=https://raw.githubusercontent.com/symfony/recipes-contrib/flex/pull-1472/index.json
    # On Windows
    SET SYMFONY_ENDPOINT=https://raw.githubusercontent.com/symfony/recipes-contrib/flex/pull-1472/index.json
  2. Install the package(s) related to this recipe:

    composer req 'symfony/flex:^1.16'
    composer req 'doctrine/mongodb-odm-bundle:^4.4'
  3. Don't forget to unset the SYMFONY_ENDPOINT environment variable when done:

    # On Unix-like (BSD, Linux and macOS)
    unset SYMFONY_ENDPOINT
    # On Windows
    SET SYMFONY_ENDPOINT=

Diff between recipe versions

In order to help with the review stage, I'm in charge of computing the diff between the various versions of patched recipes.
I'm going keep this comment up to date with any updates of the attached patch.

doctrine/mongodb-odm-bundle

3.3 vs 4.1
diff --git a/doctrine/mongodb-odm-bundle/3.3/config/packages/doctrine_mongodb.yaml b/doctrine/mongodb-odm-bundle/4.1/config/packages/doctrine_mongodb.yaml
index a9a22024..52103e7e 100644
--- a/doctrine/mongodb-odm-bundle/3.3/config/packages/doctrine_mongodb.yaml
+++ b/doctrine/mongodb-odm-bundle/4.1/config/packages/doctrine_mongodb.yaml
@@ -16,3 +16,27 @@ doctrine_mongodb:
                     dir: '%kernel.project_dir%/src/Document'
                     prefix: 'App\Document'
                     alias: App
+
+when@prod:
+    doctrine_mongodb:
+        auto_generate_proxy_classes: false
+        auto_generate_hydrator_classes: false
+        document_managers:
+            default:
+                metadata_cache_driver:
+                    type: service
+                    id: doctrine_mongodb.system_cache_provider
+
+    services:
+        doctrine_mongodb.system_cache_provider:
+            factory: ['Doctrine\Common\Cache\Psr6\DoctrineProvider', 'wrap']
+            class: 'Doctrine\Common\Cache\Psr6\DoctrineProvider'
+            public: false
+            arguments:
+                - '@doctrine_mongodb.system_cache_pool'
+
+    framework:
+        cache:
+            pools:
+                doctrine_mongodb.system_cache_pool:
+                    adapter: cache.system
diff --git a/doctrine/mongodb-odm-bundle/3.3/config/packages/prod/doctrine_mongodb.yaml b/doctrine/mongodb-odm-bundle/3.3/config/packages/prod/doctrine_mongodb.yaml
deleted file mode 100644
index 60f6b834..00000000
--- a/doctrine/mongodb-odm-bundle/3.3/config/packages/prod/doctrine_mongodb.yaml
+++ /dev/null
@@ -1,21 +0,0 @@
-doctrine_mongodb:
-    auto_generate_proxy_classes: false
-    auto_generate_hydrator_classes: false
-    document_managers:
-        default:
-            metadata_cache_driver:
-                type: service
-                id: doctrine_mongodb.system_cache_provider
-
-services:
-    doctrine_mongodb.system_cache_provider:
-        class: Symfony\Component\Cache\DoctrineProvider
-        public: false
-        arguments:
-            - '@doctrine_mongodb.system_cache_pool'
-
-framework:
-    cache:
-        pools:
-            doctrine_mongodb.system_cache_pool:
-                adapter: cache.system
diff --git a/doctrine/mongodb-odm-bundle/3.3/manifest.json b/doctrine/mongodb-odm-bundle/4.1/manifest.json
index 65b64f0b..56b37712 100644
--- a/doctrine/mongodb-odm-bundle/3.3/manifest.json
+++ b/doctrine/mongodb-odm-bundle/4.1/manifest.json
@@ -13,5 +13,9 @@
     "env": {
         "MONGODB_URL": "mongodb://localhost:27017",
         "MONGODB_DB": "symfony"
+    },
+    "conflict": {
+        "doctrine/cache": "<1.11",
+        "symfony/framework-bundle": "<5.3"
     }
 }
4.1 vs 4.4
diff --git a/doctrine/mongodb-odm-bundle/4.1/config/packages/doctrine_mongodb.yaml b/doctrine/mongodb-odm-bundle/4.4/config/packages/doctrine_mongodb.yaml
index 52103e7e..999eb958 100644
--- a/doctrine/mongodb-odm-bundle/4.1/config/packages/doctrine_mongodb.yaml
+++ b/doctrine/mongodb-odm-bundle/4.4/config/packages/doctrine_mongodb.yaml
@@ -12,7 +12,6 @@ doctrine_mongodb:
             mappings:
                 App:
                     is_bundle: false
-                    type: annotation
                     dir: '%kernel.project_dir%/src/Document'
                     prefix: 'App\Document'
                     alias: App
@@ -25,15 +24,7 @@ when@prod:
             default:
                 metadata_cache_driver:
                     type: service
-                    id: doctrine_mongodb.system_cache_provider
-
-    services:
-        doctrine_mongodb.system_cache_provider:
-            factory: ['Doctrine\Common\Cache\Psr6\DoctrineProvider', 'wrap']
-            class: 'Doctrine\Common\Cache\Psr6\DoctrineProvider'
-            public: false
-            arguments:
-                - '@doctrine_mongodb.system_cache_pool'
+                    id: doctrine_mongodb.system_cache_pool
 
     framework:
         cache:
diff --git a/doctrine/mongodb-odm-bundle/4.1/manifest.json b/doctrine/mongodb-odm-bundle/4.4/manifest.json
index 56b37712..65b64f0b 100644
--- a/doctrine/mongodb-odm-bundle/4.1/manifest.json
+++ b/doctrine/mongodb-odm-bundle/4.4/manifest.json
@@ -13,9 +13,5 @@
     "env": {
         "MONGODB_URL": "mongodb://localhost:27017",
         "MONGODB_DB": "symfony"
-    },
-    "conflict": {
-        "doctrine/cache": "<1.11",
-        "symfony/framework-bundle": "<5.3"
     }
 }

@symfony-recipes-bot symfony-recipes-bot merged commit f0c13b8 into symfony:main Jan 8, 2023
@franmomu franmomu deleted the patch-1 branch January 8, 2023 10:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants