robier / enum
PHP enums implementation
Installs: 7 844
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: ^8.1
Requires (Dev)
- infection/infection: ^0.26.21
- phpunit/phpunit: ^9
This package is auto-updated.
Last update: 2024-11-08 11:27:23 UTC
README
This is yet another enum implementation in PHP.
When we did not have enums in PHP this library was trying to fix that. Now we have enums with PHP version 8.1 so there is no need for "yet another enum implementation". This library was changed to add "missing" features to already existing enums.
Supported features:
When using "Boolean checks", you can easily create a doc blocks for magic functions so your IDE can be developer friendly.
$ vendor/bin/enum [FQN enum]
It will just generate all magic methods in stdout. It will not change actual files.
Development
This project is dockerized. Before running tests you need to build a docker container by using provided script from the docker folder.
$ docker/build
After the build is finished, you can run any command by using:
$ docker/run %command%
for example:
$ docker/run composer install
Additional tools for developing:
composer test
- runs all PHPUnit testsXDEBUG_MODE=coverage composer test:coverage:html
- runs all PHPUnit tests and generates HTML reportcomposer test:infestation
- runs mutation tests and generates mutation score
Feel free to contribute.