*/ private array $repositories = array(); public function register_repository( string $type, object $repository ): bool { if ( '' === $type || isset( $this->repositories[ $type ] ) ) { return false; } $this->repositories[ $type ] = $repository; return true; } public function get_repository( string $type ): ?object { return $this->repositories[ $type ] ?? null; } }