lukecurtis93 / avro-generate
Easily create Avro files from your PHP classes.
Fund package maintenance!
lukecurtis93
Requires
- php: ^8.1
- doctrine/annotations: ^1.14
- flix-tech/avro-serde-php: ^1.6
- illuminate/contracts: ^9
- league/flysystem: ^3.0
- symfony/console: ^5.4|^6.0
Requires (Dev)
- laravel/pint: ^1.2
- league/flysystem-memory: ^3.0
- orchestra/testbench: ^7.0.0
- phpunit/phpunit: ^9.5
- spatie/ray: ^1.28
This package is auto-updated.
Last update: 2025-03-09 07:23:04 UTC
README
Avro Generate is a small PHP CLI Application to allow you generate Avro definitions from your classes.
To use this package, simply implement the Avroable
interface and define your definitions as per the Flixtech package
use FlixTech\AvroSerializer\Objects\Schema\Generation\Annotations; use LukeCurtis\AvroGenerate\Contracts\Avroable; /** * @Annotations\AvroType("record") * @Annotations\AvroName("user") */ class User implements Avroable { /** * @Annotations\AvroType("string") * @var string */ private $firstName; //
Then you can run
./vendor/bin/avro generate --output=./resources/avro
This will generate the Avro schemas for your Avroable classes.
Coming Soon
- Specify directories or explicit files for generation.
- Upload these Avro files to a Schema Registry.
- Checking for namesapces to be compatible with Confluent Schema Registry and UI.
- Versioned schemas
Installation
You can install the package via composer:
composer require lukecurtis93/avro-generate
Usage
If you want to use the underlying generator for your own needs you can simply import and use the class.
$generator = new LukeCurtis\DefaultAvroGenerator(); echo $generator->generate();
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Credits
License
The MIT License (MIT). Please see License File for more information.