diff options
author | Côme Chilliet <come.chilliet@nextcloud.com> | 2024-03-28 16:13:19 +0100 |
---|---|---|
committer | Côme Chilliet <91878298+come-nc@users.noreply.github.com> | 2024-04-02 14:16:21 +0200 |
commit | ec5133b739eabc76271789504b4dbb91a534f552 (patch) | |
tree | 880b81f5ebd11b289c67e4bcdd1ecaa41aedbcb4 /apps/files/lib | |
parent | b074399a87e764f506550d64f6379738186355c6 (diff) | |
download | nextcloud-server-ec5133b739eabc76271789504b4dbb91a534f552.tar.gz nextcloud-server-ec5133b739eabc76271789504b4dbb91a534f552.zip |
fix: Apply new coding standard to all files
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'apps/files/lib')
-rw-r--r-- | apps/files/lib/Activity/FavoriteProvider.php | 4 | ||||
-rw-r--r-- | apps/files/lib/Activity/Provider.php | 8 | ||||
-rw-r--r-- | apps/files/lib/Collaboration/Resources/ResourceProvider.php | 2 | ||||
-rw-r--r-- | apps/files/lib/Controller/DirectEditingController.php | 4 | ||||
-rw-r--r-- | apps/files/lib/Controller/ViewController.php | 2 |
5 files changed, 10 insertions, 10 deletions
diff --git a/apps/files/lib/Activity/FavoriteProvider.php b/apps/files/lib/Activity/FavoriteProvider.php index 9c7018e6a5c..c96d5b5debe 100644 --- a/apps/files/lib/Activity/FavoriteProvider.php +++ b/apps/files/lib/Activity/FavoriteProvider.php @@ -71,7 +71,7 @@ class FavoriteProvider implements IProvider { * @throws \InvalidArgumentException * @since 11.0.0 */ - public function parse($language, IEvent $event, IEvent $previousEvent = null) { + public function parse($language, IEvent $event, ?IEvent $previousEvent = null) { if ($event->getApp() !== 'files' || $event->getType() !== 'favorite') { throw new \InvalidArgumentException(); } @@ -125,7 +125,7 @@ class FavoriteProvider implements IProvider { * @throws \InvalidArgumentException * @since 11.0.0 */ - public function parseLongVersion(IEvent $event, IEvent $previousEvent = null) { + public function parseLongVersion(IEvent $event, ?IEvent $previousEvent = null) { if ($event->getSubject() === self::SUBJECT_ADDED) { $subject = $this->l->t('You added {file} to your favorites'); if ($this->activityManager->getRequirePNG()) { diff --git a/apps/files/lib/Activity/Provider.php b/apps/files/lib/Activity/Provider.php index 50535cab5c6..662ea98d0b9 100644 --- a/apps/files/lib/Activity/Provider.php +++ b/apps/files/lib/Activity/Provider.php @@ -102,7 +102,7 @@ class Provider implements IProvider { * @throws \InvalidArgumentException * @since 11.0.0 */ - public function parse($language, IEvent $event, IEvent $previousEvent = null) { + public function parse($language, IEvent $event, ?IEvent $previousEvent = null) { if ($event->getApp() !== 'files') { throw new \InvalidArgumentException(); } @@ -136,7 +136,7 @@ class Provider implements IProvider { * @throws \InvalidArgumentException * @since 11.0.0 */ - public function parseShortVersion(IEvent $event, IEvent $previousEvent = null) { + public function parseShortVersion(IEvent $event, ?IEvent $previousEvent = null) { $parsedParameters = $this->getParameters($event); if ($event->getSubject() === 'created_by') { @@ -178,7 +178,7 @@ class Provider implements IProvider { * @throws \InvalidArgumentException * @since 11.0.0 */ - public function parseLongVersion(IEvent $event, IEvent $previousEvent = null) { + public function parseLongVersion(IEvent $event, ?IEvent $previousEvent = null) { $this->fileIsEncrypted = false; $parsedParameters = $this->getParameters($event); @@ -368,7 +368,7 @@ class Provider implements IProvider { * @return array * @throws \InvalidArgumentException */ - protected function getFile($parameter, IEvent $event = null) { + protected function getFile($parameter, ?IEvent $event = null) { if (is_array($parameter)) { $path = reset($parameter); $id = (string) key($parameter); diff --git a/apps/files/lib/Collaboration/Resources/ResourceProvider.php b/apps/files/lib/Collaboration/Resources/ResourceProvider.php index a15e1558057..a1a944bc56a 100644 --- a/apps/files/lib/Collaboration/Resources/ResourceProvider.php +++ b/apps/files/lib/Collaboration/Resources/ResourceProvider.php @@ -107,7 +107,7 @@ class ResourceProvider implements IProvider { * @return bool * @since 16.0.0 */ - public function canAccessResource(IResource $resource, IUser $user = null): bool { + public function canAccessResource(IResource $resource, ?IUser $user = null): bool { if (!$user instanceof IUser) { return false; } diff --git a/apps/files/lib/Controller/DirectEditingController.php b/apps/files/lib/Controller/DirectEditingController.php index 5d2162c69e0..ab061382a2d 100644 --- a/apps/files/lib/Controller/DirectEditingController.php +++ b/apps/files/lib/Controller/DirectEditingController.php @@ -79,7 +79,7 @@ class DirectEditingController extends OCSController { * 200: URL for direct editing returned * 403: Opening file is not allowed */ - public function create(string $path, string $editorId, string $creatorId, string $templateId = null): DataResponse { + public function create(string $path, string $editorId, string $creatorId, ?string $templateId = null): DataResponse { if (!$this->directEditingManager->isEnabled()) { return new DataResponse(['message' => 'Direct editing is not enabled'], Http::STATUS_INTERNAL_SERVER_ERROR); } @@ -115,7 +115,7 @@ class DirectEditingController extends OCSController { * 200: URL for direct editing returned * 403: Opening file is not allowed */ - public function open(string $path, string $editorId = null, ?int $fileId = null): DataResponse { + public function open(string $path, ?string $editorId = null, ?int $fileId = null): DataResponse { if (!$this->directEditingManager->isEnabled()) { return new DataResponse(['message' => 'Direct editing is not enabled'], Http::STATUS_INTERNAL_SERVER_ERROR); } diff --git a/apps/files/lib/Controller/ViewController.php b/apps/files/lib/Controller/ViewController.php index 2934ac06704..67cd0bf2aef 100644 --- a/apps/files/lib/Controller/ViewController.php +++ b/apps/files/lib/Controller/ViewController.php @@ -135,7 +135,7 @@ class ViewController extends Controller { * @param string $fileid * @return TemplateResponse|RedirectResponse */ - public function showFile(string $fileid = null): Response { + public function showFile(?string $fileid = null): Response { if (!$fileid) { return new RedirectResponse($this->urlGenerator->linkToRoute('files.view.index')); } |