flix-tech/avro-serde-php

View on GitHub
src/Objects/DefaultSchemaGeneratorFactory.php

Summary

Maintainability
A
0 mins
Test Coverage
F
0%
<?php

declare(strict_types=1);

namespace FlixTech\AvroSerializer\Objects;

use Doctrine\Common\Annotations\AnnotationReader;
use Doctrine\Common\Annotations\AnnotationRegistry;
use FlixTech\AvroSerializer\Objects\Schema\Generation\SchemaGenerator;

class DefaultSchemaGeneratorFactory
{
    public static function get(): SchemaGenerator
    {
        AnnotationRegistry::registerLoader('class_exists');

        return new Schema\Generation\SchemaGenerator(
            new Schema\Generation\AnnotationReader(
                new AnnotationReader()
            )
        );
    }
}