Skip to content

Commit 96b41f7

Browse files
CopilotR0Wi
andauthored
Fix PSALM InvalidArgument errors in service registrations (#359)
* Initial plan * Fix PSALM InvalidArgument errors by adding suppressions for registerService calls Co-authored-by: R0Wi <19730957+R0Wi@users.noreply.github.com> * Revert unintended package-lock.json changes Co-authored-by: R0Wi <19730957+R0Wi@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: R0Wi <19730957+R0Wi@users.noreply.github.com>
1 parent d964669 commit 96b41f7

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

lib/AppInfo/Application.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ public function register(IRegistrationContext $context): void {
102102
$context->registerService(ICommand::class, function () {
103103
return new CommandWrapper();
104104
}, false);
105+
/** @psalm-suppress InvalidArgument */
105106
$context->registerService(ISidecarFileAccessor::class, function (ContainerInterface $c) {
106107
return new SidecarFileAccessor($c->get(ITempManager::class), $c->get(LoggerInterface::class));
107108
}, false);

lib/OcrProcessors/OcrProcessorFactory.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,15 @@ public static function registerOcrProcessors(IRegistrationContext $context) : vo
6868
* "singleton per request" which leads to problems regarding the reused Command object
6969
* under the hood.
7070
*/
71+
/** @psalm-suppress InvalidArgument */
7172
$context->registerService(PdfOcrProcessor::class, fn (ContainerInterface $c)
7273
=> new PdfOcrProcessor(
7374
$c->get(ICommand::class),
7475
$c->get(LoggerInterface::class),
7576
$c->get(ISidecarFileAccessor::class),
7677
$c->get(ICommandLineUtils::class),
7778
$c->get(IPhpNativeFunctions::class)), false);
79+
/** @psalm-suppress InvalidArgument */
7880
$context->registerService(ImageOcrProcessor::class, fn (ContainerInterface $c)
7981
=> new ImageOcrProcessor(
8082
$c->get(ICommand::class),

0 commit comments

Comments
 (0)