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