From 61a871cfbaf72357919b7b6035f0400873122280 Mon Sep 17 00:00:00 2001 From: Shish Date: Thu, 5 Dec 2024 12:11:48 +0000 Subject: [PATCH] Generate code which better matches our formatting standards Currently we generate it wrong and then the auto-formatter fixes it -- generating it correctly in the first place isn't hard though --- generator/src/FileCreator.php | 5 ++--- generator/src/Parameter.php | 10 +++++----- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/generator/src/FileCreator.php b/generator/src/FileCreator.php index 610cd107..bc90f12e 100644 --- a/generator/src/FileCreator.php +++ b/generator/src/FileCreator.php @@ -35,10 +35,9 @@ public function generatePhpFile(array $functions, string $path): void \fwrite($stream, "getDefaultValue() === "null") { - return true; - } - - return $this->getDefaultValue() === "NULL"; + return ($this->getDefaultValue() === "null"); } /* @@ -114,6 +110,10 @@ public function getDefaultValue(): ?string return null; } + if ($initializer === "NULL") { + return "null"; + } + return $initializer; }