From 81cd8ed9cd209d2edaf38229bf5cf8f8cd8d10c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20FIDRY?= <5175937+theofidry@users.noreply.github.com> Date: Mon, 10 Jun 2024 10:33:43 +0200 Subject: [PATCH] fix: Fix PrettyPrinterAbstract param PHPDoc The code actually handles `null` values by making use of the `??` operator to assign fallback values. --- lib/PhpParser/PrettyPrinterAbstract.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/PhpParser/PrettyPrinterAbstract.php b/lib/PhpParser/PrettyPrinterAbstract.php index 8303c427aa..f51c4bc25b 100644 --- a/lib/PhpParser/PrettyPrinterAbstract.php +++ b/lib/PhpParser/PrettyPrinterAbstract.php @@ -162,16 +162,16 @@ abstract class PrettyPrinterAbstract implements PrettyPrinter { * Creates a pretty printer instance using the given options. * * Supported options: - * * PhpVersion $phpVersion: The PHP version to target (default to PHP 7.4). This option - * controls compatibility of the generated code with older PHP - * versions in cases where a simple stylistic choice exists (e.g. - * array() vs []). It is safe to pretty-print an AST for a newer - * PHP version while specifying an older target (but the result will - * of course not be compatible with the older version in that case). - * * string $newline: The newline style to use. Should be "\n" (default) or "\r\n". - * * bool $shortArraySyntax: Whether to use [] instead of array() as the default array - * syntax, if the node does not specify a format. Defaults to whether - * the phpVersion support short array syntax. + * * PhpVersion|null $phpVersion: The PHP version to target (default to PHP 7.4). This option + * controls compatibility of the generated code with older PHP + * versions in cases where a simple stylistic choice exists (e.g. + * array() vs []). It is safe to pretty-print an AST for a newer + * PHP version while specifying an older target (but the result will + * of course not be compatible with the older version in that case). + * * string|null $newline: The newline style to use. Should be "\n" (default) or "\r\n". + * * bool|null $shortArraySyntax: Whether to use [] instead of array() as the default array + * syntax, if the node does not specify a format. Defaults to whether + * the phpVersion support short array syntax. * * @param array{ * phpVersion?: PhpVersion, newline?: string, shortArraySyntax?: bool