From ca4c9ed3345f00e8799b566d13af07904d9800a9 Mon Sep 17 00:00:00 2001 From: Jake Hotson Date: Wed, 28 Jan 2026 23:49:38 +0000 Subject: [PATCH 1/2] Don't include descriptions in the generated DocBlocks These mostly just duplicate the PHP documenation. Developers are unlikely to refer to these for the PHP documentation, and they can still inspect the return type to confirm that, e.g., `false` will not be returned. Instead, only include the type information. This reduces the size of the generated code from 6.27Mb to 2.79Mb. Part of #706. --- generator/src/XmlDocParser/Method.php | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/generator/src/XmlDocParser/Method.php b/generator/src/XmlDocParser/Method.php index 8c036559..d2376bea 100644 --- a/generator/src/XmlDocParser/Method.php +++ b/generator/src/XmlDocParser/Method.php @@ -126,14 +126,9 @@ public function getPhpDoc(): string private function getDocBlock(): string { - $str = $this->stripReturnFalseText($this->getStringForXPath("//docbook:refsect1[@role='description']/docbook:para")); - $str .= "\n\n"; - - $i=1; + $str = ''; foreach ($this->getParams() as $parameter) { - $str .= '@param '.$parameter->getDocBlockType().' $'.$parameter->getParameterName().' '; - $str .= $this->getStringForXPath("(//docbook:refsect1[@role='parameters']//docbook:varlistentry)[$i]//docbook:para")."\n"; - $i++; + $str .= '@param '.$parameter->getDocBlockType().' $'.$parameter->getParameterName()."\n"; } $str .= $this->getReturnDocBlock(); @@ -147,12 +142,9 @@ private function getDocBlock(): string public function getReturnDocBlock(): string { - $returnDoc = $this->getStringForXPath("//docbook:refsect1[@role='returnvalues']/docbook:para"); - $returnDoc = $this->stripReturnFalseText($returnDoc); - $bestReturnType = $this->getDocBlockReturnType(); if ($bestReturnType !== 'void') { - return '@return '.$bestReturnType. ' ' .$returnDoc."\n"; + return '@return '.$bestReturnType."\n"; } return ''; } From 050daf930f3bf5614203c5121d84cabfa4b35358 Mon Sep 17 00:00:00 2001 From: Jake Hotson Date: Thu, 29 Jan 2026 09:06:07 +0000 Subject: [PATCH 2/2] Silence a PHPStan warning This seems to have arisen due to a change to Stan and is unrelated to this PR. --- lib/DateTimeImmutable.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/DateTimeImmutable.php b/lib/DateTimeImmutable.php index b6bc9908..f1113998 100644 --- a/lib/DateTimeImmutable.php +++ b/lib/DateTimeImmutable.php @@ -240,6 +240,9 @@ public static function createFromMutable($dateTime): self return self::createFromRegular($date); } + /** + * @return DateTimeImmutable + */ public static function createFromInterface(\DateTimeInterface $object): self { if ($object instanceof \DateTime) {