Cannot update to PHP 7.3 due to friendsofphp/php-cs-fixer requirements

I recently ran into this issue myself. Here’s what I learned…

  • friendsofphp/php-cs-fixer is a package used for development, so is not necessary required in a production environment.
  • For whatever reason, Magento might not have updated your composer.json file with the appropriate version changes in previous updates.
  • You cannot simply update this to the latest version as other dependency modules will then fail.

Having learned this, I came up with the following solution that appears to work in limited testing that I did.

So, in the latest GitHub Repo (2.3.6), the composer.json file contains the correct "require-dev" modules and version numbers. So, go ahead and copy/replace that block with whatever you have in your own "require-dev" block in your composer.json file.

Extract taken from Magento 2.3.6 GitHub Repo.

    "require-dev": {
        "allure-framework/allure-phpunit": "~1.2.0",
        "dealerdirect/phpcodesniffer-composer-installer": "^0.5.0",
        "friendsofphp/php-cs-fixer": "~2.14.0",
        "lusitanian/oauth": "~0.8.10",
        "magento/magento-coding-standard": "*",
        "magento/magento2-functional-testing-framework": "~2.6.5",
        "pdepend/pdepend": "2.5.2",
        "phpcompatibility/php-compatibility": "^9.3",
        "phpmd/phpmd": "@stable",
        "phpstan/phpstan": "^0.12.2",
        "phpunit/phpunit": "~6.5.0",
        "sebastian/phpcpd": "~3.0.0",
        "squizlabs/php_codesniffer": "~3.4.0"
    },