These are the files used in my talk "Working with Value Objects in PHP".
- PHP 7.4+
You can use Docker to run the examples in this project, for example:
docker run --rm --volume $(pwd):/files --workdir /files php:7.4-cli-alpine php samples/auto-validation.php
Fatal error: Uncaught InvalidArgumentException: JPY isn't a valid currency. in /files/samples/auto-validation.php:13
Stack trace:
#0 /files/samples/auto-validation.php(34): Price->__construct('JPY', 199.99)
#1 {main}
thrown in /files/samples/auto-validation.php on line 13