From cb93a3c5ec1680f65a4267933d3752458ece7900 Mon Sep 17 00:00:00 2001 From: "Alexander M. Turek" Date: Wed, 26 Jun 2024 13:17:20 +0200 Subject: [PATCH 1/2] Reuse the SqlFormatter instance (#1436) --- src/Generator/SqlGenerator.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/Generator/SqlGenerator.php b/src/Generator/SqlGenerator.php index 1501e3a6e..2a87cbee0 100644 --- a/src/Generator/SqlGenerator.php +++ b/src/Generator/SqlGenerator.php @@ -27,6 +27,8 @@ */ class SqlGenerator { + private SqlFormatter|null $formatter = null; + public function __construct( private readonly Configuration $configuration, private readonly AbstractPlatform $platform, @@ -55,7 +57,7 @@ public function generate( $maxLength = $lineLength - 18 - 8; // max - php code length - indentation if (strlen($query) > $maxLength) { - $query = (new SqlFormatter(new NullHighlighter()))->format($query); + $query = $this->formatQuery($query); } } @@ -84,4 +86,11 @@ public function generate( return implode("\n", $code); } + + private function formatQuery(string $query): string + { + $this->formatter ??= new SqlFormatter(new NullHighlighter()); + + return $this->formatter->format($query); + } } From 535a70dcbd88b8c6ba945be050977457f4f4c06c Mon Sep 17 00:00:00 2001 From: "Alexander M. Turek" Date: Wed, 26 Jun 2024 16:12:46 +0200 Subject: [PATCH 2/2] Prepare the 3.8.0 release (#1438) --- .doctrine-project.json | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.doctrine-project.json b/.doctrine-project.json index 7c000199e..a6d224576 100644 --- a/.doctrine-project.json +++ b/.doctrine-project.json @@ -4,17 +4,23 @@ "slug": "migrations", "docsSlug": "doctrine-migrations", "versions": [ + { + "name": "3.9", + "branchName": "3.9.x", + "slug": "3.9", + "upcoming": true + }, { "name": "3.8", "branchName": "3.8.x", "slug": "3.8", - "upcoming": true + "current": true }, { "name": "3.7", "branchName": "3.7.x", "slug": "3.7", - "current": true + "maintained": false }, { "name": "3.6",