Composer updates woocommerce to a version outside of specified version condition

My site/composer.json contains the following line to install Woocommerce plugin:

"wpackagist-plugin/woocommerce": "^3.4.2"

I have just tried updating all composer packages with “composer update” command and it updated woocommerce to 3.5.1. Is this the correct behaviour? I was expecting that it would update to a version within 3.4 and not jump to 3.5 …

Any comments welcome.

Just for reference: Major.Minor.Patch (Semantic Versioning)

^ is for everything greater within the same major version. So Composer working as expected in your case.

What you want to use is ~ which does the same but within the same minor version.

Play around with this to get an idea of what the different constraints do:

1 Like

Awesome! thanks for a quick answer and the resource.

1 Like