Skip to content

Commit 539a76c

Browse files
committed
refactor: Fix phpstan codeigniter.configArgumentInstanceof
1 parent 42a00ff commit 539a76c

File tree

6 files changed

+4
-28
lines changed

6 files changed

+4
-28
lines changed

system/Config/Services.php

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public function testInitialize(): void
5454
/**
5555
* @var Modules $config
5656
*/
57-
$config = config('Modules');
57+
$config = new Modules();
5858
$config->aliases = [];
5959

6060
// it should start out empty

utils/phpstan-baseline/codeigniter.configArgumentInstanceof.neon

Lines changed: 0 additions & 23 deletions
This file was deleted.

utils/phpstan-baseline/loader.neon

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ includes:
33
- assign.propertyType.neon
44
- booleanAnd.rightAlwaysTrue.neon
55
- codeigniter.cacheHandlerInstance.neon
6-
- codeigniter.configArgumentInstanceof.neon
76
- codeigniter.frameworkExceptionInstance.neon
87
- codeigniter.getReassignArray.neon
98
- codeigniter.modelArgumentInstanceof.neon

0 commit comments

Comments
 (0)