@@ -1548,9 +1548,9 @@ public function getFieldSynopsisElement(DOMDocument $doc): DOMElement
1548
1548
$ fieldsynopsisElement ->appendChild (new DOMText ("\n " ));
1549
1549
$ fieldsynopsisElement ->appendChild ($ this ->getFieldSynopsisType ()->getTypeForDoc ($ doc ));
1550
1550
1551
- $ className = str_replace ("\\" , "- " , $ this ->name ->class ->toLowerString ());
1551
+ $ className = str_replace ([ "\\" , "_ " ], [ " - " , " - " ] , $ this ->name ->class ->toLowerString ());
1552
1552
$ varnameElement = $ doc ->createElement ("varname " , $ this ->name ->property );
1553
- $ varnameElement ->setAttribute ("linkend " , "$ className.props. " . strtolower ($ this ->name ->property ));
1553
+ $ varnameElement ->setAttribute ("linkend " , "$ className.props. " . strtolower (str_replace ( " _ " , " - " , $ this ->name ->property ) ));
1554
1554
$ fieldsynopsisElement ->appendChild (new DOMText ("\n " ));
1555
1555
$ fieldsynopsisElement ->appendChild ($ varnameElement );
1556
1556
@@ -1566,14 +1566,14 @@ public function getFieldSynopsisElement(DOMDocument $doc): DOMElement
1566
1566
}
1567
1567
1568
1568
private function getFieldSynopsisType (): Type {
1569
- if ($ this ->type ) {
1570
- return $ this ->type ;
1571
- }
1572
-
1573
1569
if ($ this ->phpDocType ) {
1574
1570
return $ this ->phpDocType ;
1575
1571
}
1576
1572
1573
+ if ($ this ->type ) {
1574
+ return $ this ->type ;
1575
+ }
1576
+
1577
1577
throw new Exception ("A property must have a type " );
1578
1578
}
1579
1579
@@ -2013,11 +2013,11 @@ private static function createOoElement(
2013
2013
}
2014
2014
2015
2015
public static function getClassSynopsisFilename (Name $ name ): string {
2016
- return strtolower (implode ('- ' , $ name ->parts ));
2016
+ return strtolower (str_replace ( " _ " , " - " , implode ('- ' , $ name ->parts ) ));
2017
2017
}
2018
2018
2019
2019
public static function getClassSynopsisReference (Name $ name ): string {
2020
- return "class. " . strtolower ( implode ( ' - ' , $ name-> parts ) );
2020
+ return "class. " . self :: getClassSynopsisFilename ( $ name );
2021
2021
}
2022
2022
2023
2023
/**
@@ -2027,10 +2027,6 @@ public static function getClassSynopsisReference(Name $name): string {
2027
2027
*/
2028
2028
private function collectInheritedMembers (array &$ parentsWithInheritedProperties , array &$ parentsWithInheritedMethods , array $ classMap ): void
2029
2029
{
2030
- if ($ this ->type !== "class " ) {
2031
- return ;
2032
- }
2033
-
2034
2030
foreach ($ this ->extends as $ parent ) {
2035
2031
$ parentInfo = $ classMap [$ parent ->toString ()] ?? null ;
2036
2032
if (!$ parentInfo ) {
@@ -2041,7 +2037,7 @@ private function collectInheritedMembers(array &$parentsWithInheritedProperties,
2041
2037
$ parentsWithInheritedProperties [$ parent ->toString ()] = $ parent ;
2042
2038
}
2043
2039
2044
- if (!empty ( $ parentInfo -> funcInfos ) && ! isset ($ parentsWithInheritedMethods [$ parent ->toString ()])) {
2040
+ if (!isset ($ parentsWithInheritedMethods [$ parent ->toString ()]) && $ parentInfo -> hasMethods ( )) {
2045
2041
$ parentsWithInheritedMethods [$ parent ->toString ()] = $ parent ;
2046
2042
}
2047
2043
@@ -2998,12 +2994,14 @@ function replaceClassSynopses(string $targetDirectory, array $classMap): array
2998
2994
$ replacedXml = preg_replace (
2999
2995
[
3000
2996
"/REPLACED-ENTITY-([A-Za-z0-9._{}%-]+?;)/ " ,
2997
+ "/<phpdoc:(classref|exceptionref)\s+xmlns:phpdoc= \"([a-z0-9.:\/]+) \"\s+xmlns= \"([a-z0-9.:\/]+) \"\s+xml:id= \"([a-z0-9._-]+) \"\s*>/i " ,
3001
2998
"/<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 " ,
3002
2999
"/<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 " ,
3003
3000
"/<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 " ,
3004
3001
],
3005
3002
[
3006
3003
"&$1 " ,
3004
+ "<phpdoc:$1 xml:id= \"$4 \" xmlns:phpdoc= \"$2 \" xmlns= \"$3 \"> " ,
3007
3005
"<phpdoc:$1 xml:id= \"$5 \" xmlns:phpdoc= \"$2 \" xmlns= \"$3 \" xmlns:xi= \"$4 \"> " ,
3008
3006
"<phpdoc:$1 xml:id= \"$6 \" xmlns:phpdoc= \"$2 \" xmlns= \"$3 \" xmlns:xlink= \"$4 \" xmlns:xi= \"$5 \"> " ,
3009
3007
"<phpdoc:$1 xml:id= \"$6 \" xmlns:phpdoc= \"$5 \" xmlns= \"$2 \" xmlns:xlink= \"$3 \" xmlns:xi= \"$4 \"> " ,
0 commit comments