From a75f54f3722fa2005777cc38aebf3448e4e2b0fc Mon Sep 17 00:00:00 2001 From: Louis-Arnaud Catoire Date: Tue, 10 Feb 2026 09:51:57 +0100 Subject: [PATCH] Remove empty from skeletons and docgen Empty xi:fallback elements silently swallow XInclude failures. Removing them ensures missing includes surface as errors instead of being ignored. Relates to #199. --- scripts/docgen/docgen.php | 8 ++++---- skeletons/classname.xml | 20 +++++--------------- skeletons/exceptionname.xml | 16 ++++------------ 3 files changed, 13 insertions(+), 31 deletions(-) diff --git a/scripts/docgen/docgen.php b/scripts/docgen/docgen.php index 09fdf9b80c..7aca5f87a3 100644 --- a/scripts/docgen/docgen.php +++ b/scripts/docgen/docgen.php @@ -605,7 +605,7 @@ function gen_class_markup(ReflectionClass $class, $content) { /* {{{ */ } $markup .= '&InheritedProperties;'. PHP_EOL; foreach ($inherited as $declaring_class) { - $markup .= str_repeat(' ', $ident) ."" . PHP_EOL . str_repeat(' ', $ident + 1) . "" . PHP_EOL . str_repeat(' ', $ident) . "". PHP_EOL; + $markup .= str_repeat(' ', $ident) ."". PHP_EOL; } } @@ -643,14 +643,14 @@ function gen_class_markup(ReflectionClass $class, $content) { /* {{{ */ /* {PROPERTY_XINCLUDE} */ $content = preg_replace('/\{PROPERTY_XINCLUDE\}/', - "". PHP_EOL, + "". PHP_EOL, $content, 1); /* {METHOD_XINCLUDE} */ $ident = get_ident_size('METHOD_XINCLUDE', $content); $content = preg_replace('/\{METHOD_XINCLUDE\}/', PHP_EOL . str_repeat(' ', $ident) . "&Methods;". PHP_EOL. - str_repeat(' ', $ident) ."" . PHP_EOL . str_repeat(' ', $ident + 1) . "" . PHP_EOL . str_repeat(' ', $ident) . "", + str_repeat(' ', $ident) ."", $content, 1); /* {INHERITED_XINCLUDE} */ @@ -658,7 +658,7 @@ function gen_class_markup(ReflectionClass $class, $content) { /* {{{ */ $ident = get_ident_size('INHERITED_XINCLUDE', $content); $content = preg_replace('/\{INHERITED_XINCLUDE\}/', PHP_EOL . str_repeat(' ', $ident) ."&InheritedMethods;". PHP_EOL. - str_repeat(' ', $ident) ."getName()) ."')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[@role='" . $escapedName . "'])\">" . PHP_EOL . str_repeat(' ', $ident + 1) . "" . PHP_EOL . str_repeat(' ', $ident) . "". PHP_EOL, + str_repeat(' ', $ident) ."getName()) ."')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[@role='" . $escapedName . "'])\"/>". PHP_EOL, $content, 1); } else { $content = preg_replace('/^\s*\{INHERITED_XINCLUDE\}.*?\n/m', '', $content, 1); diff --git a/skeletons/classname.xml b/skeletons/classname.xml index 774d945cf6..a02f1aafaf 100644 --- a/skeletons/classname.xml +++ b/skeletons/classname.xml @@ -60,24 +60,16 @@ &InheritedProperties; - - - + &Methods; - - - + - - - + - - - + &InheritedMethods; - - - + diff --git a/skeletons/exceptionname.xml b/skeletons/exceptionname.xml index 2de970e89b..e6402edf8a 100644 --- a/skeletons/exceptionname.xml +++ b/skeletons/exceptionname.xml @@ -33,17 +33,11 @@ &Methods; &Methods; - - - + - - - + - - - + &InheritedMethods; - - - +