Skip to content

Commit

Permalink
fixed for Psalm level 6
Browse files Browse the repository at this point in the history
  • Loading branch information
driehle committed Oct 27, 2021
1 parent 0fbb2eb commit 4d45a5e
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 21 deletions.
6 changes: 3 additions & 3 deletions src/Authentication/Storage/ObjectRepository.php
Expand Up @@ -72,12 +72,12 @@ public function readKeyOnly()
}

/**
* @param mixed $identity
* @param mixed $contents
*/
public function write($identity): void
public function write($contents): void
{
$metadataInfo = $this->options->getClassMetadata();
$identifierValues = $metadataInfo->getIdentifierValues($identity);
$identifierValues = $metadataInfo->getIdentifierValues($contents);

$this->options->getStorage()->write($identifierValues);
}
Expand Down
6 changes: 4 additions & 2 deletions src/GetConsoleUsage.php
Expand Up @@ -29,13 +29,15 @@ trait GetConsoleUsage
* @internal
* @deprecated 4.2.0 Usage of laminas/laminas-mvc-console is deprecated, integration will be removed in 5.0.0.
* Please use ./vendor/bin/doctrine-module instead.
*
* @psalm-suppress DuplicateClass
*/
trait GetConsoleUsage
{
/**
* {@inheritDoc}
* Prints console usage information for laminas-mvc-console
*/
public function getConsoleUsage(Console $console)
public function getConsoleUsage(Console $console): string
{
if (! interface_exists(Console::class)) {
trigger_error(sprintf(
Expand Down
18 changes: 6 additions & 12 deletions src/Module.php
Expand Up @@ -28,10 +28,7 @@ class Module implements ConfigProviderInterface, InitProviderInterface, Bootstra
/** @var ServiceLocatorInterface */
private $serviceManager;

/**
* {@inheritDoc}
*/
public function init(ModuleManagerInterface $moduleManager)
public function init(ModuleManagerInterface $manager): void
{
AnnotationRegistry::registerLoader(
static function ($className) {
Expand All @@ -40,19 +37,16 @@ static function ($className) {
);
}

/**
* {@inheritDoc}
*/
public function onBootstrap(EventInterface $event)
public function onBootstrap(EventInterface $e): void
{
assert($event->getTarget() instanceof Application);
$this->serviceManager = $event->getTarget()->getServiceManager();
assert($e->getTarget() instanceof Application);
$this->serviceManager = $e->getTarget()->getServiceManager();
}

/**
* {@inheritDoc}
* @return array<string, mixed>
*/
public function getConfig()
public function getConfig(): array
{
$provider = new ConfigProvider();

Expand Down
4 changes: 2 additions & 2 deletions src/Service/CliControllerFactory.php
Expand Up @@ -34,8 +34,8 @@ public function __invoke(ContainerInterface $container, $requestedName, ?array $
*
* @return CliController
*/
public function createService(ServiceLocatorInterface $container)
public function createService(ServiceLocatorInterface $serviceLocator)
{
return $this($container, CliController::class);
return $this($serviceLocator, CliController::class);
}
}
4 changes: 2 additions & 2 deletions src/Service/CliFactory.php
Expand Up @@ -66,8 +66,8 @@ public function __invoke(ContainerInterface $container, $requestedName, ?array $
*
* @return Application
*/
public function createService(ServiceLocatorInterface $container)
public function createService(ServiceLocatorInterface $serviceLocator)
{
return $this($container, Application::class);
return $this($serviceLocator, Application::class);
}
}

0 comments on commit 4d45a5e

Please sign in to comment.