See https://getcomposer.org/doc/01-basic-usage.md#next-significant-release-tilde-operator-.

`~2.1` is equivalent to `>=2.1,<3.0`.