Download the PHP package event-engine/php-code-generator-event-engine-ast without Composer
On this page you can find all versions of the php package event-engine/php-code-generator-event-engine-ast. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download event-engine/php-code-generator-event-engine-ast
More information about event-engine/php-code-generator-event-engine-ast
Files in event-engine/php-code-generator-event-engine-ast
Package php-code-generator-event-engine-ast
Short Description PHP Code Generator for Event Engine based on PHP AST
License MIT
Informations about the package php-code-generator-event-engine-ast
Event Engine - PHP Code Generator via PHP AST
PHP Code Generator based on PHP Abstract Syntax Tree. It provides a comprehensive high level API to generate PHP code from prooph board for Event Engine.
It supports the following code generation:
- Event Engine API description for commands, aggregates and domain events
- Command, aggregate and domain event classes with corresponding value objects based on metadata (JSON schema)
- Glue code between command, corresponding aggregate and corresponding domain events
Installation
Run the following to install this library:
If you want to use Config\PreConfiguredNaming
please install also laminas/laminas-filter
.
Usage
The code generation is based on the InspectIO Graph. There are two implementations of InspectIO Graph. The first one is based on the InspectIO GraphML graph format and the second is based on the InspectIO Cody graph format.
It is recommended to use the InspectIO Cody graph format because it's based on a simple JSON structure.
For out-of-the-box usage you can use the preconfigured configuration file Config\PreConfiguredNaming
. You are free to
change the configuration for your needs. The following example uses the preconfigured configurations.
Feel free to modify the generated PHP code, because your changes will NOT be overwritten (can be overwritten if you want)!
Code Generation
The following quick example shows how to generate PHP code for Command classes with the preconfigured configuration.
- Please see command unit tests (
tests/CommantTest.php
) for comprehensive examples which code will be generated. - Please see event unit tests (
tests/EventTest.php
) for comprehensive examples which code will be generated. - Please see aggregate unit tests (
tests/AggregateTest.php
) for comprehensive examples which code will be generated. - Please see query unit tests (
tests/QueryTest.php
) for comprehensive examples which code will be generated. - Please see value object unit tests (
tests/ValueObjectTest.php
) for comprehensive examples which code will be generated.
All versions of php-code-generator-event-engine-ast with dependencies
ext-json Version *
event-engine/php-inspectio-graph-cody Version ^0.1.0
open-code-modeling/json-schema-to-php Version ^0.4.x-dev
open-code-modeling/json-schema-to-php-ast Version 0.6.x-dev
open-code-modeling/php-code-ast Version 0.13.x-dev
open-code-modeling/php-filter Version ^0.2.1 || 0.3.x-dev