methods[ $method->get_id() ] = $method; } /** * Get a specific two-factor authentication method by ID. * * @param string $id The method ID. * @return TwoFactorMethodInterface|null The method instance or null if not found. */ public function get_method( string $id ) { return $this->methods[ $id ] ?? null; } /** * Get all registered two-factor authentication methods. * * @return TwoFactorMethodInterface[] Array of registered methods. */ public function get_methods(): array { return $this->methods; } }