<?php

namespace App\Modules\Passenger\Domain;

class PassengerGender
{

    public const MALE = 1;
    public const FEMALE = 2;

    public const NAMES = [
        self::MALE => 'MASCULINO',
        self::FEMALE => 'FEMENINO',
    ];

    private int $value;

    public function __construct(int $value)
    {
        $values = [self::MALE, self::FEMALE];
        $this->value = in_array($value, $values) ? $value : $values[0];
    }

    public function value()
    {
        return $this->value;
    }

    public function getValue()
    {
        return $this->value;
    }
    public function getText()
    {
        return self::NAMES[$this->value];
    }
}
