Skip to content

Commit

Permalink
refactor: Fix phpstan codeigniter.configArgumentInstanceof
Browse files Browse the repository at this point in the history
  • Loading branch information
neznaika0 committed Jan 9, 2025
1 parent 42a00ff commit 539a76c
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 28 deletions.
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();

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

0 comments on commit 539a76c

Please sign in to comment.