From 14d759679a7354bb5f0287cf92c44fedea8b2e58 Mon Sep 17 00:00:00 2001 From: JoshyPHP Date: Sun, 17 Dec 2023 21:41:19 +0100 Subject: [PATCH] OptimizeChoose: minor code simplification --- src/Configurator/TemplateNormalizations/OptimizeChoose.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Configurator/TemplateNormalizations/OptimizeChoose.php b/src/Configurator/TemplateNormalizations/OptimizeChoose.php index f3c3f57ef..90ce1ca76 100644 --- a/src/Configurator/TemplateNormalizations/OptimizeChoose.php +++ b/src/Configurator/TemplateNormalizations/OptimizeChoose.php @@ -181,10 +181,10 @@ protected function optimizeEmptyBranch() } // test="@foo" becomes test="not(@foo)" - $when = $this->choose->query('xsl:when')[0]; + $when = $this->choose->firstOf('xsl:when'); $when->setAttribute('test', 'not(' . $when->getAttribute('test') . ')'); - $otherwise = $this->choose->query('xsl:otherwise')[0]; + $otherwise = $this->choose->firstOf('xsl:otherwise'); $when->append(...$otherwise->childNodes); }