*/ private array $packs = array(); public function register( RulePackInterface $pack ): bool { $id = $pack->get_manifest()->get_id(); if ( '' === $id || isset( $this->packs[ $id ] ) ) { return false; } $this->packs[ $id ] = $pack; return true; } public function get( string $id ): ?RulePackInterface { return $this->packs[ $id ] ?? null; } /** @return RulePackInterface[] */ public function all(): array { return array_values( $this->packs ); } }