<?php

declare(strict_types=1);

namespace PpPhp\Core\Diagnostics\Metadata;

final class ComponentMetadata extends AbstractMetadata
{
    public function category(): string
    {
        return (string) ($this->raw['category'] ?? 'general');
    }

    public function properties(): array
    {
        return is_array($this->raw['properties'] ?? null) ? $this->raw['properties'] : [];
    }

    public function events(): array
    {
        return is_array($this->raw['events'] ?? null) ? $this->raw['events'] : [];
    }

}
