-
Notifications
You must be signed in to change notification settings - Fork 1
Getting started
Chris Harrison edited this page Apr 22, 2021
·
4 revisions
composer require chrisharrison/vo-generator
Add the namespace and folder to composer.json.
{
...
"autoload": {
"psr-4": {
...
"ValueObjects\\": ".vo.code/"
}
}
}
This puts all the generated value objects that get created in the .vo.code folder into the ValueObjects\ namespace.
Create a file with the .voml extension anywhere in your project. (e.g. /value-objects.voml)
composite MaxArea {
width: MaxWidth!
height: MaxHeight!
}
Run
vendor/bin/vogen
The value objects will be created in the .vo.code folder and the classes will be available in the ValueObjects\ namespace.
You can read about how to define your value objects in VOML