Skip to content

Commit aa60c50

Browse files
committed
Add test
1 parent f625e76 commit aa60c50

4 files changed

Lines changed: 34 additions & 7 deletions

File tree

‎phpdotnet/phd/Package/Generic/XHTML.php‎

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1332,11 +1332,7 @@ public function format_classsynopsis_methodsynopsis_methodname_text($value, $tag
13321332
}
13331333

13341334
list($class, $method) = explode($explode, $value);
1335-
$thisFqcn = "";
1336-
if ($this->cchunk["packagesynopsis"]["namespace"]) {
1337-
$thisFqcn = $this->cchunk["packagesynopsis"]["namespace"] . '\\';
1338-
}
1339-
$thisFqcn .= $this->cchunk["classsynopsis"]["classname"];
1335+
$thisFqcn = $this->getFqcn();
13401336

13411337
if ($class !== $thisFqcn) {
13421338
return $value;
@@ -2707,4 +2703,14 @@ public function onNewPage(): void
27072703
{
27082704
$this->perPageExampleCounter = 0;
27092705
}
2706+
2707+
protected function getFqcn() {
2708+
$fqcn = "";
2709+
2710+
if ($this->cchunk["packagesynopsis"]["namespace"]) {
2711+
$fqcn = $this->cchunk["packagesynopsis"]["namespace"] . "\\";
2712+
}
2713+
2714+
return $fqcn . $this->cchunk["classsynopsis"]["classname"];
2715+
}
27102716
}

‎phpdotnet/phd/Package/PHP/XHTML.php‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -807,7 +807,7 @@ public function format_acronym_text($value, $tag) {
807807
public function format_classsynopsis_fieldsynopsis_varname_text($value, $tag) {
808808
if ($this->cchunk["classsynopsis"]["classname"]) {
809809
if (strpos($value, "::") === false && strpos($value, "->") === false) {
810-
$value = $this->cchunk["classsynopsis"]["classname"] . "->" . $value;
810+
$value = $this->getFqcn() . "->" . $value;
811811
}
812812
}
813813

@@ -817,7 +817,7 @@ public function format_classsynopsis_fieldsynopsis_varname_text($value, $tag) {
817817
public function format_classsynopsis_methodsynopsis_methodname_text($value, $tag) {
818818
if ($this->cchunk["classsynopsis"]["classname"]) {
819819
if (strpos($value, "::") === false && strpos($value, "->") === false) {
820-
$value = $this->cchunk["classsynopsis"]["classname"] . "::" . $value;
820+
$value = $this->getFqcn() . "::" . $value;
821821
}
822822
}
823823

‎tests/package/php/data/packagesynopsis_rendering.xml‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,17 @@
1515
<modifier>implements</modifier>
1616
<interfacename>Stringable</interfacename>
1717
</oointerface>
18+
19+
<fieldsynopsis>
20+
<modifier>public</modifier>
21+
<type>int</type>
22+
<varname linkend="bcmath-number.props.scale">scale</varname>
23+
</fieldsynopsis>
24+
25+
<methodsynopsis xmlns="http://docbook.org/ns/docbook" role="BcMath\\Number">
26+
<modifier>public</modifier> <type>BcMath\Number</type><methodname>BcMath\Number::floor</methodname>
27+
<void/>
28+
</methodsynopsis>
1829
</classsynopsis>
1930
</packagesynopsis>
2031
</section>

‎tests/package/php/packagesynopsis_rendering_001.phpt‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,16 @@ Content:
3434

3535
<span class="modifier">implements</span>
3636
<strong class="interfacename">Stringable</strong> {</div>
37+
38+
<div class="fieldsynopsis">
39+
<span class="modifier">public</span>
40+
<span class="type"><a href="language.types.integer.html" class="type int">int</a></span>
41+
<var class="varname"><a href=".html#bcmath-number.props.scale">$<var class="varname">scale</var></a></var>;</div>
42+
43+
44+
<div class="methodsynopsis dc-description">
45+
<span class="modifier">public</span> <span class="methodname"><strong>floor</strong></span>(): <span class="type">BcMath\Number</span></div>
46+
3747
}
3848
</div>
3949
</div>

0 commit comments

Comments
 (0)