Skip to content

Commit

Permalink
Add FQN normalization to constants
Browse files Browse the repository at this point in the history
  • Loading branch information
haszi authored and Girgias committed Jan 5, 2025
1 parent d7a81eb commit c22feec
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion phpdotnet/phd/Package/Generic/XHTML.php
Original file line number Diff line number Diff line change
Expand Up @@ -1811,7 +1811,7 @@ private function convertConstantNameToId(string $constantName): string {
$tempLinkValue = str_replace(
array("\\", "_"),
array("-", "-"),
strtolower(trim($constantName, "_"))
trim($this->normalizeFQN($constantName), "_")
);

if (str_contains($constantName, '::')) {
Expand Down
4 changes: 4 additions & 0 deletions tests/package/php/constant_links_001.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ Content:
<p class="para">
<strong><code><a href="extensionname2.constantspage2.html#vendor-namespace.constants.definitely-exists2">Vendor\Namespace::DEFINITELY_EXISTS2</a></code></strong>
</p>
<strong><code><a href="extensionname.constantspage.html#constant.extension-namespace-definitely-exists">\Extension\Namespace\DEFINITELY_EXISTS</a></code></strong>
<p class="para">
<strong><code><a href="extensionname2.constantspage2.html#vendor-namespace.constants.definitely-exists2">\Vendor\Namespace::DEFINITELY_EXISTS2</a></code></strong>
</p>
</div>

<div class="section">
Expand Down
4 changes: 4 additions & 0 deletions tests/package/php/data/constant_links.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
<para>
<constant>Vendor\Namespace::DEFINITELY_EXISTS2</constant>
</para>
<constant>\Extension\Namespace\DEFINITELY_EXISTS</constant>
<para>
<constant>\Vendor\Namespace::DEFINITELY_EXISTS2</constant>
</para>
</section>

<section>
Expand Down

0 comments on commit c22feec

Please sign in to comment.