Skip to content

Commit

Permalink
fix cs
Browse files Browse the repository at this point in the history
  • Loading branch information
ol0lll committed Aug 27, 2024
1 parent 9d5c288 commit 4768a46
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions BackendCommands.php
Original file line number Diff line number Diff line change
Expand Up @@ -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

Check failure on line 59 in BackendCommands.php

View workflow job for this annotation

GitHub Actions / PHPCS

Expected 5 spaces after parameter type; 1 found
* @param \Consolidation\AnnotatedCommand\AnnotationData $annotationData
*/
public function optionsBackend(Command $command, AnnotationData $annotationData)
{
Expand Down Expand Up @@ -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 = <<<EOF
$defaultSettingsFile = $this->drupalRootDirectory().'/sites/default/settings.php';
if (!file_exists($defaultSettingsFile)) {
$fileString = <<<EOF

Check failure on line 358 in BackendCommands.php

View workflow job for this annotation

GitHub Actions / PHPCS

Line indented incorrectly; expected at least 12 spaces, found 10
<?php
\$databases['default']['default'] = [
'database' => '{{ database }}',
Expand All @@ -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);
}
}

Expand Down

0 comments on commit 4768a46

Please sign in to comment.