There should be an ability to set interface that the generated DTO class will implement.
For example, each DTO class can use the ToArray trait and contain toArray() method. So you may want to make sure that your DTO class implements some interface named e.g. Arrayable (though, Laravel framework has Arrayable interface).
The user should be able to define "interfaces" like this:
{
"class": "item",
"namespace_postfix": "",
"interfaces": "\Path\To\Arrayable",
"rules": {
"id": "int",
"count": "nullable|int",
"name": "string",
"description": "nullable|string",
"is_active": "bool"
}
}
where \Path\To\Arrayable is the namespace of the interface.
Separate interfaces with comma, when there is a need to implement multiple interfaces:
"interfaces": "\Path\To\FirstInterface, \Path\To\SecondInterface",
There should be an ability to set interface that the generated DTO class will implement.
For example, each DTO class can use the
ToArraytrait and containtoArray()method. So you may want to make sure that your DTO class implements some interface named e.g.Arrayable(though, Laravel framework hasArrayableinterface).The user should be able to define "interfaces" like this:
where
\Path\To\Arrayableis the namespace of the interface.Separate interfaces with comma, when there is a need to implement multiple interfaces: