mirror of
https://github.com/codeigniter4/CodeIgniter4.git
synced 2025-02-20 11:44:28 +08:00
refactor: Fix phpstan codeigniter.configArgumentInstanceof (#9390)
This commit is contained in:
parent
231b6b0ce0
commit
155f1c14de
@ -619,7 +619,7 @@ class Services extends BaseService
|
||||
return static::getSharedInstance('routes');
|
||||
}
|
||||
|
||||
return new RouteCollection(AppServices::get('locator'), config(Modules::class), config(Routing::class));
|
||||
return new RouteCollection(AppServices::get('locator'), new Modules(), config(Routing::class));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -76,7 +76,7 @@ class Events
|
||||
return;
|
||||
}
|
||||
|
||||
$config = config(Modules::class);
|
||||
$config = new Modules();
|
||||
$events = APPPATH . 'Config' . DIRECTORY_SEPARATOR . 'Events.php';
|
||||
$files = [];
|
||||
|
||||
|
@ -116,7 +116,7 @@ class Filters
|
||||
$this->request = &$request;
|
||||
$this->setResponse($response);
|
||||
|
||||
$this->modules = $modules ?? config(Modules::class);
|
||||
$this->modules = $modules instanceof Modules ? $modules : new Modules();
|
||||
|
||||
if ($this->modules->shouldDiscover('filters')) {
|
||||
$this->discoverFilters();
|
||||
|
@ -57,7 +57,7 @@ final class EventsTest extends CIUnitTestCase
|
||||
/**
|
||||
* @var Modules $config
|
||||
*/
|
||||
$config = config('Modules');
|
||||
$config = new Modules();
|
||||
$config->aliases = [];
|
||||
|
||||
// it should start out empty
|
||||
|
@ -1,23 +0,0 @@
|
||||
# total 4 errors
|
||||
|
||||
parameters:
|
||||
ignoreErrors:
|
||||
-
|
||||
message: '#^Argument \#1 \$name \(''Config\\\\Modules''\) passed to function config does not extend CodeIgniter\\\\Config\\\\BaseConfig\.$#'
|
||||
count: 1
|
||||
path: ../../system/Config/Services.php
|
||||
|
||||
-
|
||||
message: '#^Argument \#1 \$name \(''Config\\\\Modules''\) passed to function config does not extend CodeIgniter\\\\Config\\\\BaseConfig\.$#'
|
||||
count: 1
|
||||
path: ../../system/Events/Events.php
|
||||
|
||||
-
|
||||
message: '#^Argument \#1 \$name \(''Config\\\\Modules''\) passed to function config does not extend CodeIgniter\\\\Config\\\\BaseConfig\.$#'
|
||||
count: 1
|
||||
path: ../../system/Filters/Filters.php
|
||||
|
||||
-
|
||||
message: '#^Argument \#1 \$name \(''Modules''\) passed to function config does not extend CodeIgniter\\\\Config\\\\BaseConfig\.$#'
|
||||
count: 1
|
||||
path: ../../tests/system/Events/EventsTest.php
|
@ -2,7 +2,6 @@ includes:
|
||||
- argument.type.neon
|
||||
- assign.propertyType.neon
|
||||
- codeigniter.cacheHandlerInstance.neon
|
||||
- codeigniter.configArgumentInstanceof.neon
|
||||
- codeigniter.frameworkExceptionInstance.neon
|
||||
- codeigniter.getReassignArray.neon
|
||||
- codeigniter.modelArgumentInstanceof.neon
|
||||
|
Loading…
x
Reference in New Issue
Block a user