On 22/05/2021 02:51, Larry Garfield wrote:
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:
Definitely would be nice to allow type-hinting standard types in
libraries instead of having every lib shipping lib-specific types.
It would make typing a bit more portable if I can take a function from
one library returning an http status code and plug it into another lib
expecting a status code and type definitions would all uses
Psr\Enum\HttpStatus or something and it would all just work 👍🏻
The one problem is it risks becoming a catch-all mess of everyone's
dreams and wishes, so it's probably only suitable for lists of things
which are already standardized either by the FIG (like.. log levels
could be added as an enum directly in the psr/log package?) or by other
standard bodies (like your http examples).
Best,
Jordi
--
Jordi Boggiano
@seldaek - https://seld.be
--
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/php-fig/b55a92a4-1fbc-f2cf-0d82-4746c6360c76%40seld.be.