@@ -1777,7 +1777,7 @@ public function getClassSynopsisElement(DOMDocument $doc, array $classMap): ?DOM
1777
1777
$ classSynopsis = $ doc ->createElement ("classsynopsis " );
1778
1778
$ classSynopsis ->appendChild (new DOMText ("\n " ));
1779
1779
1780
- $ ooElement = self ::createOoElement ($ doc , $ this , false , false , 4 );
1780
+ $ ooElement = self ::createOoElement ($ doc , $ this , true , false , false , 4 );
1781
1781
if (!$ ooElement ) {
1782
1782
return null ;
1783
1783
}
@@ -1786,7 +1786,7 @@ public function getClassSynopsisElement(DOMDocument $doc, array $classMap): ?DOM
1786
1786
1787
1787
$ classSynopsisInfo = $ doc ->createElement ("classsynopsisinfo " );
1788
1788
$ classSynopsisInfo ->appendChild (new DOMText ("\n " ));
1789
- $ ooElement = self ::createOoElement ($ doc , $ this , true , false , 5 );
1789
+ $ ooElement = self ::createOoElement ($ doc , $ this , false , true , false , 5 );
1790
1790
if (!$ ooElement ) {
1791
1791
return null ;
1792
1792
}
@@ -1800,7 +1800,14 @@ public function getClassSynopsisElement(DOMDocument $doc, array $classMap): ?DOM
1800
1800
throw new Exception ("Missing parent class " . $ parent ->toString ());
1801
1801
}
1802
1802
1803
- $ ooElement = self ::createOoElement ($ doc , $ parentInfo , false , $ k === 0 && $ parentInfo ->type === "class " , 5 );
1803
+ $ ooElement = self ::createOoElement (
1804
+ $ doc ,
1805
+ $ parentInfo ,
1806
+ $ this ->type === "interface " ,
1807
+ false ,
1808
+ $ k === 0 ,
1809
+ 5
1810
+ );
1804
1811
if (!$ ooElement ) {
1805
1812
return null ;
1806
1813
}
@@ -1815,7 +1822,7 @@ public function getClassSynopsisElement(DOMDocument $doc, array $classMap): ?DOM
1815
1822
throw new Exception ("Missing implemented interface " . $ interface ->toString ());
1816
1823
}
1817
1824
1818
- $ ooElement = self ::createOoElement ($ doc , $ interfaceInfo , false , false , 5 );
1825
+ $ ooElement = self ::createOoElement ($ doc , $ interfaceInfo , false , false , false , 5 );
1819
1826
if (!$ ooElement ) {
1820
1827
return null ;
1821
1828
}
@@ -1922,6 +1929,7 @@ public function getClassSynopsisElement(DOMDocument $doc, array $classMap): ?DOM
1922
1929
private static function createOoElement (
1923
1930
DOMDocument $ doc ,
1924
1931
ClassInfo $ classInfo ,
1932
+ bool $ overrideToClass ,
1925
1933
bool $ withModifiers ,
1926
1934
bool $ isExtends ,
1927
1935
int $ indentationLevel
@@ -1933,7 +1941,9 @@ private static function createOoElement(
1933
1941
return null ;
1934
1942
}
1935
1943
1936
- $ ooElement = $ doc ->createElement ('oo ' . $ classInfo ->type );
1944
+ $ type = $ overrideToClass ? "class " : $ classInfo ->type ;
1945
+
1946
+ $ ooElement = $ doc ->createElement ("oo $ type " );
1937
1947
$ ooElement ->appendChild (new DOMText ("\n$ indentation " ));
1938
1948
if ($ isExtends ) {
1939
1949
$ ooElement ->appendChild ($ doc ->createElement ('modifier ' , 'extends ' ));
@@ -1949,7 +1959,7 @@ private static function createOoElement(
1949
1959
}
1950
1960
}
1951
1961
1952
- $ nameElement = $ doc ->createElement ($ classInfo -> type . ' name ' , $ classInfo ->name ->toString ());
1962
+ $ nameElement = $ doc ->createElement ("{ $ type} name " , $ classInfo ->name ->toString ());
1953
1963
$ ooElement ->appendChild ($ nameElement );
1954
1964
$ ooElement ->appendChild (new DOMText ("\n$ indentation " ));
1955
1965
0 commit comments