December 17, 2014 Javier Eguiluz

Setting up Composer package versions for complex projects is not an easy task. For starters, there are a lot of different ways to define package versions. Then, you must check that declared package versions really work when installing or updating the project, specially for the minimal versions configured.

In order to improve testing the minimal versions of Symfony Components requirements, Composer now includes two new options:

--prefer-lowest : installs the lowest version possible for all dependencies.

: installs the lowest version possible for all dependencies. --prefer-stable : prefers to install stable versions of dependencies, which means that, when combined with the previous one, using ~2.4 version would get 2.4.0-stable over 2.4.0-alpha1 .

Thanks to these two new options, it's really easy to check whether your project really works for the minimal package versions declared by it:

1 $ composer update --prefer-lowest --prefer-stable

In Symfony project, checking that minimal versions are correct it's important to ensure backward compatibility for Symfony 2.3 version (which is a long term support version that is very popular to create new Symfony projects) and to ensure forward compatibility with Symfony 3 (which will use some 2.x components).

That's why during the last weeks we've been working hard on fixing all the package version requirements for all components and all Symfony branches. Check out the changes introduced in 2.3 branch, in 2.5 branch and in 2.6 branch (which have been also applied to 2.7 and master branches).

Fixing package versions for private projects and applications it's not worth it, but if you manage any open source project, you should probably fix its package versions. In order to do it, you'll have to follow a trial and error methodology, because this process cannot be easily automated: