chore: heredoc indentation as of PHP 7.3

https://www.php.net/manual/en/language.types.string.php#language.types.string.syntax.heredoc
This commit is contained in:
Dariusz Ruminski
2025-08-10 00:28:14 +02:00
parent 13fdf12a96
commit 4a53037ff2
4 changed files with 29 additions and 29 deletions

View File

@@ -54,15 +54,15 @@ final class DebugCommand extends Command
new InputArgument('filter', InputArgument::OPTIONAL, 'The name of an environment variable or a filter.', null, $this->getAvailableVars(...)),
])
->setHelp(<<<'EOT'
The <info>%command.full_name%</info> command displays all the environment variables configured by dotenv:
The <info>%command.full_name%</info> command displays all the environment variables configured by dotenv:
<info>php %command.full_name%</info>
<info>php %command.full_name%</info>
To get specific variables, specify its full or partial name:
To get specific variables, specify its full or partial name:
<info>php %command.full_name% FOO_BAR</info>
<info>php %command.full_name% FOO_BAR</info>
EOT
EOT
);
}

View File

@@ -44,10 +44,10 @@ final class DotenvDumpCommand extends Command
])
->addOption('empty', null, InputOption::VALUE_NONE, 'Ignore the content of .env files')
->setHelp(<<<'EOT'
The <info>%command.name%</info> command compiles .env files into a PHP-optimized file called .env.local.php.
The <info>%command.name%</info> command compiles .env files into a PHP-optimized file called .env.local.php.
<info>%command.full_name%</info>
EOT
<info>%command.full_name%</info>
EOT
)
;
}
@@ -75,13 +75,13 @@ EOT
$vars = var_export($vars, true);
$vars = <<<EOF
<?php
<?php
// This file was generated by running "php bin/console dotenv:dump $env"
// This file was generated by running "php bin/console dotenv:dump $env"
return $vars;
return $vars;
EOF;
EOF;
file_put_contents($dotenvPath.'.local.php', $vars, \LOCK_EX);
$output->writeln(\sprintf('Successfully dumped .env files in <info>.env.local.php</> for the <info>%s</> environment.', $env));

View File

@@ -47,17 +47,17 @@ class DebugCommandTest extends TestCase
$tester = new CommandTester($command);
$tester->execute([]);
$expectedFormat = <<<'OUTPUT'
%a
---------- ------- ------------ ------%S
Variable Value .env.local .env%S
---------- ------- ------------ ------%S
FOO baz bar%S
TEST123 n/a true%S
---------- ------- ------------ ------%S
%a
---------- ------- ------------ ------%S
Variable Value .env.local .env%S
---------- ------- ------------ ------%S
FOO baz bar%S
TEST123 n/a true%S
---------- ------- ------------ ------%S
// Note that values might be different between web and CLI.%S
%a
OUTPUT;
// Note that values might be different between web and CLI.%S
%a
OUTPUT;
$this->assertStringMatchesFormat($expectedFormat, $tester->getDisplay());
}

View File

@@ -21,14 +21,14 @@ class DotenvDumpCommandTest extends TestCase
protected function setUp(): void
{
file_put_contents(__DIR__.'/.env', <<<EOF
APP_ENV=dev
APP_SECRET=abc123
EOF
APP_ENV=dev
APP_SECRET=abc123
EOF
);
file_put_contents(__DIR__.'/.env.local', <<<EOF
APP_LOCAL=yes
EOF
APP_LOCAL=yes
EOF
);
}
@@ -73,8 +73,8 @@ EOF
public function testExecuteTestEnvs()
{
file_put_contents(__DIR__.'/composer.json', <<<EOF
{"extra":{"runtime":{"test_envs":[]}}}
EOF
{"extra":{"runtime":{"test_envs":[]}}}
EOF
);
$command = $this->createCommand();