Download the PHP package phariscope/doctrineenumtype without Composer
On this page you can find all versions of the php package phariscope/doctrineenumtype. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download phariscope/doctrineenumtype
More information about phariscope/doctrineenumtype
Files in phariscope/doctrineenumtype
Package doctrineenumtype
Short Description A way to create quickly and well tested doctrine type for your php enums
License MIT
Homepage https://github.com/phariscope/DoctrineEnumType
Informations about the package doctrineenumtype
Phariscope DoctrineEnumType
To persist php enum fields with Doctrine, you have to create doctrine an enum type class for each enum.
To keep it easy and reduce the amount of tests use EnumType.
Installation
Usage
Create your enum object as usual. For example:
Create your doctrine enum type test. For example:
Your production code source will be very short and look like to this:
Now you can use this new 'ExampleType' with Doctrine ORM.
of course don't forget to declare this new type to doctrine (Type::addType("enum_example", ExampleType::class)
somewhere in your application).
To Contribute to phariscope/DoctrineEnumType
Requirements
- docker
- git
Install
Installation will load php docker image and composer install, so all commands contained in the 'bin' folder will be easily accessbile.
Example:
Unit test
Using Test-Driven Development (TDD) principles (thanks to Kent Beck and others), following good practices (thanks to Uncle Bob and others).
Quality
- phpcs PSR12
- phpstan level 9
- coverage 100%
- infection MSI >99%
Quick check with:
Check coverage with:
and view 'var/index.html' with your browser
Check infection with:
and view 'var/infection.html' with your browser