platformsh / legacy-cli

This is the legacy version of Platform.sh's command-line interface. The new version is at: https://github.com/platformsh/cli
https://docs.platform.sh/administration/cli.html
MIT License
224 stars 121 forks source link

Loosely validate profile sizes in resources:set command #1321

Closed pjcdawkins closed 10 months ago

pjcdawkins commented 10 months ago

Currently profile sizes must match exactly, with an exception of those prefixed by a dot ".5" being assumed as "0.5", etc.

This PR replaces this with PHP's loose comparison, which compares numeric strings like this as floats, meaning "4.0" matches "4" (and vice versa), ".5" still matches "0.5", and "4.0000000000000001" also matches "4" (and an empty string would match "0", not that there is a size zero).

It has a side effect of making the code look a bit (I believe) simpler.

image