# Enforce PHP version for installed packages

# Manually change composer.json file

...
"config": {
        "platform": {
            "php": "7.2"
        }
    },
...

# Run composer command

composer config platform.php 7.2

Which will add the config and platform key, with the provided php version same as in [manually](### Manually change composer.json file) snippet

Note: Don't forget to run composer update after that to update composer.lock file with changes.