flix-tech/avro-serde-php

View on GitHub
src/Objects/Schema/ArrayType.php

Summary

Maintainability
A
30 mins
Test Coverage
A
100%
Similar blocks of code found in 2 locations. Consider refactoring.
<?php
 
declare(strict_types=1);
 
namespace FlixTech\AvroSerializer\Objects\Schema;
 
use FlixTech\AvroSerializer\Objects\Schema;
 
class ArrayType extends ComplexType
{
public function __construct()
{
parent::__construct(TypeName::ARRAY);
}
 
public function items(Schema $schema): self
{
return $this->attribute(AttributeName::ITEMS, $schema);
}
 
/**
* @param array<mixed> $default
*/
public function default(array $default): self
{
return $this->attribute(AttributeName::DEFAULT, $default);
}
}