SplEnum is no longer maintained, but you can still use it via the polyfill: aldemeery/enum-polyfill.
No need to install the old PECL extension—just run:
composer require aldemeery/enum-polyfill
Your existing SplEnum code will work immediately.