darkdarin / xsd-entity-generator
Generator for make DTO from XSD
Installs: 2
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:package
Requires
- php: 8.2.*|8.3.*
- darkdarin/php-entity-renderer: ^1.1
- illuminate/support: ^9.0|^10.0
- symfony/property-access: ^6.4
- symfony/property-info: ^6.4
- symfony/serializer: ^6.4
Requires (Dev)
- laravel/pint: ^1.1
- roave/security-advisories: dev-latest
- vimeo/psalm: ^5.21
This package is auto-updated.
Last update: 2024-11-30 16:15:36 UTC
README
Generator for make DTO from XSD
Install
composer require darkdarin/xsd-entity-generator
Usage
use DarkDarin\XsdEntityGenerator\SchemaLoader; use DarkDarin\XsdEntityGenerator\Serializer\SchemaSerializerFactory; use DarkDarin\XsdEntityGenerator\DTOGenerator; use DarkDarin\XsdEntityGenerator\PrimitiveTypeResolver; $schemaSerializer = (new SchemaSerializerFactory())(); $schemaLoader = new SchemaLoader($schemaSerializer); $schema = $schemaLoader->load('path/to/schema.xsd'); $dtoGenerator = new DTOGenerator(new PrimitiveTypeResolver()); $dtoGenerator->generate($schema, 'path/to/generated/classes', '\\Namespace\\For\\Generated\\Classes');