Skip to content

Commit

Permalink
Resolve Psalm errors
Browse files Browse the repository at this point in the history
  • Loading branch information
XedinUnknown committed May 31, 2023
1 parent e6ff140 commit 8f96fbc
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
4 changes: 3 additions & 1 deletion modules.local/core/inc/factories.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
return $c->get('wordpress/plugin_factory');
},
'wordpress/plugin_factory' => function (ContainerInterface $c): FilePathPluginFactoryInterface {
return new FilePathPluginFactory($c->get('package/version_factory'));
$factory = $c->get('package/version_factory');
/** @var StringVersionFactoryInterface $factory */
return new FilePathPluginFactory($factory);
},
'me/plugin/version_factory' => function (ContainerInterface $c): StringVersionFactoryInterface {
return $c->get('package/version_factory');
Expand Down
6 changes: 6 additions & 0 deletions modules.local/core/module.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,16 @@
$rootDir = dirname($mainFile);
$moduleDir = dirname(__FILE__);
$moduleIncDir = "$moduleDir/inc";

/** @psalm-suppress UnresolvableInclude */
$factories = (require "$moduleIncDir/factories.php")($rootDir, $mainFile);
/** @psalm-suppress UnresolvableInclude */
$extensions = (require "$moduleIncDir/extensions.php")($rootDir, $mainFile);
/**
* @var array<array-key, callable> $factories
* @var array<array-key, callable> $extensions
*/

$provider = new ServiceProvider($factories, $extensions);
$module = new Module($provider);

Expand Down
1 change: 1 addition & 0 deletions src/ModularModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public function setup(): ServiceProviderInterface
foreach ($this->modules as $module) {
$providers[] = $module->setup();
}
/** @var list<ServiceProviderInterface> $providers */

return new CompositeCachingServiceProvider($providers);
}
Expand Down

0 comments on commit 8f96fbc

Please sign in to comment.