Downgrade composer from 2.x to 1.x via brew

You just upgraded your brew packages and composer updated itself to version 2.x but you still need version 1.x? This is how you can downgrade (& upgrade again):

Show available versions of composer:

brew log composer

Let’s downgrade

composer self-update 1.10.15

To switch back to the 2.x version use

composer self-update --rollback