Skip to content

Commit 8f96fbc

Browse files
committed
Resolve Psalm errors
1 parent e6ff140 commit 8f96fbc

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

modules.local/core/inc/factories.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@
2222
return $c->get('wordpress/plugin_factory');
2323
},
2424
'wordpress/plugin_factory' => function (ContainerInterface $c): FilePathPluginFactoryInterface {
25-
return new FilePathPluginFactory($c->get('package/version_factory'));
25+
$factory = $c->get('package/version_factory');
26+
/** @var StringVersionFactoryInterface $factory */
27+
return new FilePathPluginFactory($factory);
2628
},
2729
'me/plugin/version_factory' => function (ContainerInterface $c): StringVersionFactoryInterface {
2830
return $c->get('package/version_factory');

modules.local/core/module.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,16 @@
88
$rootDir = dirname($mainFile);
99
$moduleDir = dirname(__FILE__);
1010
$moduleIncDir = "$moduleDir/inc";
11+
1112
/** @psalm-suppress UnresolvableInclude */
1213
$factories = (require "$moduleIncDir/factories.php")($rootDir, $mainFile);
1314
/** @psalm-suppress UnresolvableInclude */
1415
$extensions = (require "$moduleIncDir/extensions.php")($rootDir, $mainFile);
16+
/**
17+
* @var array<array-key, callable> $factories
18+
* @var array<array-key, callable> $extensions
19+
*/
20+
1521
$provider = new ServiceProvider($factories, $extensions);
1622
$module = new Module($provider);
1723

src/ModularModule.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ public function setup(): ServiceProviderInterface
3636
foreach ($this->modules as $module) {
3737
$providers[] = $module->setup();
3838
}
39+
/** @var list<ServiceProviderInterface> $providers */
3940

4041
return new CompositeCachingServiceProvider($providers);
4142
}

0 commit comments

Comments
 (0)