Closed Ocramius closed 4 years ago
Succeeded: not sure why CI failed to report status.
https://travis-ci.org/github/marc-mabe/php-enum/builds/670092398
:heavy_check_mark: https://travis-ci.org/github/marc-mabe/php-enum/builds/670098448
Thanks @Ocramius, I highly appreciate your contribution :+1:
Awesome, thanks! \o/
Could you cut a minor with this one, when you got time?
Thanks!
Marco Pivetta
On Sun, Apr 5, 2020 at 12:44 PM Marc Bennewitz notifications@github.com wrote:
Merged #140 https://github.com/marc-mabe/php-enum/pull/140 into master.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/marc-mabe/php-enum/pull/140#event-3202110677, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABFVEAUP2UEARDOFSBEMF3RLBOHJANCNFSM4L2JRIPQ .
Hi @Ocramius, I have created an RC release now including generic types. Please check if everything works as expected.
Trying it out, thanks!
Tried on a downstream codebase that relies on vimeo/psalm
: seems to be all good, although I didn't add any specific types that rely on the new generics :-)
Thanks! I'll try that on two projects using PHPStan this week and if everything is fine I create a stable release.
This patch introduces a few improvements on the codebase:
vimeo/psalm
minimal tests (not testing sources, just declared API)@psalm-pure
and@psalm-immutable
to enumerable types, allowing usage ofEnum
in functionally pure (type-checked) contextsnon-empty-string
vsstring
, where applicable)psalm.xml
from exports)I kept very conservative on type definitions: I wanted to restrict also on
::has()
and::get()
, but that would introduce downstream issues, such as::has($unknown)
failing due to missing upfront assertions.Note: this is compatible with #138 too.