Skip to content

Commit

Permalink
style: Apply php-cs-fixer updates
Browse files Browse the repository at this point in the history
Signed-off-by: Julius Härtl <[email protected]>
  • Loading branch information
juliusknorr committed Feb 14, 2024
1 parent 99da7d1 commit 23bccbd
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions lib/Controller/PublicSessionController.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ protected function isPasswordProtected(): bool {

#[NoAdminRequired]
#[PublicPage]
public function create(string $token, string $file = null, ?string $guestName = null): DataResponse {
public function create(string $token, ?string $file = null, ?string $guestName = null): DataResponse {
return $this->apiService->create(null, $file, $token, $guestName);
}

Expand All @@ -107,7 +107,7 @@ public function sync(string $token, int $version = 0): DataResponse {
#[NoAdminRequired]
#[PublicPage]
#[RequireDocumentSession]
public function save(string $token, int $version = 0, string $autosaveContent = null, string $documentState = null, bool $force = false, bool $manualSave = false): DataResponse {
public function save(string $token, int $version = 0, ?string $autosaveContent = null, ?string $documentState = null, bool $force = false, bool $manualSave = false): DataResponse {
return $this->apiService->save($this->getSession(), $this->getDocument(), $version, $autosaveContent, $documentState, $force, $manualSave, $token);
}

Expand Down
4 changes: 2 additions & 2 deletions lib/Controller/SessionController.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public function __construct(
}

#[NoAdminRequired]
public function create(int $fileId = null, string $file = null): DataResponse {
public function create(?int $fileId = null, ?string $file = null): DataResponse {
return $this->apiService->create($fileId, $file, null, null);
}

Expand Down Expand Up @@ -94,7 +94,7 @@ public function sync(int $version = 0): DataResponse {
#[NoAdminRequired]
#[PublicPage]
#[RequireDocumentSession]
public function save(int $version = 0, string $autosaveContent = null, string $documentState = null, bool $force = false, bool $manualSave = false): DataResponse {
public function save(int $version = 0, ?string $autosaveContent = null, ?string $documentState = null, bool $force = false, bool $manualSave = false): DataResponse {
try {
$this->loginSessionUser();
return $this->apiService->save($this->getSession(), $this->getDocument(), $version, $autosaveContent, $documentState, $force, $manualSave);
Expand Down
2 changes: 1 addition & 1 deletion lib/Service/DocumentService.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

namespace OCA\Text\Service;

use \InvalidArgumentException;
use InvalidArgumentException;
use OCA\Text\AppInfo\Application;
use OCA\Text\Db\Document;
use OCA\Text\Db\DocumentMapper;
Expand Down
4 changes: 2 additions & 2 deletions lib/Service/SessionService.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public function __construct(
$this->cache = $cacheFactory->createDistributed('text_sessions');
}

public function initSession(int $documentId, string $guestName = null): Session {
public function initSession(int $documentId, ?string $guestName = null): Session {
$session = new Session();
$session->setDocumentId($documentId);
$userName = $this->userId ? $this->userId : $guestName;
Expand Down Expand Up @@ -236,7 +236,7 @@ public function updateSessionAwareness(Session $session, string $message): Sessi
return $this->sessionMapper->update($session);
}

private function getColorForGuestName(string $guestName = null): string {
private function getColorForGuestName(?string $guestName = null): string {
$guestName = $this->userId ?? $guestName;
$uniqueGuestId = !empty($guestName) ? $guestName : $this->secureRandom->generate(12);
$color = $this->avatarManager->getGuestAvatar($uniqueGuestId)->avatarBackgroundColor($uniqueGuestId);
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/Controller/UserApiControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

namespace OCA\Text\Controller;

use \OCP\IRequest;
use OCA\Text\Db\Session;
use OCA\Text\Service\SessionService;
use OCP\AppFramework\Http\DataResponse;
use OCP\Collaboration\Collaborators\ISearch;
use OCP\IRequest;
use OCP\IUserManager;
use OCP\IUserSession;
use Test\TestCase;
Expand Down

0 comments on commit 23bccbd

Please sign in to comment.