Value Objects

By Łukasz Bacik

This article discusses the use of Value Objects in the context of PHP
applications. The article presents step-by-step implementations of an
example Value Object (class Person), as well as the use and
discussion of the
lbacik\value-object[^1](https://packagist.org/packages/lbacik/value-object)
library. Examples utilize the phpspec[^2](http://phpspec.net/en/stable/)
framework as the test platform (one does not live by PHPUnit alone,
after all!), and the entire code is available on
GitHub[^3](https://github.com/lbacik/value-object-spec). Enjoy! by
Łukasz Bacik

This article was originally published in the June 2023 issue of php[architect] magazine. To read the complete article please subscribe or purchase the complete issue.

Leave a comment

Use the form below to leave a comment: