<?php

declare(strict_types=1);

namespace App\Service\Doctrine\SchemaValidation;

class Difference
{
    protected DiffTypeEnum $type;
    protected ?string $message;
    protected string $entity;
    protected string $property;

    /**
     * @var string|array<string, string|array<string>>
     */
    protected string|array $expectedType;

    /**
     * @param string|array<string, string|array<string>> $expectedType
     */
    public function __construct(DiffTypeEnum $type, ?string $message, string|array $expectedType = [])
    {
        $this->type = $type;
        $this->message = $message;
        $this->expectedType = $expectedType;
    }

    public function getType(): DiffTypeEnum
    {
        return $this->type;
    }

    public function setType(DiffTypeEnum $type): self
    {
        $this->type = $type;

        return $this;
    }

    public function getMessage(): ?string
    {
        return $this->message;
    }

    public function setMessage(?string $message): self
    {
        $this->message = $message;

        return $this;
    }

    /**
     * @return string|array<string, string|array<string>>
     */
    public function getExpectedType(): string|array
    {
        return $this->expectedType;
    }

    /**
     * @param string|array<string, string|array<string>> $expectedType
     *
     * @return $this
     */
    public function setExpectedType(string|array $expectedType): self
    {
        $this->expectedType = $expectedType;

        return $this;
    }
}
