1
0
Fork 0
mirror of https://github.com/archtechx/enums.git synced 2025-12-12 17:14:04 +00:00
Commit graph

3 commits

Author SHA1 Message Date
Márk Magyar
df3681965c
General code cleanup (#28)
* Add .idea folder to .gitignore

* Remove useless concatenation

* Add phpunit cache directory to .gitignore

* Use iterable type instead of unnecessary checks

* Remove unnecessary null coalescing

If the return value is `null`, it will return `null` anyway. If the method doesn't exist, it will throw an `Error` because of the undefined method.

* Add typehint

* Merge meta properties in one go instead of in a loop

* Simplify control flow

* Use non-deprecated phpstan configuration value

* Add missing types

* Fix style with php-cs-fixer

* Add tests that satisfy the ArrayIterator branch

* Use is() for comparison in in()

* from(int|string), tryFrom(int|string)

---------

Co-authored-by: Samuel Štancl <samuel@archte.ch>
2025-06-07 01:11:53 +02:00
Samuel Levy
0c87357a6e
Extend functionality to work with pure enums (#6)
* Extend functionality to work with pure enums

* Code review changes

Altered `::values()` to act like `::names()` for backed enums, code style fixes, general cleanups
2022-03-23 21:42:35 +01:00
Samuel Štancl
b50d001374 add names() and values() methods, resolve #1 2022-02-20 21:53:21 +01:00