@@ -2658,41 +2658,35 @@ protected function getFieldSynopsisValueString(array $allConstInfos): ?string
2658
2658
return $ this ->valueString ;
2659
2659
}
2660
2660
2661
- public function getPredefinedConstantTerm (DOMDocument $ doc , int $ indentationLevel ): DOMElement {
2661
+ private function getPredefinedConstantElement (
2662
+ DOMDocument $ doc ,
2663
+ int $ indentationLevel ,
2664
+ string $ name
2665
+ ): DOMElement {
2662
2666
$ indentation = str_repeat (" " , $ indentationLevel );
2663
2667
2664
- $ termElement = $ doc ->createElement (" term " );
2668
+ $ element = $ doc ->createElement ($ name );
2665
2669
2666
2670
$ constantElement = $ doc ->createElement ("constant " );
2667
2671
$ constantElement ->textContent = $ this ->name ->__toString ();
2668
2672
2669
2673
$ typeElement = ($ this ->phpDocType ?? $ this ->type )->getTypeForDoc ($ doc );
2670
2674
2671
- $ termElement ->appendChild (new DOMText ("\n$ indentation " ));
2672
- $ termElement ->appendChild ($ constantElement );
2673
- $ termElement ->appendChild (new DOMText ("\n$ indentation ( " ));
2674
- $ termElement ->appendChild ($ typeElement );
2675
- $ termElement ->appendChild (new DOMText (") \n$ indentation " ));
2675
+ $ element ->appendChild (new DOMText ("\n$ indentation " ));
2676
+ $ element ->appendChild ($ constantElement );
2677
+ $ element ->appendChild (new DOMText ("\n$ indentation ( " ));
2678
+ $ element ->appendChild ($ typeElement );
2679
+ $ element ->appendChild (new DOMText (") \n$ indentation " ));
2676
2680
2677
- return $ termElement ;
2681
+ return $ element ;
2678
2682
}
2679
2683
2680
- public function getPredefinedConstantEntry (DOMDocument $ doc , int $ indentationLevel ): DOMElement {
2681
- $ indentation = str_repeat (" " , $ indentationLevel );
2682
-
2683
- $ entryElement = $ doc ->createElement ("entry " );
2684
-
2685
- $ constantElement = $ doc ->createElement ("constant " );
2686
- $ constantElement ->textContent = $ this ->name ->__toString ();
2687
- $ typeElement = ($ this ->phpDocType ?? $ this ->type )->getTypeForDoc ($ doc );
2688
-
2689
- $ entryElement ->appendChild (new DOMText ("\n$ indentation " ));
2690
- $ entryElement ->appendChild ($ constantElement );
2691
- $ entryElement ->appendChild (new DOMText ("\n$ indentation ( " ));
2692
- $ entryElement ->appendChild ($ typeElement );
2693
- $ entryElement ->appendChild (new DOMText (") \n$ indentation " ));
2684
+ public function getPredefinedConstantTerm (DOMDocument $ doc , int $ indentationLevel ): DOMElement {
2685
+ return $ this ->getPredefinedConstantElement ($ doc , $ indentationLevel , "term " );
2686
+ }
2694
2687
2695
- return $ entryElement ;
2688
+ public function getPredefinedConstantEntry (DOMDocument $ doc , int $ indentationLevel ): DOMElement {
2689
+ return $ this ->getPredefinedConstantElement ($ doc , $ indentationLevel , "entry " );
2696
2690
}
2697
2691
2698
2692
public function discardInfoForOldPhpVersions (?int $ phpVersionIdMinimumCompatibility ): void {
0 commit comments