<?php
declare(strict_types=1);

namespace PpPhp\Core\Platform\Compatibility;

final class DeprecationNotice
{
    public function __construct(
        private readonly string $legacy,
        private readonly string $canonical,
        private readonly string $message,
        private readonly string $removeAfter = ''
    ) {}

    public function legacy(): string { return $this->legacy; }
    public function canonical(): string { return $this->canonical; }
    public function message(): string { return $this->message; }
    public function removeAfter(): string { return $this->removeAfter; }

    public function toArray(): array
    {
        return [
            'legacy' => $this->legacy,
            'canonical' => $this->canonical,
            'message' => $this->message,
            'removeAfter' => $this->removeAfter,
        ];
    }
}
