schemas)->only($id)->all(); } return $id ? $this->schemas[$id] : $this->schemas; } public function register(FeatureSchemaInterface $schema): void { if (array_key_exists($schema->getId(), $this->schemas)) { return; } $this->schemas[$schema->getId()] = $schema; } /** @return array> */ public function getMappings(Server $server): array { return collect($this->get($server->egg->features))->mapWithKeys(fn (FeatureSchemaInterface $schema) => [ $schema->getId() => $schema->getListeners(), ])->all(); } }