@@ -1554,7 +1554,7 @@ public function getMethodSynopsisDocument(array $funcMap, array $aliasMap): ?str
1554
1554
$ descriptionRefSec ->appendChild ($ undocumentedEntity );
1555
1555
$ descriptionRefSec ->appendChild (new DOMText ("\n " ));
1556
1556
$ returnDescriptionPara = $ doc ->createElement ('para ' );
1557
- $ returnDescriptionPara ->appendChild (new DOMText ("\n Description \n " ));
1557
+ $ returnDescriptionPara ->appendChild (new DOMText ("\n Description. \n " ));
1558
1558
$ descriptionRefSec ->appendChild ($ returnDescriptionPara );
1559
1559
1560
1560
$ descriptionRefSec ->appendChild (new DOMText ("\n " ));
@@ -1573,14 +1573,14 @@ public function getMethodSynopsisDocument(array $funcMap, array $aliasMap): ?str
1573
1573
/* Creation of <refsect1 role="errors"> */
1574
1574
$ errorsRefSec = $ this ->generateRefSect1 ($ doc , 'errors ' );
1575
1575
$ errorsDescriptionParaConstantTag = $ doc ->createElement ('constant ' );
1576
- $ errorsDescriptionParaConstantTag ->append (" E_* " );
1576
+ $ errorsDescriptionParaConstantTag ->append (' E_* ' );
1577
1577
$ errorsDescriptionParaExceptionTag = $ doc ->createElement ('exceptionname ' );
1578
- $ errorsDescriptionParaExceptionTag ->append (" Exception " );
1578
+ $ errorsDescriptionParaExceptionTag ->append (' Exception ' );
1579
1579
$ errorsDescriptionPara = $ doc ->createElement ('para ' );
1580
1580
$ errorsDescriptionPara ->append (
1581
1581
"\n When does this function issue " ,
1582
1582
$ errorsDescriptionParaConstantTag ,
1583
- " level errors, and/or throw " ,
1583
+ " level errors, \n and/or throw " ,
1584
1584
$ errorsDescriptionParaExceptionTag ,
1585
1585
"s. \n "
1586
1586
);
@@ -1625,7 +1625,7 @@ public function getMethodSynopsisDocument(array $funcMap, array $aliasMap): ?str
1625
1625
$ seeAlsoMemberLink = $ doc ->createElement ('member ' );
1626
1626
$ seeAlsoMemberLinkTag = $ doc ->createElement ('link ' );
1627
1627
$ seeAlsoMemberLinkTag ->setAttribute ('linkend ' , 'some.id.chunk.to.link ' );
1628
- $ seeAlsoMemberLinkTag ->appendChild (new DOMText (" something appendix " ));
1628
+ $ seeAlsoMemberLinkTag ->appendChild (new DOMText (' something appendix ' ));
1629
1629
$ seeAlsoMemberLink ->appendChild ($ seeAlsoMemberLinkTag );
1630
1630
1631
1631
$ seeAlsoList = $ doc ->createElement ('simplelist ' );
@@ -1702,23 +1702,28 @@ private function getParameterSection(DOMDocument $doc): DOMElement {
1702
1702
$ parameterTerm = $ doc ->createElement ('term ' );
1703
1703
$ parameterTerm ->appendChild ($ parameter );
1704
1704
1705
- $ parameterEntry = $ doc ->createElement ('varlistentry ' );
1706
- $ parameterEntry ->appendChild (new DOMText ("\n " ));
1707
- $ parameterEntry ->appendChild ($ parameterTerm );
1708
- $ parameterEntry ->appendChild (new DOMText ("\n " ));
1709
-
1710
1705
$ listItemPara = $ doc ->createElement ('para ' );
1711
- $ listItemPara ->appendChild (new DOMText ("\n " ));
1712
- $ listItemPara ->appendChild (new DOMText ("Description. " ));
1713
- $ listItemPara ->appendChild (new DOMText ("\n " ));
1706
+ $ listItemPara ->append (
1707
+ "\n " ,
1708
+ "Description. " ,
1709
+ "\n " ,
1710
+ );
1714
1711
1715
1712
$ parameterEntryListItem = $ doc ->createElement ('listitem ' );
1716
- $ parameterEntryListItem ->appendChild (new DOMText ("\n " ));
1717
- $ parameterEntryListItem ->appendChild ($ listItemPara );
1718
- $ parameterEntryListItem ->appendChild (new DOMText ("\n " ));
1713
+ $ parameterEntryListItem ->append (
1714
+ "\n " ,
1715
+ $ listItemPara ,
1716
+ "\n " ,
1717
+ );
1719
1718
1720
- $ parameterEntry ->appendChild ($ parameterEntryListItem );
1721
- $ parameterEntry ->appendChild (new DOMText ("\n " ));
1719
+ $ parameterEntry = $ doc ->createElement ('varlistentry ' );
1720
+ $ parameterEntry ->append (
1721
+ "\n " ,
1722
+ $ parameterTerm ,
1723
+ "\n " ,
1724
+ $ parameterEntryListItem ,
1725
+ "\n " ,
1726
+ );
1722
1727
1723
1728
$ parametersList ->appendChild (new DOMText ("\n " ));
1724
1729
$ parametersList ->appendChild ($ parameterEntry );
@@ -1738,18 +1743,11 @@ private function getReturnValueSection(DOMDocument $doc): DOMElement {
1738
1743
1739
1744
$ returnType = $ this ->return ->getMethodSynopsisType ();
1740
1745
if ($ returnType === null ) {
1741
- $ returnDescriptionPara ->appendChild (new DOMText ("Description " ));
1746
+ $ returnDescriptionPara ->appendChild (new DOMText ("Description. " ));
1742
1747
} else if (count ($ returnType ->types ) === 1 ) {
1743
1748
$ type = $ returnType ->types [0 ];
1744
1749
$ name = $ type ->name ;
1745
- /*
1746
- $descriptionNode = match ($name) {
1747
- 'void' => $doc->createEntityReference('return.void'),
1748
- 'true' => $doc->createEntityReference('return.true.always'),
1749
- 'bool' => $doc->createEntityReference('return.success'),
1750
- default => new DOMText("Description"),
1751
- };
1752
- */
1750
+
1753
1751
switch ($ name ) {
1754
1752
case 'void ' :
1755
1753
$ descriptionNode = $ doc ->createEntityReference ('return.void ' );
@@ -1761,12 +1759,12 @@ private function getReturnValueSection(DOMDocument $doc): DOMElement {
1761
1759
$ descriptionNode = $ doc ->createEntityReference ('return.success ' );
1762
1760
break ;
1763
1761
default :
1764
- $ descriptionNode = new DOMText ("Description " );
1762
+ $ descriptionNode = new DOMText ("Description. " );
1765
1763
break ;
1766
1764
}
1767
1765
$ returnDescriptionPara ->appendChild ($ descriptionNode );
1768
1766
} else {
1769
- $ returnDescriptionPara ->appendChild (new DOMText ("Description " ));
1767
+ $ returnDescriptionPara ->appendChild (new DOMText ("Description. " ));
1770
1768
}
1771
1769
$ returnDescriptionPara ->appendChild (new DOMText ("\n " ));
1772
1770
$ returnRefSec ->appendChild ($ returnDescriptionPara );
@@ -1792,15 +1790,16 @@ private function generateDocbookInformalTable(
1792
1790
$ headerEntry = $ doc ->createElement ('entry ' );
1793
1791
$ headerEntry ->appendChild ($ header );
1794
1792
1795
- $ headerRow ->appendChild (new DOMText ("\n$ strIndent " ));
1796
- $ headerRow ->appendChild ($ headerEntry );
1793
+ $ headerRow ->append ("\n$ strIndent " , $ headerEntry );
1797
1794
}
1798
- $ headerRow ->appendChild ( new DOMText ( "\n$ strIndent " ) );
1795
+ $ headerRow ->append ( "\n$ strIndent " );
1799
1796
1800
1797
$ thead = $ doc ->createElement ('thead ' );
1801
- $ thead ->appendChild (new DOMText ("\n$ strIndent " ));
1802
- $ thead ->appendChild ($ headerRow );
1803
- $ thead ->appendChild (new DOMText ("\n$ strIndent " ));
1798
+ $ thead ->append (
1799
+ "\n$ strIndent " ,
1800
+ $ headerRow ,
1801
+ "\n$ strIndent " ,
1802
+ );
1804
1803
1805
1804
$ tbody = $ doc ->createElement ('tbody ' );
1806
1805
foreach ($ rows as $ row ) {
@@ -1814,23 +1813,29 @@ private function generateDocbookInformalTable(
1814
1813
}
1815
1814
$ bodyRow ->appendChild (new DOMText ("\n$ strIndent " ));
1816
1815
1817
- $ tbody ->appendChild (new DOMText ("\n$ strIndent " ));
1818
- $ tbody ->appendChild ($ bodyRow );
1819
- $ tbody ->appendChild (new DOMText ("\n$ strIndent " ));
1816
+ $ tbody ->append (
1817
+ "\n$ strIndent " ,
1818
+ $ bodyRow ,
1819
+ "\n$ strIndent " ,
1820
+ );
1820
1821
}
1821
1822
1822
1823
$ tgroup = $ doc ->createElement ('tgroup ' );
1823
1824
$ tgroup ->setAttribute ('cols ' , (string ) $ columns );
1824
- $ tgroup ->appendChild (new DOMText ("\n$ strIndent " ));
1825
- $ tgroup ->appendChild ($ thead );
1826
- $ tgroup ->appendChild (new DOMText ("\n$ strIndent " ));
1827
- $ tgroup ->appendChild ($ tbody );
1828
- $ tgroup ->appendChild (new DOMText ("\n$ strIndent " ));
1825
+ $ tgroup ->append (
1826
+ "\n$ strIndent " ,
1827
+ $ thead ,
1828
+ "\n$ strIndent " ,
1829
+ $ tbody ,
1830
+ "\n$ strIndent " ,
1831
+ );
1829
1832
1830
1833
$ table = $ doc ->createElement ('informaltable ' );
1831
- $ table ->appendChild (new DOMText ("\n$ strIndent " ));
1832
- $ table ->appendChild ($ tgroup );
1833
- $ table ->appendChild (new DOMText ("\n$ strIndent " ));
1834
+ $ table ->append (
1835
+ "\n$ strIndent " ,
1836
+ $ tgroup ,
1837
+ "\n$ strIndent " ,
1838
+ );
1834
1839
1835
1840
return $ table ;
1836
1841
}
@@ -1906,12 +1911,16 @@ private function getExampleSection(DOMDocument $doc, string $id): DOMElement {
1906
1911
$screen->appendChild($output);
1907
1912
$screen->append("\n ");
1908
1913
1909
- $example->append("\n ", $screen);
1910
- $example->append("\n ");
1911
-
1912
- $refSec->append($example);
1914
+ $example->append(
1915
+ "\n ",
1916
+ $screen,
1917
+ "\n ",
1918
+ );
1913
1919
1914
- $refSec->appendChild(new DOMText("\n "));
1920
+ $refSec->append(
1921
+ $example,
1922
+ "\n ",
1923
+ );
1915
1924
return $refSec;
1916
1925
}
1917
1926
0 commit comments