Context params: Make userId nullable

Signed-off-by: Marcel Klehr <mklehr@gmx.net>
pull/37674/head
Marcel Klehr 3 years ago
parent a2f5421fc3
commit fbcd275acb
  1. 2
      lib/private/SpeechToText/SpeechToTextManager.php
  2. 4
      lib/public/SpeechToText/Events/AbstractTranscriptionEvent.php
  3. 2
      lib/public/SpeechToText/Events/TranscriptionFailedEvent.php
  4. 2
      lib/public/SpeechToText/Events/TranscriptionSuccessfulEvent.php
  5. 2
      lib/public/SpeechToText/ISpeechToTextManager.php

@ -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');
}

@ -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;
}

@ -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);

@ -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);

@ -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

Loading…
Cancel
Save