eloquent / enumeration

An enumeration implementation for PHP.
MIT License
147 stars 8 forks source link

Support PHP 8.x #30

Open shin1x1 opened 1 year ago

shin1x1 commented 1 year ago

I would like to use the eloquent/enumeration package with PHP 8.1 and PHP 8.2.

Currently, the CI in this repository only runs tests up to PHP 7.4, so I have added the ability to run tests in a PHP 8.x environment.

In this pull request I have done the following

ezzatron commented 1 year ago

Thanks for the PR.

I would highly suggest using the new built-in enumerations if you're targeting PHP 8.1/8.2. As far as I can tell they cover pretty much everything this library does. Especially since, when PHP 8.0 goes out of support, I plan to deprecate this library.

https://www.php.net/manual/en/language.enumerations.overview.php

shin1x1 commented 1 year ago

@ezzatron Thanks for the reply.

You are right, if you are using PHP 8.1 or later, it would be better to use the built-in enum. However, I have several applications that already use this library. It would be a big hassle to rewrite their code to use the native enum (because it works well!).

This library seems to work well with PHP 8.1 and 8.2, so I hope to be able to show that it works with CI as is.

shin1x1 commented 1 year ago

Hi, @ezzatron,

Is there anything I can do to help you merge this pull request?

ezzatron commented 1 year ago

@shin1x1 There's a couple of reasons I haven't merged.

Firstly, all my open source time is currently occupied trying to get https://github.com/eloquent/phony ready for PHP 8/8.1/8.2. It's broken at the moment and people are unable to continue working with it until it's fixed. That takes precedence over this, because as far as I can tell, Enumeration is already working fine under PHP 8+.

Secondly, I already have established ways of setting up GitHub Actions, Composer etc. that I use in my other projects. It's generally something I like to curate carefully myself, and having one project set up in a unique way makes maintenance more of a pain.

In any case, I'll try to get around to looking at the CI setup here as soon as Phony gets a new release. If there's something specific in Enumeration that's not working under PHP 8+, please let me know.