Skip to content

Commit

Permalink
Correct import of Psalm types for Service Manager
Browse files Browse the repository at this point in the history
Signed-off-by: George Steel <[email protected]>
  • Loading branch information
gsteel committed Mar 4, 2024
1 parent 63f2788 commit 35545f7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
8 changes: 4 additions & 4 deletions src/ConfigProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@

namespace Mezzio\Authorization\Rbac;

use Laminas\ServiceManager\ConfigInterface;
use Laminas\ServiceManager\ServiceManager;

/** @psalm-import-type ServiceManagerConfigurationType from ConfigInterface */
/** @psalm-import-type ServiceManagerConfiguration from ServiceManager */
class ConfigProvider
{
/** @return array{dependencies: ServiceManagerConfigurationType} */
/** @return array{dependencies: ServiceManagerConfiguration} */
public function __invoke(): array
{
return [
'dependencies' => $this->getDependencies(),
];
}

/** @return ServiceManagerConfigurationType */
/** @return ServiceManagerConfiguration */
public function getDependencies(): array
{
return [
Expand Down
9 changes: 4 additions & 5 deletions test/ConfigProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

namespace MezzioTest\Authorization\Rbac;

use Laminas\ServiceManager\ConfigInterface;
use Laminas\ServiceManager\ServiceManager;
use Mezzio\Authorization\Rbac\ConfigProvider;
use Mezzio\Authorization\Rbac\LaminasRbac;
Expand All @@ -16,7 +15,7 @@
use function json_decode;
use function sprintf;

/** @psalm-import-type ServiceManagerConfigurationType from ConfigInterface */
/** @psalm-import-type ServiceManagerConfiguration from ServiceManager */
class ConfigProviderTest extends TestCase
{
/** @var ConfigProvider */
Expand All @@ -27,7 +26,7 @@ protected function setUp(): void
$this->provider = new ConfigProvider();
}

/** @return array{dependencies: ServiceManagerConfigurationType} */
/** @return array{dependencies: ServiceManagerConfiguration} */
public function testInvocationReturnsArray(): array
{
$config = ($this->provider)();
Expand All @@ -37,7 +36,7 @@ public function testInvocationReturnsArray(): array
}

/**
* @param array{dependencies: ServiceManagerConfigurationType} $config
* @param array{dependencies: ServiceManagerConfiguration} $config
* @psalm-suppress RedundantConditionGivenDocblockType
*/
#[Depends('testInvocationReturnsArray')]
Expand Down Expand Up @@ -89,7 +88,7 @@ public function testServicesDefinedInConfigProvider(): void
}
}

/** @param ServiceManagerConfigurationType $dependencies */
/** @param ServiceManagerConfiguration $dependencies */
private function getContainer(array $dependencies): ServiceManager
{
return new ServiceManager($dependencies);
Expand Down

0 comments on commit 35545f7

Please sign in to comment.