--
You received this message because you are subscribed to the Google Groups "PHP Framework Interoperability Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to php-fig+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/php-fig/9fa79e25-5755-4f3f-9be9-3acc2ee67c6a%40www.fastmail.com.
--
You received this message because you are subscribed to the Google Groups "PHP Framework Interoperability Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to php-fig+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/php-fig/b78ce3af-6a01-43fe-93af-83900665358b%40www.fastmail.com.
I echo Jordi's thoughts and think doing enums once for easy, common and uncontroversial enum sets makes sense but would steer away from anything that could be hard to define a finite set for. We would also need to consider a policy for changes to the set I think (is adding new element considered a BC break, do we want to support doing so but only in major versions [semver] etc.).
Personally I'd lean towards having a separate package just for enums, but perhaps bundling all the FIG enums into that one package. I don't think bringing along PSR-7 is really necessary and can imagine plenty of people and ecosystems that don't use PSR-7 using this enum set.One thing I would note - this is probably relatively time-sensitive, in that we probably want to get something out before there are already 14 competing standards for us to add a 15th.Many thanks,MichaelOn Mon, 24 May 2021, 18:06 Larry Garfield, <la...@garfieldtech.com> wrote:On Mon, May 24, 2021, at 10:57 AM, Matthew Weier O'Phinney wrote:
> You're aware we have constants defined already in the
> fig/http-message-util library, right? Couldn't we just add an enum
> later, once 8.1 is ready?
>
> (I'd argue that, in general, the *-util packages are a good place for these.)
I am unsurprised to learn it. :-)
For HTTP-related enums, that may be a good place to put it. However, making them their own package may be helpful for those not already using PSR-7. (Or, maybe we do want to put it in that package to encourage people to use PSR-7? Interesting question.) The current PSRs (naturally) don't use any enums themselves, either.
There's likely other enums that it makes sense to have a single definition of, but don't fit neatly into a single existing PSR/util package.
--
Larry Garfield
la...@garfieldtech.com
Greetings, FIGlets. (What does one call a FIG-involved person, anyway? FIGlet? FIGment?)
As you may be aware, PHP 8.1 is going to include support for Enumerations.
https://wiki.php.net/rfc/enumerations
I believe it would be beneficial for some common industrial enumerated types to have a common library, rather than everyone making their own. The first examples that jump out at me are HTTP status codes and methods, which I have implemented here:
https://github.com/Crell/EnumTools
There are likely others, but I haven't come up with them yet. (Obviously this code won't run on any released PHP version yet, but I'm pretty sure the syntax is right...)
I am fine hosting these myself, but it occurs to me that they may be of more value if hosted by a more prominent organization, such as FIG. Of course, it's not really a spec; a PSR for these wouldn't make any sense. It's more akin to the Util libraries that we maintain for various PSRs, but without an associated PSR.
How do folks feel about FIG hosting such an enum collection? We could make it one package or several, depending on how we decide to break it up. If FIG is OK hosting it I am happy to dump the enums I already build into whatever package FIG wants to use for them.
Discuss.
--
Larry Garfield
la...@garfieldtech.com
--
You received this message because you are subscribed to the Google Groups "PHP Framework Interoperability Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to php-fig+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/php-fig/9fa79e25-5755-4f3f-9be9-3acc2ee67c6a%40www.fastmail.com.
On Mon, May 24, 2021, at 10:57 AM, Matthew Weier O'Phinney wrote:
> You're aware we have constants defined already in the
> fig/http-message-util library, right? Couldn't we just add an enum
> later, once 8.1 is ready?
>
> (I'd argue that, in general, the *-util packages are a good place for these.)
I am unsurprised to learn it. :-)
For HTTP-related enums, that may be a good place to put it. However, making them their own package may be helpful for those not already using PSR-7. (Or, maybe we do want to put it in that package to encourage people to use PSR-7? Interesting question.)
The current PSRs (naturally) don't use any enums themselves, either.
There's likely other enums that it makes sense to have a single definition of, but don't fit neatly into a single existing PSR/util package.
--
Larry Garfield
la...@garfieldtech.com
--
You received this message because you are subscribed to the Google Groups "PHP Framework Interoperability Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to php-fig+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/php-fig/b78ce3af-6a01-43fe-93af-83900665358b%40www.fastmail.com.
On Mon, May 24, 2021, at 10:57 AM, Matthew Weier O'Phinney wrote:
A http request method enum will not be complete for usage in all places because in fact a http method is just a string as I should be able to send BLABLABLA in my http client if I want to. Or receive it on my server. And because of that, they cannot be easily used as types in PSR-7, PSR-18. I think using string constants is fine here.Same thing for http response code; eventually Cloudflare will return a 524 timeout response code that is not included. Well, for this actually it can be defined as an integer between 100 and 599 but that's not practical.So only StatusCategory enum looks good from my point of view.
There's likely other enums that it makes sense to have a single definition of, but don't fit neatly into a single existing PSR/util package.
--
Larry Garfield
la...@garfieldtech.com
Regards,Alex
--
You received this message because you are subscribed to the Google Groups "PHP Framework Interoperability Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to php-fig+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/php-fig/CAAwdEzBQvW3SaJH8fvzjN5rsSuEB280e2iab_JEcJ-cbVoesJQ%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "PHP Framework Interoperability Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to php-fig+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/php-fig/b3c9d37d-f301-42fb-83b8-ca76d472e472n%40googlegroups.com.