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