Skip to content

Commit e6af132

Browse files
committed
Make CodeIgniter::context nullable to handle access before initialization
1 parent bc96617 commit e6af132

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

system/CodeIgniter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ class CodeIgniter
149149
*
150150
* @phpstan-var 'php-cli'|'spark'|'web'
151151
*/
152-
protected string $context;
152+
protected ?string $context = null;
153153

154154
/**
155155
* Constructor.

system/Test/Mock/MockCodeIgniter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
class MockCodeIgniter extends CodeIgniter
1717
{
18-
protected string $context = 'web';
18+
protected ?string $context = 'web';
1919

2020
protected function callExit($code)
2121
{

0 commit comments

Comments
 (0)