diff --git a/phpdotnet/phd/Package/PHP/XHTML.php b/phpdotnet/phd/Package/PHP/XHTML.php
index c185336a..6d8a4bec 100644
--- a/phpdotnet/phd/Package/PHP/XHTML.php
+++ b/phpdotnet/phd/Package/PHP/XHTML.php
@@ -125,6 +125,10 @@ abstract class Package_PHP_XHTML extends Package_Generic_XHTML {
'classsynopsis' => 'format_classsynopsis_oo_name_text',
]
],
+ 'enumidentifier' => [
+ /* DEFAULT */ 'format_enumidentifier_text',
+ 'enumsynopsis' => false,
+ ],
'methodname' => array(
/* DEFAULT */ 'format_function_text',
'constructorsynopsis' => array(
@@ -898,6 +902,25 @@ public function format_classname_text($value, $tag) {
return '' .$value. '';
}
+ public function format_enumidentifier_text($value, $tag) {
+ if (!str_contains($value, '::')) {
+ return $value;
+ }
+
+ list($enumName) = explode('::', $value);
+ $t = strtr($this->normalizeFQN($enumName), ["_" => "-", "\\" => "-"]);
+ $href = Format::getFilename("enum.$t");
+
+ if ($href === false) {
+ return $value;
+ }
+
+ if ($this->chunked) {
+ return '' . $value . '';
+ }
+ return '' . $value . '';
+ }
+
/*Chunk Functions*/
private function isChunkedByAttributes(array $attributes): bool {
diff --git a/tests/package/php/data/enumidentifier_link_rendering.xml b/tests/package/php/data/enumidentifier_link_rendering.xml
new file mode 100644
index 00000000..c628be9a
--- /dev/null
+++ b/tests/package/php/data/enumidentifier_link_rendering.xml
@@ -0,0 +1,34 @@
+
+
1. Enum case inside enumsynopsis (no link - definition context)
+3. Enum case reference with FQN and leading backslash (linked)
+ case \Enum\Namespace\Existing_Enum::AnotherCase +4. Enum case without namespace separator (no link)
+ case JustCaseName +5. Enum case for non-existent enum (no link)
+ case NonExistent\Enum::SomeCase +