for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace Doctrine\Annotations\Metadata\Builder;
use Doctrine\Annotations\Metadata\PropertyMetadata;
/**
* @internal
*/
final class PropertyMetadataBuilder
{
/** @var string */
private $name;
/** @var string[]|null */
private $type;
/** @var bool */
private $required = false;
private $default = false;
/** @var array<int|float|string|bool>|null */
private $enum;
public function __construct(string $name)
$this->name = $name;
}
* @param string[] $type
public function withType(array $type) : self
$this->type = $type;
return $this;
public function withBeingRequired() : self
$this->required = true;
public function withBeingDefault() : self
$this->default = true;
* @param array<int|float|string|bool>|null $enum
public function withEnum(array $enum) : self
$this->enum = $enum;
public function build() : PropertyMetadata
return new PropertyMetadata(
$this->name,
$this->type,
$this->required,
$this->default,
$this->enum
);