Skip to content

Commit

Permalink
fix(testing): implement getExpectedRuntime on FakeTextProcessingProvider
Browse files Browse the repository at this point in the history
Signed-off-by: Julius Härtl <[email protected]>
  • Loading branch information
juliusknorr committed Jan 22, 2024
1 parent f0824db commit 0870a0e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion apps/testing/lib/Provider/FakeTextProcessingProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,11 @@

use OCP\TextProcessing\FreePromptTaskType;
use OCP\TextProcessing\IProvider;
use OCP\TextProcessing\IProviderWithExpectedRuntime;
use OCP\TextProcessing\ITaskType;

/** @template-implements IProvider<FreePromptTaskType|ITaskType> */
class FakeTextProcessingProvider implements IProvider {
class FakeTextProcessingProvider implements IProvider, IProviderWithExpectedRuntime {

Check failure on line 31 in apps/testing/lib/Provider/FakeTextProcessingProvider.php

View workflow job for this annotation

GitHub Actions / static-code-analysis

MissingTemplateParam

apps/testing/lib/Provider/FakeTextProcessingProvider.php:31:56: MissingTemplateParam: OCA\Testing\Provider\FakeTextProcessingProvider has missing template params when extending OCP\TextProcessing\IProviderWithExpectedRuntime, expecting 1 (see https://psalm.dev/182)

Check failure

Code scanning / Psalm

MissingTemplateParam Error test

OCA\Testing\Provider\FakeTextProcessingProvider has missing template params when extending OCP\TextProcessing\IProviderWithExpectedRuntime, expecting 1

public function getName(): string {
return 'Fake text processing provider';
Expand All @@ -40,4 +41,8 @@ public function process(string $prompt): string {
public function getTaskType(): string {
return FreePromptTaskType::class;
}

public function getExpectedRuntime(): int {
return 1;
}
}

0 comments on commit 0870a0e

Please sign in to comment.