Skip to content

Commit 1335add

Browse files
committed
Merge branch '4.2'
* 4.2: (45 commits) [Form] various minor fixes Ensure the parent process is always killed bugfix: the terminal state was wrong and not reseted [Console] Fix inconsistent result for choice questions in non-interactive mode Define null return type for Constraint::getDefaultOption() [Routing] Fix: annotation loader ignores method's default values [HttpKernel] Fix DebugHandlersListener constructor docblock Skip Glob brace test when GLOB_BRACE is unavailable bumped Symfony version to 4.2.6 updated VERSION for 4.2.5 updated CHANGELOG for 4.2.5 bumped Symfony version to 3.4.25 updated VERSION for 3.4.24 update CONTRIBUTORS for 3.4.24 updated CHANGELOG for 3.4.24 [EventDispatcher] cleanup fix testIgnoredAttributesInContext Re-generate icu 64.1 data Improve PHPdoc / IDE autocomplete for config tree builder [Bridge][Twig] DebugCommand - fix escaping and filter ...
2 parents 8d3cabb + b541d63 commit 1335add

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

Dotenv.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ final class Dotenv
3434
private $lineno;
3535
private $data;
3636
private $end;
37-
private $state;
3837
private $values;
3938

4039
/**
@@ -162,27 +161,27 @@ public function parse(string $data, string $path = '.env'): array
162161
$this->lineno = 1;
163162
$this->cursor = 0;
164163
$this->end = \strlen($this->data);
165-
$this->state = self::STATE_VARNAME;
164+
$state = self::STATE_VARNAME;
166165
$this->values = [];
167166
$name = '';
168167

169168
$this->skipEmptyLines();
170169

171170
while ($this->cursor < $this->end) {
172-
switch ($this->state) {
171+
switch ($state) {
173172
case self::STATE_VARNAME:
174173
$name = $this->lexVarname();
175-
$this->state = self::STATE_VALUE;
174+
$state = self::STATE_VALUE;
176175
break;
177176

178177
case self::STATE_VALUE:
179178
$this->values[$name] = $this->lexValue();
180-
$this->state = self::STATE_VARNAME;
179+
$state = self::STATE_VARNAME;
181180
break;
182181
}
183182
}
184183

185-
if (self::STATE_VALUE === $this->state) {
184+
if (self::STATE_VALUE === $state) {
186185
$this->values[$name] = '';
187186
}
188187

0 commit comments

Comments
 (0)