Software Architect
Located in Paris / France
| WebSite | https://jeckel-lab.fr |
| https://www.linkedin.com/in/jeckel/ | |
| Github | https://github.com/jeckel |
| WebSite | https://jeckel-lab.fr |
| https://www.linkedin.com/in/jeckel/ | |
| Github | https://github.com/jeckel |
Just got a new toy, it's already Christmas !!
This is the first minitel launched in 1981.
I don't have time and place to try it yet, but soon...
Final got it, #php ValueObject for Locale, it's not an Enum, but it validates at least with locales available on the host.
<?php final readonly class Locale { public function __construct( public string $locale ) { static $locales = null; if ($locales === null) { $locales = ResourceBundle::getLocales(''); } if (!in_array($locale, $locales, true)) { throw new InvalidArgumentException("Invalid locale $locale provided"); } } }
Just updated my #DDD Identity implementation package for #php 8.2
- Identities are now readonly
- prevent cloning
- unicity check (retrieving twice same Id return same instance)
Give it a try and send me your feedback : https://packagist.org/packages/jeckel-lab/identity-contract