Skip to content

Commit ad72245

Browse files
minor #51111 [Runtime] Fix property must not be accessed before initialization on SymfonyRuntime (l-vo)
This PR was merged into the 6.4 branch. Discussion ---------- [Runtime] Fix property must not be accessed before initialization on SymfonyRuntime | Q | A | ------------- | --- | Branch? | 6.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | | License | MIT | Doc PR | symfony/symfony-docs#... <!-- required for new features --> Introduced by #51068, see #51068 (comment) Commits ------- dd3c406 Fix property must not be accessed before initialization on SymfonyRuntime::$input
2 parents 42d9d7c + dd3c406 commit ad72245

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Component/Runtime/SymfonyRuntime.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public function __construct(array $options = [])
106106
->usePutenv($options['use_putenv'] ?? false)
107107
->bootEnv($options['project_dir'].'/'.($options['dotenv_path'] ?? '.env'), 'dev', (array) ($options['test_envs'] ?? ['test']), $options['dotenv_overload'] ?? false);
108108

109-
if ($this->input && ($options['dotenv_overload'] ?? false)) {
109+
if (isset($this->input) && ($options['dotenv_overload'] ?? false)) {
110110
if ($this->input->getParameterOption(['--env', '-e'], $_SERVER[$envKey], true) !== $_SERVER[$envKey]) {
111111
throw new \LogicException(sprintf('Cannot use "--env" or "-e" when the "%s" file defines "%s" and the "dotenv_overload" runtime option is true.', $options['dotenv_path'] ?? '.env', $envKey));
112112
}

0 commit comments

Comments
 (0)