has_feature( $id ) ) { return false; } $this->features[ $id ] = $feature; return true; } /** * Gets a feature by ID. * * @since 0.6.0 * * @param string $id Feature identifier. * @return \WordPress\AI\Contracts\Feature|null Feature instance or null if not found. */ public function get_feature( string $id ): ?Feature { return $this->features[ $id ] ?? null; } /** * Gets all registered features. * * @since 0.6.0 * * @return \WordPress\AI\Contracts\Feature[] Array of feature instances keyed by feature ID. */ public function get_all_features(): array { return $this->features; } /** * Checks if a feature is registered. * * @since 0.6.0 * * @param string $id Feature identifier. * @return bool True if registered, false otherwise. */ public function has_feature( string $id ): bool { return isset( $this->features[ $id ] ); } }