From e6af132e152760bba4b1de5f5cb2e2c3f1fb44fd Mon Sep 17 00:00:00 2001 From: Abdul Malik Ikhsan Date: Sat, 19 Feb 2022 06:49:57 +0700 Subject: [PATCH] Make CodeIgniter::context nullable to handle access before initialization --- system/CodeIgniter.php | 2 +- system/Test/Mock/MockCodeIgniter.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/system/CodeIgniter.php b/system/CodeIgniter.php index 6ab61aa0f5c0..dac6f7feaaf5 100644 --- a/system/CodeIgniter.php +++ b/system/CodeIgniter.php @@ -149,7 +149,7 @@ class CodeIgniter * * @phpstan-var 'php-cli'|'spark'|'web' */ - protected string $context; + protected ?string $context = null; /** * Constructor. diff --git a/system/Test/Mock/MockCodeIgniter.php b/system/Test/Mock/MockCodeIgniter.php index 81bd7e23122e..e6d6ac0f6c61 100644 --- a/system/Test/Mock/MockCodeIgniter.php +++ b/system/Test/Mock/MockCodeIgniter.php @@ -15,7 +15,7 @@ class MockCodeIgniter extends CodeIgniter { - protected string $context = 'web'; + protected ?string $context = 'web'; protected function callExit($code) {