Comparing to other package managers like npm
, I find that composer
has a strange behaviour when updating packages related to a given project.
According also to the documentation, update
and upgrade
options
Upgrades your dependencies to the latest version according to composer.json, and updates the composer.lock file.
And indeed, composer.lock
is correctly updated with new packages version numbers. But composer.json
instead is not modified, and lists packages with their old, outdated version numbers.
Why does this happen? Am I doing something wrong, or this is indeed how this is supposed to work? And if this is the case, what is the reasoning behind having one of thw two files up-to-date while the other is not?