@@ -2757,43 +2757,41 @@ public function getClassSynopsisElement(DOMDocument $doc, array $classMap, itera
2757
2757
"&InheritedProperties; "
2758
2758
);
2759
2759
2760
- $ isConcreteClassWithoutParentConstructor = $ this ->isConcreteClassWithoutParentConstructor ($ classMap );
2761
-
2762
- if ($ isConcreteClassWithoutParentConstructor || !empty ($ this ->funcInfos )) {
2760
+ if (!empty ($ this ->funcInfos )) {
2763
2761
$ classSynopsis ->appendChild (new DOMText ("\n\n " ));
2764
2762
$ classSynopsisInfo = $ doc ->createElement ("classsynopsisinfo " , "&Methods; " );
2765
2763
$ classSynopsisInfo ->setAttribute ("role " , "comment " );
2766
2764
$ classSynopsis ->appendChild ($ classSynopsisInfo );
2767
- }
2768
2765
2769
- $ classReference = self ::getClassSynopsisReference ($ this ->name );
2770
- $ escapedName = addslashes ($ this ->name ->__toString ());
2766
+ $ classReference = self ::getClassSynopsisReference ($ this ->name );
2767
+ $ escapedName = addslashes ($ this ->name ->__toString ());
2771
2768
2772
- if ( $ isConcreteClassWithoutParentConstructor || $ this ->hasConstructor ()) {
2773
- $ classSynopsis ->appendChild (new DOMText ("\n " ));
2774
- $ includeElement = $ this ->createIncludeElement (
2775
- $ doc ,
2776
- "xmlns(db=http://docbook.org/ns/docbook) xpointer(id(' $ classReference')/db:refentry/db:refsect1[@role='description']/descendant::db:constructorsynopsis[@role=' $ escapedName']) "
2777
- );
2778
- $ classSynopsis ->appendChild ($ includeElement );
2779
- }
2769
+ if ( $ this ->hasConstructor ()) {
2770
+ $ classSynopsis ->appendChild (new DOMText ("\n " ));
2771
+ $ includeElement = $ this ->createIncludeElement (
2772
+ $ doc ,
2773
+ "xmlns(db=http://docbook.org/ns/docbook) xpointer(id(' $ classReference')/db:refentry/db:refsect1[@role='description']/descendant::db:constructorsynopsis[@role=' $ escapedName']) "
2774
+ );
2775
+ $ classSynopsis ->appendChild ($ includeElement );
2776
+ }
2780
2777
2781
- if ($ this ->hasMethods ()) {
2782
- $ classSynopsis ->appendChild (new DOMText ("\n " ));
2783
- $ includeElement = $ this ->createIncludeElement (
2784
- $ doc ,
2785
- "xmlns(db=http://docbook.org/ns/docbook) xpointer(id(' $ classReference')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[@role=' $ escapedName']) "
2786
- );
2787
- $ classSynopsis ->appendChild ($ includeElement );
2788
- }
2778
+ if ($ this ->hasMethods ()) {
2779
+ $ classSynopsis ->appendChild (new DOMText ("\n " ));
2780
+ $ includeElement = $ this ->createIncludeElement (
2781
+ $ doc ,
2782
+ "xmlns(db=http://docbook.org/ns/docbook) xpointer(id(' $ classReference')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[@role=' $ escapedName']) "
2783
+ );
2784
+ $ classSynopsis ->appendChild ($ includeElement );
2785
+ }
2789
2786
2790
- if ($ this ->hasDestructor ()) {
2791
- $ classSynopsis ->appendChild (new DOMText ("\n " ));
2792
- $ includeElement = $ this ->createIncludeElement (
2793
- $ doc ,
2794
- "xmlns(db=http://docbook.org/ns/docbook) xpointer(id(' $ classReference')/db:refentry/db:refsect1[@role='description']/descendant::db:destructorsynopsis[@role=' $ escapedName']) "
2795
- );
2796
- $ classSynopsis ->appendChild ($ includeElement );
2787
+ if ($ this ->hasDestructor ()) {
2788
+ $ classSynopsis ->appendChild (new DOMText ("\n " ));
2789
+ $ includeElement = $ this ->createIncludeElement (
2790
+ $ doc ,
2791
+ "xmlns(db=http://docbook.org/ns/docbook) xpointer(id(' $ classReference')/db:refentry/db:refsect1[@role='description']/descendant::db:destructorsynopsis[@role=' $ escapedName']) "
2792
+ );
2793
+ $ classSynopsis ->appendChild ($ includeElement );
2794
+ }
2797
2795
}
2798
2796
2799
2797
if (!empty ($ parentsWithInheritedMethods )) {
@@ -2826,31 +2824,6 @@ public function getClassSynopsisElement(DOMDocument $doc, array $classMap, itera
2826
2824
return $ classSynopsis ;
2827
2825
}
2828
2826
2829
- /**
2830
- * @param array<string, ClassInfo> $classMap
2831
- */
2832
- public function getNonExistentDefaultConstructorForManual (array $ classMap ): ?FuncInfo {
2833
- if (!$ this ->isConcreteClassWithoutParentConstructor ($ classMap ) || $ this ->hasConstructor ()) {
2834
- return null ;
2835
- }
2836
-
2837
- return new FuncInfo (
2838
- new MethodName ($ this ->name , "__construct " ),
2839
- $ this ->flags ,
2840
- 0 ,
2841
- null ,
2842
- null ,
2843
- false ,
2844
- false ,
2845
- true ,
2846
- [],
2847
- new ReturnInfo (false , null , null , false , null ),
2848
- 0 ,
2849
- null ,
2850
- false
2851
- );
2852
- }
2853
-
2854
2827
private static function createOoElement (
2855
2828
DOMDocument $ doc ,
2856
2829
ClassInfo $ classInfo ,
@@ -3031,13 +3004,6 @@ private function hasMethods(): bool
3031
3004
return false ;
3032
3005
}
3033
3006
3034
- /**
3035
- * @param array<string, ClassInfo> $classMap
3036
- */
3037
- private function isConcreteClassWithoutParentConstructor (array $ classMap ) {
3038
- return $ this ->type === "class " && !($ this ->flags & Class_::MODIFIER_ABSTRACT ) && !$ this ->hasParentConstructor ($ classMap );
3039
- }
3040
-
3041
3007
private function createIncludeElement (DOMDocument $ doc , string $ query ): DOMElement
3042
3008
{
3043
3009
$ includeElement = $ doc ->createElement ("xi:include " );
@@ -3115,18 +3081,6 @@ public function getAllFuncInfos(): iterable {
3115
3081
}
3116
3082
}
3117
3083
3118
- /**
3119
- * @return array<string, ClassInfo> $classMap
3120
- */
3121
- public function getAllNonExistentDefaultConstructorsForManual (array $ classMap ): iterable {
3122
- foreach ($ this ->classInfos as $ classInfo ) {
3123
- $ funcInfo = $ classInfo ->getNonExistentDefaultConstructorForManual ($ classMap );
3124
- if ($ funcInfo !== null ) {
3125
- yield $ funcInfo ;
3126
- }
3127
- }
3128
- }
3129
-
3130
3084
/**
3131
3085
* @return iterable<ConstInfo>
3132
3086
*/
@@ -4792,15 +4746,6 @@ function initPhpParser() {
4792
4746
}
4793
4747
}
4794
4748
4795
- /** @var array<string, FuncInfo> $funcMapForManual */
4796
- $ funcMapForManual = $ funcMap ;
4797
-
4798
- foreach ($ fileInfos as $ fileInfo ) {
4799
- foreach ($ fileInfo ->getAllNonExistentDefaultConstructorsForManual ($ classMap ) as $ funcInfo ) {
4800
- $ funcMapForManual [$ funcInfo ->name ->__toString ()] = $ funcInfo ;
4801
- }
4802
- }
4803
-
4804
4749
if ($ verify ) {
4805
4750
$ errors = [];
4806
4751
@@ -4916,7 +4861,7 @@ function(?ArgInfo $aliasArg, ?ArgInfo $aliasedArg) use ($aliasFunc, $aliasedFunc
4916
4861
if ($ generateMethodSynopses ) {
4917
4862
$ methodSynopsesDirectory = getcwd () . "/methodsynopses " ;
4918
4863
4919
- $ methodSynopses = generateMethodSynopses ($ funcMapForManual , $ aliasMap );
4864
+ $ methodSynopses = generateMethodSynopses ($ funcMap , $ aliasMap );
4920
4865
if (!empty ($ methodSynopses )) {
4921
4866
if (!file_exists ($ methodSynopsesDirectory )) {
4922
4867
mkdir ($ methodSynopsesDirectory );
@@ -4931,7 +4876,7 @@ function(?ArgInfo $aliasArg, ?ArgInfo $aliasedArg) use ($aliasFunc, $aliasedFunc
4931
4876
}
4932
4877
4933
4878
if ($ replaceMethodSynopses ) {
4934
- $ methodSynopses = replaceMethodSynopses ($ targetSynopses , $ funcMapForManual , $ aliasMap , $ verify );
4879
+ $ methodSynopses = replaceMethodSynopses ($ targetSynopses , $ funcMap , $ aliasMap , $ verify );
4935
4880
4936
4881
foreach ($ methodSynopses as $ filename => $ content ) {
4937
4882
if (file_put_contents ($ filename , $ content )) {
0 commit comments