Sage is not compatible with PHP 7.3.
As seen here:
https://discourse.roots.io/t/error-on-installing-sage-with-composer-on-mac/14951
Expected behavior: the install works
Actual behavior: See error message
Reproduces how often: 100%
You can get this information from referencing CHANGELOG.md. Also, please include the OS and what version of the OS you're running.
Any additional information, configuration or data that might be necessary to reproduce the issue.
I'm unable to reproduce this with PHP 7.3.2 in WSL.
What version of WordPress are you installing? I haven't seen this error related to Sage, but I've encountered it with either WP core or a plugin; can't remember which.
Could you share the full output in case there's anything useful in it? Pretty sure there are no switch statements in Sage itself, which means it can't be the direct origin of this error.
You're getting this error because you're running an outdated version of Composer.
Source: https://github.com/composer/composer/issues/7783
Thanks, that was indeed the case, the fix was to install composer again https://getcomposer.org/download/ and then make the new working version available globally: sudo mv composer.phar /usr/local/bin/composer
In the future you could probably just do sudo composer self-update.
Most helpful comment
You're getting this error because you're running an outdated version of Composer.
Source: https://github.com/composer/composer/issues/7783