doctrineum / strict-string
Enumeration type for Doctrine - strings only
Installs: 494
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
pkg:composer/doctrineum/strict-string
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.