From d35b5262551aeb0b6dd243be4690e0b3f01dc245 Mon Sep 17 00:00:00 2001 From: haszi Date: Sun, 29 Dec 2024 12:27:27 +0100 Subject: [PATCH] Address review comments --- phpdotnet/phd/Package/Generic/XHTML.php | 4 ++-- tests/package/php/data/property_linking.xml | 9 +++++++++ tests/package/php/property_linking.phpt | 17 +++++++++++++++++ 3 files changed, 28 insertions(+), 2 deletions(-) diff --git a/phpdotnet/phd/Package/Generic/XHTML.php b/phpdotnet/phd/Package/Generic/XHTML.php index 3537187d..cc5ff88d 100644 --- a/phpdotnet/phd/Package/Generic/XHTML.php +++ b/phpdotnet/phd/Package/Generic/XHTML.php @@ -1853,8 +1853,8 @@ public function format_property_text($value, $tag) { } $tempLinkValue = str_replace( - array("\\", "_", "$"), - array("-", "-", ""), + ["\\", "_", "$"], + ["-", "-", ""], strtolower(trim($value, "_")) ); diff --git a/tests/package/php/data/property_linking.xml b/tests/package/php/data/property_linking.xml index 5bc3f92e..c6daa9e4 100644 --- a/tests/package/php/data/property_linking.xml +++ b/tests/package/php/data/property_linking.xml @@ -6,6 +6,9 @@ Vendor\Namespace::$definitely_exists + + Vendor\Namespace::$definitelyExists2 +
@@ -13,6 +16,9 @@ Vendor\Namespace::$this_does_not_exist + + Vendor\Namespace::$thisDoesNotExist2 +
@@ -20,6 +26,9 @@ Extension\Class::$__leading_and_trailing_undescores__ + + Extension\Class::$__leadingAndTrailingUndescores2__ +
diff --git a/tests/package/php/property_linking.phpt b/tests/package/php/property_linking.phpt index 4c3dba0e..cfee80da 100644 --- a/tests/package/php/property_linking.phpt +++ b/tests/package/php/property_linking.phpt @@ -15,10 +15,18 @@ $indices = [ "docbook_id" => "vendor-namespace.props.definitely-exists", "filename" => "extensionname.page", ], + [ + "docbook_id" => "vendor-namespace.props.definitelyexists2", + "filename" => "extensionname.page", + ], [ "docbook_id" => "extension-class.props.leading-and-trailing-undescores", "filename" => "extensionname2.page2", ], + [ + "docbook_id" => "extension-class.props.leadingandtrailingundescores2", + "filename" => "extensionname2.page2", + ], ]; $format = new TestPHPChunkedXHTML($config, $outputHandler); @@ -53,6 +61,9 @@ Content:

Vendor\Namespace::$definitely_exists

+

+ Vendor\Namespace::$definitelyExists2 +

@@ -60,6 +71,9 @@ Content:

Vendor\Namespace::$this_does_not_exist

+

+ Vendor\Namespace::$thisDoesNotExist2 +

@@ -67,6 +81,9 @@ Content:

Extension\Class::$__leading_and_trailing_undescores__

+

+ Extension\Class::$__leadingAndTrailingUndescores2__ +