Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Fix phpstan codeigniter.configArgumentInstanceof #9390

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion system/Config/Services.php
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,7 @@ public static function routes(bool $getShared = true)
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));
}

/**
Expand Down
2 changes: 1 addition & 1 deletion system/Events/Events.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public static function initialize()
return;
}

$config = config(Modules::class);
$config = new Modules();
$events = APPPATH . 'Config' . DIRECTORY_SEPARATOR . 'Events.php';
$files = [];

Expand Down
2 changes: 1 addition & 1 deletion system/Filters/Filters.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public function __construct($config, RequestInterface $request, ResponseInterfac
$this->request = &$request;
$this->setResponse($response);

$this->modules = $modules ?? config(Modules::class);
$this->modules = $modules instanceof Modules ? $modules : new Modules();
paulbalandan marked this conversation as resolved.
Show resolved Hide resolved

if ($this->modules->shouldDiscover('filters')) {
$this->discoverFilters();
Expand Down
2 changes: 1 addition & 1 deletion tests/system/Events/EventsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function testInitialize(): void
/**
* @var Modules $config
*/
$config = config('Modules');
$config = new Modules();
$config->aliases = [];

// it should start out empty
Expand Down
23 changes: 0 additions & 23 deletions utils/phpstan-baseline/codeigniter.configArgumentInstanceof.neon

This file was deleted.

1 change: 0 additions & 1 deletion utils/phpstan-baseline/loader.neon
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ includes:
- assign.propertyType.neon
- booleanAnd.rightAlwaysTrue.neon
- codeigniter.cacheHandlerInstance.neon
- codeigniter.configArgumentInstanceof.neon
- codeigniter.frameworkExceptionInstance.neon
- codeigniter.getReassignArray.neon
- codeigniter.modelArgumentInstanceof.neon
Expand Down
Loading