Question:
How to resolve the Composer dependencies conflicts (symfony)?

Since the composer.json contains every dependency (this is a good practice) but not symfony/symfony, this command fails because symfony/symfony will replace all the dependencies.


Composer require symfony/symfony:^6.3

Since the composer.json contains every dependency (this is a good practice) but not symfony/symfony, this command fails because symfony/symfony will replace all the dependencies.


Instead, we can:

  • upgrade every Symfony dependency to 6.3

  • upgrade symfony/dotenv to 6.3 

  • upgrade symfony/runtime to 6.3 

  • keep the current versions for the Symfony packages that aren't components: symfony/deprecation-contracts, symfony/flex, etc.


composer install works with these dependencies:

{

    "name": "projet/projet",

    "license": "proprietary",

    "type": "project",

    "version": "2.46.3",

    "autoload": {

        "psr-4": {

            "App\\": "src/"

        }

    },

    "autoload-dev": {

        "psr-4": {

            "App\\Tests\\": "tests/"

        },

        "files": [

            "vendor/symfony/var-dumper/Resources/functions/dump.php"

        ]

    },

    "require": {

        "php": "^8.2",

        "beberlei/doctrineextensions": "^1.3",

        "christian-riesen/otp": "^2.0",

        "doctrine/doctrine-bundle": "^2.8",

        "doctrine/orm": "^2.5",

        "friendsofsymfony/rest-bundle": "^3.5",

        "friendsofsymfony/user-bundle": "^3.1.0",

        "incenteev/composer-parameter-handler": "^2.1.5",

        "jms/serializer-bundle": "^5.3",

        "lesstif/php-jira-rest-client": "^2.0",

        "lexik/jwt-authentication-bundle": "^2.19",

        "psr/cache": "3.0",

        "psr/log": "^1.1.4",

        "sensio/framework-extra-bundle": "^6.2.0",

        "symfony/asset": "^6.3",

        "symfony/cache": "6.3.*",

        "symfony/config": "6.3.*",

        "symfony/console": "6.3.*",

        "symfony/dependency-injection": "^6.3",

        "symfony/deprecation-contracts": "^2.5",

        "symfony/dotenv": "^6.3",

        "symfony/flex": "^1.17",

        "symfony/mime": "^6.0",

        "symfony/monolog-bundle": "^3.8.0",

        "symfony/polyfill-apcu": "^1.0",

        "symfony/runtime": "5.4.*",

        "twig/twig": "^2.14"

    },

    "conflict": {

        "symfony/symfony": "*"

    },

    "require-dev": {

        "symfony/maker-bundle": "^1.48.0",

        "symfony/phpunit-bridge": "^5.3",

        "symfony/stopwatch": "5.4.0",

        "symfony/twig-bundle": "^6.0",

        "symfony/web-profiler-bundle": "6.3.*"

    },

    "scripts": {

        "auto-scripts": [

        ],

        "post-install-cmd": [

            "@auto-scripts"

        ],

        "post-update-cmd": [

            "@auto-scripts"

        ]

    },

    "config": {

        "sort-packages": true,

        "allow-plugins": {

            "symfony/flex": true,

            "symfony/runtime": true

        }

    },

    "extra": {

        "symfony-app-dir": "app",

        "symfony-bin-dir": "bin",

        "symfony-var-dir": "var",

        "symfony-web-dir": "web",

        "symfony-tests-dir": "tests",

        "symfony-assets-install": "relative",

        "branch-alias": null,

        "symfony": {

            "allow-contrib": false,

            "require": "6.3.*"

        }

    }

}

Answered by:> A.L

Credit:> StackOverflow


Blog Links:

>Python Import Error Solved: Cannot Import Name X

>Python: Export "fat" Cocoa Touch Framework (for Device and Simulator)

>What are common syntax errors and exceptions in Python

>How to compile and install Python version 3.11.2?


Nisha Patel

Nisha Patel

Submit
0 Answers