sodalto / dto-generator
Generate DTOs to be used instead of arrays.
Installs: 6
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/sodalto/dto-generator
Requires
- nette/php-generator: v3.6.x-dev
- symfony/console: 5.4.0
Requires (Dev)
- friendsofphp/php-cs-fixer: dev-master
- phpstan/phpstan: 1.7.x-dev
- phpunit/phpunit: 9.5.x-dev
- psy/psysh: @stable
This package is auto-updated.
Last update: 2025-10-15 00:54:19 UTC
README
This cli tool will generate a DTO class to be used as a replacement for array.
WHY?
A lot of php code is array-heavy, the idea is to use objects for data transfer, especially as return types.
HOW TO USE?
$ php generate.php generate:dto-array %path% %className% - a DTO %className% will be generated at %path%.
You will be asked about the properties you want to include in the class.
TODO:
- Check that directory exist before writing generated classes
- Refactor GenerateArrayClassCommand's callback actions to standalone classes
- Add tests for ArrayClassGenerator (introduce filesystem writer dependency)