@@ -1540,9 +1540,9 @@ public function getFieldSynopsisElement(DOMDocument $doc): DOMElement
1540
1540
$ fieldsynopsisElement ->appendChild (new DOMText ("\n " ));
1541
1541
$ fieldsynopsisElement ->appendChild ($ this ->getFieldSynopsisType ()->getTypeForDoc ($ doc ));
1542
1542
1543
- $ className = str_replace ("\\" , "- " , $ this ->name ->class ->toLowerString ());
1543
+ $ className = str_replace ([ "\\" , "_ " ], [ " - " , " - " ] , $ this ->name ->class ->toLowerString ());
1544
1544
$ varnameElement = $ doc ->createElement ("varname " , $ this ->name ->property );
1545
- $ varnameElement ->setAttribute ("linkend " , "$ className.props. " . strtolower ($ this ->name ->property ));
1545
+ $ varnameElement ->setAttribute ("linkend " , "$ className.props. " . strtolower (str_replace ( " _ " , " - " , $ this ->name ->property ) ));
1546
1546
$ fieldsynopsisElement ->appendChild (new DOMText ("\n " ));
1547
1547
$ fieldsynopsisElement ->appendChild ($ varnameElement );
1548
1548
@@ -1558,14 +1558,14 @@ public function getFieldSynopsisElement(DOMDocument $doc): DOMElement
1558
1558
}
1559
1559
1560
1560
private function getFieldSynopsisType (): Type {
1561
- if ($ this ->type ) {
1562
- return $ this ->type ;
1563
- }
1564
-
1565
1561
if ($ this ->phpDocType ) {
1566
1562
return $ this ->phpDocType ;
1567
1563
}
1568
1564
1565
+ if ($ this ->type ) {
1566
+ return $ this ->type ;
1567
+ }
1568
+
1569
1569
throw new Exception ("A property must have a type " );
1570
1570
}
1571
1571
@@ -2005,11 +2005,11 @@ private static function createOoElement(
2005
2005
}
2006
2006
2007
2007
public static function getClassSynopsisFilename (Name $ name ): string {
2008
- return strtolower (implode ('- ' , $ name ->parts ));
2008
+ return strtolower (str_replace ( " _ " , " - " , implode ('- ' , $ name ->parts ) ));
2009
2009
}
2010
2010
2011
2011
public static function getClassSynopsisReference (Name $ name ): string {
2012
- return "class. " . strtolower ( implode ( ' - ' , $ name-> parts ) );
2012
+ return "class. " . self :: getClassSynopsisFilename ( $ name );
2013
2013
}
2014
2014
2015
2015
/**
@@ -2019,10 +2019,6 @@ public static function getClassSynopsisReference(Name $name): string {
2019
2019
*/
2020
2020
private function collectInheritedMembers (array &$ parentsWithInheritedProperties , array &$ parentsWithInheritedMethods , array $ classMap ): void
2021
2021
{
2022
- if ($ this ->type !== "class " ) {
2023
- return ;
2024
- }
2025
-
2026
2022
foreach ($ this ->extends as $ parent ) {
2027
2023
$ parentInfo = $ classMap [$ parent ->toString ()] ?? null ;
2028
2024
if (!$ parentInfo ) {
@@ -2033,7 +2029,7 @@ private function collectInheritedMembers(array &$parentsWithInheritedProperties,
2033
2029
$ parentsWithInheritedProperties [$ parent ->toString ()] = $ parent ;
2034
2030
}
2035
2031
2036
- if (!empty ( $ parentInfo -> funcInfos ) && ! isset ($ parentsWithInheritedMethods [$ parent ->toString ()])) {
2032
+ if (!isset ($ parentsWithInheritedMethods [$ parent ->toString ()]) && $ parentInfo -> hasMethods ( )) {
2037
2033
$ parentsWithInheritedMethods [$ parent ->toString ()] = $ parent ;
2038
2034
}
2039
2035
@@ -2986,12 +2982,14 @@ function replaceClassSynopses(string $targetDirectory, array $classMap): array
2986
2982
$ replacedXml = preg_replace (
2987
2983
[
2988
2984
"/REPLACED-ENTITY-([A-Za-z0-9._{}%-]+?;)/ " ,
2985
+ "/<phpdoc:(classref|exceptionref)\s+xmlns:phpdoc= \"([a-z0-9.:\/]+) \"\s+xmlns= \"([a-z0-9.:\/]+) \"\s+xml:id= \"([a-z0-9._-]+) \"\s*>/i " ,
2989
2986
"/<phpdoc:(classref|exceptionref)\s+xmlns:phpdoc= \"([a-z0-9.:\/]+) \"\s+xmlns= \"([a-z0-9.:\/]+) \"\s+xmlns:xi= \"([a-z0-9.:\/]+) \"\s+xml:id= \"([a-z0-9._-]+) \"\s*>/i " ,
2990
2987
"/<phpdoc:(classref|exceptionref)\s+xmlns:phpdoc= \"([a-z0-9.:\/]+) \"\s+xmlns= \"([a-z0-9.:\/]+) \"\s+xmlns:xlink= \"([a-z0-9.:\/]+) \"\s+xmlns:xi= \"([a-z0-9.:\/]+) \"\s+xml:id= \"([a-z0-9._-]+) \"\s*>/i " ,
2991
2988
"/<phpdoc:(classref|exceptionref)\s+xmlns= \"([a-z0-9.:\/]+) \"\s+xmlns:xlink= \"([a-z0-9.:\/]+) \"\s+xmlns:xi= \"([a-z0-9.:\/]+) \"\s+xmlns:phpdoc= \"([a-z0-9.:\/]+) \"\s+xml:id= \"([a-z0-9._-]+) \"\s*>/i " ,
2992
2989
],
2993
2990
[
2994
2991
"&$1 " ,
2992
+ "<phpdoc:$1 xml:id= \"$4 \" xmlns:phpdoc= \"$2 \" xmlns= \"$3 \"> " ,
2995
2993
"<phpdoc:$1 xml:id= \"$5 \" xmlns:phpdoc= \"$2 \" xmlns= \"$3 \" xmlns:xi= \"$4 \"> " ,
2996
2994
"<phpdoc:$1 xml:id= \"$6 \" xmlns:phpdoc= \"$2 \" xmlns= \"$3 \" xmlns:xlink= \"$4 \" xmlns:xi= \"$5 \"> " ,
2997
2995
"<phpdoc:$1 xml:id= \"$6 \" xmlns:phpdoc= \"$5 \" xmlns= \"$2 \" xmlns:xlink= \"$3 \" xmlns:xi= \"$4 \"> " ,
0 commit comments