PHP code example of lukecurtis93 / avro-generate

1. Go to this page and download the library: Download lukecurtis93/avro-generate library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

lukecurtis93 / avro-generate example snippets


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;
//

$generator = new LukeCurtis\DefaultAvroGenerator();
echo $generator->generate();