Context params: Make userId nullable

Signed-off-by: Marcel Klehr <mklehr@gmx.net>
This commit is contained in:
Marcel Klehr 2023-04-19 12:39:39 +02:00
parent a2f5421fc3
commit fbcd275acb
5 changed files with 6 additions and 6 deletions

View file

@ -90,7 +90,7 @@ class SpeechToTextManager implements ISpeechToTextManager {
return !empty($context->getSpeechToTextProviders());
}
public function scheduleFileTranscription(File $file, string $userId, string $appId): void {
public function scheduleFileTranscription(File $file, ?string $userId, string $appId): void {
if (!$this->hasProviders()) {
throw new PreConditionNotMetException('No SpeechToText providers have been registered');
}

View file

@ -38,7 +38,7 @@ abstract class AbstractTranscriptionEvent extends Event {
public function __construct(
private int $fileIdId,
private ?File $file,
private string $userId,
private ?string $userId,
private string $appId,
) {
parent::__construct();
@ -61,7 +61,7 @@ abstract class AbstractTranscriptionEvent extends Event {
/**
* @since 27.0.0
*/
public function getUserId(): string {
public function getUserId(): ?string {
return $this->userId;
}

View file

@ -40,7 +40,7 @@ class TranscriptionFailedEvent extends AbstractTranscriptionEvent {
int $fileId,
?File $file,
private string $errorMessage,
string $userId,
?string $userId,
string $appId,
) {
parent::__construct($fileId, $file, $userId, $appId);

View file

@ -40,7 +40,7 @@ class TranscriptionSuccessfulEvent extends AbstractTranscriptionEvent {
int $fileId,
?File $file,
private string $transcript,
string $userId,
?string $userId,
string $appId,
) {
parent::__construct($fileId, $file, $userId, $appId);

View file

@ -53,7 +53,7 @@ interface ISpeechToTextManager {
* @throws PreConditionNotMetException If no provider was registered but this method was still called
* @throws InvalidArgumentException If the file could not be found or is not of a supported type
*/
public function scheduleFileTranscription(File $file, string $userId, string $appId): void;
public function scheduleFileTranscription(File $file, ?string $userId, string $appId): void;
/**
* @since 27.0.0