From 4768a46146d1dfb4a62f21c25ed2cc6248f9f6a2 Mon Sep 17 00:00:00 2001 From: Killesreiter Volker Date: Tue, 27 Aug 2024 10:50:18 +0200 Subject: [PATCH] fix cs --- BackendCommands.php | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/BackendCommands.php b/BackendCommands.php index 3b17d81..3c06bf3 100644 --- a/BackendCommands.php +++ b/BackendCommands.php @@ -56,7 +56,8 @@ public function initCommands(InputInterface $input, AnnotationData $annotationDa * * @option project-directory The base directory of the project. Defaults to composer root of project. * - * @param array $options + * @param \Symfony\Component\Console\Command\Command $command + * @param \Consolidation\AnnotatedCommand\AnnotationData $annotationData */ public function optionsBackend(Command $command, AnnotationData $annotationData) { @@ -352,9 +353,9 @@ public function createTestingDump() $dbSpec = $sql->getDbSpec(); $dbUrl = $dbSpec['driver'].'://'.$dbSpec['username'].':'.$dbSpec['password'].'@'.$dbSpec['host'].':'.$dbSpec['port'].'/'.$dbSpec['database']; - $default_settings_file = $this->drupalRootDirectory() . '/sites/default/settings.php'; - if (!file_exists($default_settings_file)) { - $file_string = <<drupalRootDirectory().'/sites/default/settings.php'; + if (!file_exists($defaultSettingsFile)) { + $fileString = << '{{ database }}', @@ -367,16 +368,16 @@ public function createTestingDump() 'driver' => '{{ driver }}', ]; EOF; - $file_string = str_replace(['{{ database }}', '{{ username }}', '{{ password }}', '{{ host }}', '{{ port }}', '{{ driver }}'], [$dbSpec['database'], $dbSpec['username'], $dbSpec['password'], $dbSpec['host'], $dbSpec['port'], $dbSpec['driver']], $file_string); + $fileString = str_replace(['{{ database }}', '{{ username }}', '{{ password }}', '{{ host }}', '{{ port }}', '{{ driver }}'], [$dbSpec['database'], $dbSpec['username'], $dbSpec['password'], $dbSpec['host'], $dbSpec['port'], $dbSpec['driver']], $fileString); - $default_settings_file_created = - file_put_contents($default_settings_file, $file_string); + $defaultSettingsFileCreated = + file_put_contents($defaultSettingsFile, $fileString); } $this->process(['php', 'core/scripts/db-tools.php', 'dump-database-d8-mysql', '--database-url', $dbUrl], $this->drupalRootDirectory()); - if (!empty($default_settings_file_created)) { - unlink($default_settings_file); + if (!empty($defaultSettingsFileCreated)) { + unlink($defaultSettingsFile); } }