for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace Aweapi\Openapi\Objects;
use Aweapi\Openapi\ValueObject;
final class Discriminator extends ValueObject
{
private $mapping = [];
private $propertyName;
public function __construct(
string $propertyName,
iterable $mapping = []
) {
$this->propertyName = $propertyName;
foreach ($mapping as $name => $reference) {
$this->mapping[$name] = $reference;
}
public function getMapping(): array
return $this->mapping;
public function getPropertyName(): string
return $this->propertyName;
protected function normalizeOptionalProperties(): array
return [
'mapping' => $this->getMapping(),
];
protected function normalizeRequiredProperties(): array
'propertyName' => $this->getPropertyName(),