<?php

declare(strict_types=1);

namespace PpPhp\Core\Platform\Services\Registry;

final class RegistryCollection
{
    public readonly ServiceRegistry $services;
    public readonly AliasRegistry $aliases;
    public readonly CapabilityRegistry $capabilities;

    public function __construct()
    {
        $this->services = new ServiceRegistry();
        $this->aliases = new AliasRegistry();
        $this->capabilities = new CapabilityRegistry();
    }

    public function toArray(): array
    {
        return [
            'services' => $this->services->toArray(),
            'aliases' => $this->aliases->all(),
            'capabilities' => $this->capabilities->all(),
        ];
    }
}
