doctrineum / strict-string
This package is abandoned and no longer maintained.
The author suggests using the doctrineum/scalar package instead.
Enumeration type for Doctrine - strings only
2.1.1
2015-08-04 15:18 UTC
Requires
- php: >=5.5
- doctrineum/scalar: ~2.0
- granam/string: ~1.0
Requires (Dev)
- mockery/mockery: 0.9.*
- phpunit/phpunit: ~4.4
README
About
Doctrine enum allowing strings only.
Example
$stringEnum = StrictStringEnum::getEnum('foo bar'); $stringEnum = StrictStringEnum::getEnum('12345'); // throws an exception - only string is allowed $stringEnum = StrictStringEnum::getEnum(''); // throws an exception - only string is allowed StrictStringEnum::getEnum(12); // throws an exception - only string is allowed StrictStringEnum::getEnum(false); // throws an exception - only string is allowed StrictStringEnum::getEnum(null); // throws an exception - only string is allowed StrictStringEnum::getEnum(new ObjectWithToStringMethod('foo'));
Doctrine integration
For details about new Doctrine type registration, see the parent project Doctrineum.