Skip to content

Commit

Permalink
Psalm fixes
Browse files Browse the repository at this point in the history
Signed-off-by: MB-Finski <[email protected]>
  • Loading branch information
MB-Finski committed Jan 11, 2024
1 parent 106c587 commit f7fe97a
Show file tree
Hide file tree
Showing 13 changed files with 36 additions and 37 deletions.
4 changes: 2 additions & 2 deletions appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ include text processing providers to:
<screenshot>https://github.com/nextcloud/assistant/raw/main/img/screenshot2.jpg</screenshot>
<screenshot>https://github.com/nextcloud/assistant/raw/main/img/screenshot3.jpg</screenshot>
<background-jobs>
<job>OCA\TPAssistant\Cron\CleanupImageGenerations</job>
<job>OCA\TPAssistant\Cron\CleanupTranscriptions</job>
<job>OCA\TpAssistant\Cron\CleanupImageGenerations</job>
<job>OCA\TpAssistant\Cron\CleanupTranscriptions</job>
</background-jobs>
<commands>
<command>OCA\TpAssistant\Command\CleanupImageGenerations</command>
Expand Down
24 changes: 12 additions & 12 deletions lib/AppInfo/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@

namespace OCA\TpAssistant\AppInfo;

use OCA\TPAssistant\Listener\BeforeTemplateRenderedListener;
use OCA\TPAssistant\Listener\FreePrompt\FreePromptReferenceListener;
use OCA\TPAssistant\Listener\SpeechToText\SpeechToTextReferenceListener;
use OCA\TPAssistant\Listener\SpeechToText\SpeechToTextResultListener;
use OCA\TPAssistant\Listener\TaskFailedListener;
use OCA\TPAssistant\Listener\TaskSuccessfulListener;
use OCA\TPAssistant\Listener\Text2Image\Text2ImageReferenceListener;
use OCA\TPAssistant\Listener\Text2Image\Text2ImageResultListener;
use OCA\TPAssistant\Notification\Notifier;
use OCA\TPAssistant\Reference\FreePromptReferenceProvider;
use OCA\TPAssistant\Reference\SpeechToTextReferenceProvider;
use OCA\TPAssistant\Reference\Text2ImageReferenceProvider;
use OCA\TpAssistant\Listener\BeforeTemplateRenderedListener;
use OCA\TpAssistant\Listener\FreePrompt\FreePromptReferenceListener;
use OCA\TpAssistant\Listener\SpeechToText\SpeechToTextReferenceListener;
use OCA\TpAssistant\Listener\SpeechToText\SpeechToTextResultListener;
use OCA\TpAssistant\Listener\TaskFailedListener;
use OCA\TpAssistant\Listener\TaskSuccessfulListener;
use OCA\TpAssistant\Listener\Text2Image\Text2ImageReferenceListener;
use OCA\TpAssistant\Listener\Text2Image\Text2ImageResultListener;
use OCA\TpAssistant\Notification\Notifier;
use OCA\TpAssistant\Reference\FreePromptReferenceProvider;
use OCA\TpAssistant\Reference\SpeechToTextReferenceProvider;
use OCA\TpAssistant\Reference\Text2ImageReferenceProvider;
use OCP\AppFramework\App;
use OCP\AppFramework\Bootstrap\IBootContext;

Expand Down
8 changes: 4 additions & 4 deletions lib/Controller/SpeechToTextController.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

namespace OCA\TPAssistant\Controller;
namespace OCA\TpAssistant\Controller;

use DateTime;
use Exception;
use InvalidArgumentException;
use OCA\TPAssistant\AppInfo\Application;
use OCA\TPAssistant\Db\SpeechToText\TranscriptMapper;
use OCA\TPAssistant\Service\SpeechToText\SpeechToTextService;
use OCA\TpAssistant\AppInfo\Application;
use OCA\TpAssistant\Db\SpeechToText\TranscriptMapper;
use OCA\TpAssistant\Service\SpeechToText\SpeechToTextService;
use OCP\AppFramework\Controller;
use OCP\AppFramework\Db\DoesNotExistException;
use OCP\AppFramework\Db\MultipleObjectsReturnedException;
Expand Down
4 changes: 2 additions & 2 deletions lib/Cron/CleanupTranscriptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
*
*/

namespace OCA\TPAssistant\Cron;
namespace OCA\TpAssistant\Cron;

use OCA\TPAssistant\Db\SpeechToText\TranscriptMapper;
use OCA\TpAssistant\Db\SpeechToText\TranscriptMapper;
use OCP\AppFramework\Utility\ITimeFactory;
use OCP\BackgroundJob\TimedJob;

Expand Down
2 changes: 1 addition & 1 deletion lib/Db/SpeechToText/Transcript.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
*
*/

namespace OCA\TPAssistant\Db\SpeechToText;
namespace OCA\TpAssistant\Db\SpeechToText;

use OCP\AppFramework\Db\Entity;
use OCP\DB\Types;
Expand Down
2 changes: 1 addition & 1 deletion lib/Db/SpeechToText/TranscriptMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
*
*/

namespace OCA\TPAssistant\Db\SpeechToText;
namespace OCA\TpAssistant\Db\SpeechToText;

use DateTime;
use Exception;
Expand Down
4 changes: 2 additions & 2 deletions lib/Listener/SpeechToText/SpeechToTextReferenceListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

namespace OCA\TPAssistant\Listener\SpeechToText;
namespace OCA\TpAssistant\Listener\SpeechToText;

use OCA\TPAssistant\AppInfo\Application;
use OCA\TpAssistant\AppInfo\Application;

use OCP\Collaboration\Reference\RenderReferenceEvent;
use OCP\EventDispatcher\Event;
Expand Down
6 changes: 3 additions & 3 deletions lib/Listener/SpeechToText/SpeechToTextResultListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

namespace OCA\TPAssistant\Listener\SpeechToText;
namespace OCA\TpAssistant\Listener\SpeechToText;

use OCA\TPAssistant\AppInfo\Application;
use OCA\TPAssistant\Service\SpeechToText\SpeechToTextService;
use OCA\TpAssistant\AppInfo\Application;
use OCA\TpAssistant\Service\SpeechToText\SpeechToTextService;
use OCP\EventDispatcher\Event;
use OCP\EventDispatcher\IEventListener;
use OCP\SpeechToText\Events\AbstractTranscriptionEvent;
Expand Down
4 changes: 2 additions & 2 deletions lib/Reference/SpeechToTextReferenceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

namespace OCA\TPAssistant\Reference;
namespace OCA\TpAssistant\Reference;

use OCA\TPAssistant\AppInfo\Application;
use OCA\TpAssistant\AppInfo\Application;
use OCP\Collaboration\Reference\ADiscoverableReferenceProvider;
use OCP\Collaboration\Reference\IReference;
use OCP\Collaboration\Reference\IReferenceManager;
Expand Down
1 change: 0 additions & 1 deletion lib/Service/AssistantService.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
class AssistantService {

public function __construct(
string $appName,
private INotificationManager $notificationManager,
private ITextProcessingManager $textProcessingManager,
private IURLGenerator $url,
Expand Down
10 changes: 5 additions & 5 deletions lib/Service/SpeechToText/SpeechToTextService.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

namespace OCA\TPAssistant\Service\SpeechToText;
namespace OCA\TpAssistant\Service\SpeechToText;

use DateTime;
use InvalidArgumentException;
use OCA\TPAssistant\AppInfo\Application;
use OCA\TPAssistant\Db\SpeechToText\Transcript;
use OCA\TPAssistant\Db\SpeechToText\TranscriptMapper;
use OCA\TpAssistant\AppInfo\Application;
use OCA\TpAssistant\Db\SpeechToText\Transcript;
use OCA\TpAssistant\Db\SpeechToText\TranscriptMapper;
use OCP\Files\File;
use OCP\Files\Folder;
use OCP\Files\IRootFolder;
Expand Down Expand Up @@ -191,7 +191,7 @@ public function sendSpeechToTextNotification(string $userId, string $result, boo
$notification->setApp(Application::APP_ID)
->setUser($userId)
->setDateTime(new DateTime())
->setObject('speech-to-text-result', $id)
->setObject('speech-to-text-result', (string) $id)
->setSubject($subject, $params);

$manager->notify($notification);
Expand Down
2 changes: 1 addition & 1 deletion src/assistant.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ __webpack_public_path__ = linkTo('assistant', 'js/') // eslint-disable-line
/**
* Creates an assistant modal and return a promise which provides the result
*
* OCA.TPAssistant.openAssistantTextProcessingForm({
* OCA.TpAssistant.openAssistantTextProcessingForm({
* appId: 'my_app_id',
* identifier: 'my task identifier',
* taskType: 'OCP\\TextProcessing\\FreePromptTaskType',
Expand Down
2 changes: 1 addition & 1 deletion templates/speechToTextResultPage.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

use OCA\TPAssistant\AppInfo\Application;
use OCA\TpAssistant\AppInfo\Application;
use OCP\Util;

$appId = Application::APP_ID;
Expand Down

0 comments on commit f7fe97a

Please sign in to comment.