Skip to content

Commit f926695

Browse files
Merge branch '4.3'
2 parents a3e69ca + 67a491d commit f926695

File tree

4 files changed

+11
-3
lines changed

4 files changed

+11
-3
lines changed

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ install:
33
@docker run -it -w /data -v ${PWD}:/data:delegated -v ~/.composer:/root/.composer:delegated --entrypoint composer --rm registry.gitlab.com/grahamcampbell/php:8.2-base bin all update
44

55
phpunit:
6-
@rm -f bootstrap/cache/*.php && docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint vendor/bin/phpunit --rm registry.gitlab.com/grahamcampbell/php:8.2-cli
6+
@docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint vendor/bin/phpunit --rm registry.gitlab.com/grahamcampbell/php:8.2-cli
77

88
phpstan-analyze-src:
99
@docker run -it -w /data -v ${PWD}:/data:delegated --entrypoint vendor/bin/phpstan --rm registry.gitlab.com/grahamcampbell/php:8.2-cli analyze src -c phpstan.src.neon.dist

src/Parser/Lines.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,17 @@ public static function process(array $lines)
5858
*/
5959
private static function multilineProcess(bool $multiline, string $line, array $buffer)
6060
{
61+
$startsOnCurrentLine = $multiline ? false : self::looksLikeMultilineStart($line);
62+
6163
// check if $line can be multiline variable
62-
if ($started = self::looksLikeMultilineStart($line)) {
64+
if ($startsOnCurrentLine) {
6365
$multiline = true;
6466
}
6567

6668
if ($multiline) {
6769
\array_push($buffer, $line);
6870

69-
if (self::looksLikeMultilineStop($line, $started)) {
71+
if (self::looksLikeMultilineStop($line, $startsOnCurrentLine)) {
7072
$multiline = false;
7173
$line = \implode("\n", $buffer);
7274
$buffer = [];

tests/Dotenv/Parser/LinesTest.php

+1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ public function testProcessQuotes()
4545
'TEST_NS=\'test\\ntest\'',
4646
'TEST_EQD="https://vision.googleapis.com/v1/images:annotate?key="',
4747
'TEST_EQS=\'https://vision.googleapis.com/v1/images:annotate?key=\'',
48+
"BASE64_ENCODED_MULTILINE=\"qS1zCzMVVUJWQShokv6YVYi+ruKSC/bHV7GmEiyVkLaBWJHNVHCHsgTksEBsy8wJ\nuwycAvR07ZyOJJed4XTRMKnKp1/v+6UATpWzkIjZXytK+pD+XlZimUHTx3uiDcmU\njhQX1wWSxHDqrSWxeIJiTD+BuUyId8FzmXQ3TcBydJ474tmOU2F492ubk3LAiZ18\nmhiRGoshXAOSbS/P3+RZi4bDeNE/No4=\"",
4849
];
4950

5051
self::assertSame($expected, Lines::process($result->success()->get()));

tests/fixtures/env/multiline.env

+5
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,8 @@ TEST_NS='test\ntest'
77

88
TEST_EQD="https://vision.googleapis.com/v1/images:annotate?key="
99
TEST_EQS='https://vision.googleapis.com/v1/images:annotate?key='
10+
11+
BASE64_ENCODED_MULTILINE="qS1zCzMVVUJWQShokv6YVYi+ruKSC/bHV7GmEiyVkLaBWJHNVHCHsgTksEBsy8wJ
12+
uwycAvR07ZyOJJed4XTRMKnKp1/v+6UATpWzkIjZXytK+pD+XlZimUHTx3uiDcmU
13+
jhQX1wWSxHDqrSWxeIJiTD+BuUyId8FzmXQ3TcBydJ474tmOU2F492ubk3LAiZ18
14+
mhiRGoshXAOSbS/P3+RZi4bDeNE/No4="

0 commit comments

Comments
 (0)