Skip to content

Commit 155f1c1

Browse files
authored
refactor: Fix phpstan codeigniter.configArgumentInstanceof (#9390)
1 parent 231b6b0 commit 155f1c1

File tree

6 files changed

+4
-28
lines changed

6 files changed

+4
-28
lines changed

system/Config/Services.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -619,7 +619,7 @@ public static function routes(bool $getShared = true)
619619
return static::getSharedInstance('routes');
620620
}
621621

622-
return new RouteCollection(AppServices::get('locator'), config(Modules::class), config(Routing::class));
622+
return new RouteCollection(AppServices::get('locator'), new Modules(), config(Routing::class));
623623
}
624624

625625
/**

system/Events/Events.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public static function initialize()
7676
return;
7777
}
7878

79-
$config = config(Modules::class);
79+
$config = new Modules();
8080
$events = APPPATH . 'Config' . DIRECTORY_SEPARATOR . 'Events.php';
8181
$files = [];
8282

system/Filters/Filters.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ public function __construct($config, RequestInterface $request, ResponseInterfac
116116
$this->request = &$request;
117117
$this->setResponse($response);
118118

119-
$this->modules = $modules ?? config(Modules::class);
119+
$this->modules = $modules instanceof Modules ? $modules : new Modules();
120120

121121
if ($this->modules->shouldDiscover('filters')) {
122122
$this->discoverFilters();

tests/system/Events/EventsTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public function testInitialize(): void
5757
/**
5858
* @var Modules $config
5959
*/
60-
$config = config('Modules');
60+
$config = new Modules();
6161
$config->aliases = [];
6262

6363
// it should start out empty

utils/phpstan-baseline/codeigniter.configArgumentInstanceof.neon

-23
This file was deleted.

utils/phpstan-baseline/loader.neon

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ includes:
22
- argument.type.neon
33
- assign.propertyType.neon
44
- codeigniter.cacheHandlerInstance.neon
5-
- codeigniter.configArgumentInstanceof.neon
65
- codeigniter.frameworkExceptionInstance.neon
76
- codeigniter.getReassignArray.neon
87
- codeigniter.modelArgumentInstanceof.neon

0 commit comments

Comments
 (0)