<?php
declare(strict_types=1);

namespace PpPhp\Core\Platform\DI\Reflection;

final class ReflectionCache
{
    private array $classes = [];

    public function has(string $className): bool { return isset($this->classes[$className]); }
    public function get(string $className): ?ClassMetadata { return $this->classes[$className] ?? null; }
    public function set(ClassMetadata $metadata): void { $this->classes[$metadata->className()] = $metadata; }
    public function all(): array { return $this->classes; }
    public function count(): int { return count($this->classes); }
    public function clear(): void { $this->classes = []; }
}
