consolidation / robo

Modern task runner for PHP
http://robo.li
Other
2.66k stars 305 forks source link

CSS minifier upgrade #1114

Open banago opened 2 years ago

banago commented 2 years ago

I'm using robo css to minify CSS on my workflow.

Up to PHP 7.4 it works fine, but spits this warning:

ERROR: The each() function is deprecated. This message will be suppressed on further calls 
in phar:///usr/local/bin/robo/vendor/natxet/cssmin/src/CssMin.php:2222

On PHP 8.0 and up, it fails as each() function is removed altogether from the language:

ERROR: Uncaught Error: Call to undefined function each() 
in phar:///usr/local/bin/robo/vendor/natxet/cssmin/src/CssMin.php:2222

Basically, the CSS library natxet/CssMin needs to be upgraded.

What's the best way to achieve this? I'm up to put some work on this is necessary.

greg-1-anderson commented 2 years ago

A PR would be welcome. Check to see if there is a newer version of the library that supports PHP 8. It could be as easy as adjusting the version constraint in Robo's composer.json and running composer update. Some code changes in Robo might be necessary after the upgrade, if APIs changed at all.