aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_sharing
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_sharing')
-rw-r--r--apps/files_sharing/lib/Activity/Providers/Base.php6
-rw-r--r--apps/files_sharing/lib/Activity/Providers/Downloads.php2
-rw-r--r--apps/files_sharing/lib/Activity/Providers/Groups.php2
-rw-r--r--apps/files_sharing/lib/Activity/Providers/PublicLinks.php2
-rw-r--r--apps/files_sharing/lib/Activity/Providers/RemoteShares.php2
-rw-r--r--apps/files_sharing/lib/Activity/Providers/Users.php2
-rw-r--r--apps/files_sharing/lib/Controller/ShareAPIController.php32
-rw-r--r--apps/files_sharing/lib/Controller/ShareesAPIController.php2
-rw-r--r--apps/files_sharing/lib/External/Storage.php2
-rw-r--r--apps/files_sharing/lib/Helper.php2
-rw-r--r--apps/files_sharing/lib/ShareBackend/File.php2
11 files changed, 28 insertions, 28 deletions
diff --git a/apps/files_sharing/lib/Activity/Providers/Base.php b/apps/files_sharing/lib/Activity/Providers/Base.php
index 01d730242c9..af5f7cd2698 100644
--- a/apps/files_sharing/lib/Activity/Providers/Base.php
+++ b/apps/files_sharing/lib/Activity/Providers/Base.php
@@ -86,7 +86,7 @@ abstract class Base 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_sharing') {
throw new \InvalidArgumentException();
}
@@ -119,7 +119,7 @@ abstract class Base implements IProvider {
* @throws \InvalidArgumentException
* @since 11.0.0
*/
- abstract protected function parseLongVersion(IEvent $event, IEvent $previousEvent = null);
+ abstract protected function parseLongVersion(IEvent $event, ?IEvent $previousEvent = null);
/**
* @throws \InvalidArgumentException
@@ -134,7 +134,7 @@ abstract class Base 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_sharing/lib/Activity/Providers/Downloads.php b/apps/files_sharing/lib/Activity/Providers/Downloads.php
index 8152e0b0885..3566431757d 100644
--- a/apps/files_sharing/lib/Activity/Providers/Downloads.php
+++ b/apps/files_sharing/lib/Activity/Providers/Downloads.php
@@ -68,7 +68,7 @@ class Downloads extends Base {
* @throws \InvalidArgumentException
* @since 11.0.0
*/
- public function parseLongVersion(IEvent $event, IEvent $previousEvent = null) {
+ public function parseLongVersion(IEvent $event, ?IEvent $previousEvent = null) {
$parsedParameters = $this->getParsedParameters($event);
if ($event->getSubject() === self::SUBJECT_PUBLIC_SHARED_FILE_DOWNLOADED ||
diff --git a/apps/files_sharing/lib/Activity/Providers/Groups.php b/apps/files_sharing/lib/Activity/Providers/Groups.php
index a6e6fae3e9b..ac6aaba9dbf 100644
--- a/apps/files_sharing/lib/Activity/Providers/Groups.php
+++ b/apps/files_sharing/lib/Activity/Providers/Groups.php
@@ -102,7 +102,7 @@ class Groups extends Base {
* @throws \InvalidArgumentException
* @since 11.0.0
*/
- public function parseLongVersion(IEvent $event, IEvent $previousEvent = null) {
+ public function parseLongVersion(IEvent $event, ?IEvent $previousEvent = null) {
$parsedParameters = $this->getParsedParameters($event);
if ($event->getSubject() === self::SUBJECT_SHARED_GROUP_SELF) {
diff --git a/apps/files_sharing/lib/Activity/Providers/PublicLinks.php b/apps/files_sharing/lib/Activity/Providers/PublicLinks.php
index c09b9baa951..264e3c7d5f7 100644
--- a/apps/files_sharing/lib/Activity/Providers/PublicLinks.php
+++ b/apps/files_sharing/lib/Activity/Providers/PublicLinks.php
@@ -75,7 +75,7 @@ class PublicLinks extends Base {
* @throws \InvalidArgumentException
* @since 11.0.0
*/
- public function parseLongVersion(IEvent $event, IEvent $previousEvent = null) {
+ public function parseLongVersion(IEvent $event, ?IEvent $previousEvent = null) {
$parsedParameters = $this->getParsedParameters($event);
if ($event->getSubject() === self::SUBJECT_SHARED_LINK_SELF) {
diff --git a/apps/files_sharing/lib/Activity/Providers/RemoteShares.php b/apps/files_sharing/lib/Activity/Providers/RemoteShares.php
index b46db3105e9..ea9e6895586 100644
--- a/apps/files_sharing/lib/Activity/Providers/RemoteShares.php
+++ b/apps/files_sharing/lib/Activity/Providers/RemoteShares.php
@@ -83,7 +83,7 @@ class RemoteShares extends Base {
* @throws \InvalidArgumentException
* @since 11.0.0
*/
- public function parseLongVersion(IEvent $event, IEvent $previousEvent = null) {
+ public function parseLongVersion(IEvent $event, ?IEvent $previousEvent = null) {
$parsedParameters = $this->getParsedParameters($event);
if ($event->getSubject() === self::SUBJECT_REMOTE_SHARE_RECEIVED) {
diff --git a/apps/files_sharing/lib/Activity/Providers/Users.php b/apps/files_sharing/lib/Activity/Providers/Users.php
index ce873eb5f77..26ddbb06318 100644
--- a/apps/files_sharing/lib/Activity/Providers/Users.php
+++ b/apps/files_sharing/lib/Activity/Providers/Users.php
@@ -91,7 +91,7 @@ class Users extends Base {
* @throws \InvalidArgumentException
* @since 11.0.0
*/
- public function parseLongVersion(IEvent $event, IEvent $previousEvent = null) {
+ public function parseLongVersion(IEvent $event, ?IEvent $previousEvent = null) {
$parsedParameters = $this->getParsedParameters($event);
if ($event->getSubject() === self::SUBJECT_SHARED_USER_SELF) {
diff --git a/apps/files_sharing/lib/Controller/ShareAPIController.php b/apps/files_sharing/lib/Controller/ShareAPIController.php
index c9a1486db2f..4a01d97cdf0 100644
--- a/apps/files_sharing/lib/Controller/ShareAPIController.php
+++ b/apps/files_sharing/lib/Controller/ShareAPIController.php
@@ -134,7 +134,7 @@ class ShareAPIController extends OCSController {
IUserManager $userManager,
IRootFolder $rootFolder,
IURLGenerator $urlGenerator,
- string $userId = null,
+ ?string $userId = null,
IL10N $l10n,
IConfig $config,
IAppManager $appManager,
@@ -170,7 +170,7 @@ class ShareAPIController extends OCSController {
*
* @suppress PhanUndeclaredClassMethod
*/
- protected function formatShare(IShare $share, Node $recipientNode = null): array {
+ protected function formatShare(IShare $share, ?Node $recipientNode = null): array {
$sharedBy = $this->userManager->get($share->getSharedBy());
$shareOwner = $this->userManager->get($share->getShareOwner());
@@ -600,17 +600,17 @@ class ShareAPIController extends OCSController {
* 200: Share created
*/
public function createShare(
- string $path = null,
- int $permissions = null,
+ ?string $path = null,
+ ?int $permissions = null,
int $shareType = -1,
- string $shareWith = null,
+ ?string $shareWith = null,
string $publicUpload = 'false',
string $password = '',
- string $sendPasswordByTalk = null,
+ ?string $sendPasswordByTalk = null,
string $expireDate = '',
string $note = '',
string $label = '',
- string $attributes = null
+ ?string $attributes = null
): DataResponse {
$share = $this->shareManager->newShare();
@@ -1209,15 +1209,15 @@ class ShareAPIController extends OCSController {
*/
public function updateShare(
string $id,
- int $permissions = null,
- string $password = null,
- string $sendPasswordByTalk = null,
- string $publicUpload = null,
- string $expireDate = null,
- string $note = null,
- string $label = null,
- string $hideDownload = null,
- string $attributes = null
+ ?int $permissions = null,
+ ?string $password = null,
+ ?string $sendPasswordByTalk = null,
+ ?string $publicUpload = null,
+ ?string $expireDate = null,
+ ?string $note = null,
+ ?string $label = null,
+ ?string $hideDownload = null,
+ ?string $attributes = null
): DataResponse {
try {
$share = $this->getShareById($id);
diff --git a/apps/files_sharing/lib/Controller/ShareesAPIController.php b/apps/files_sharing/lib/Controller/ShareesAPIController.php
index de601607f2c..31014ac6565 100644
--- a/apps/files_sharing/lib/Controller/ShareesAPIController.php
+++ b/apps/files_sharing/lib/Controller/ShareesAPIController.php
@@ -131,7 +131,7 @@ class ShareesAPIController extends OCSController {
*
* 200: Sharees search result returned
*/
- public function search(string $search = '', string $itemType = null, int $page = 1, int $perPage = 200, $shareType = null, bool $lookup = false): DataResponse {
+ public function search(string $search = '', ?string $itemType = null, int $page = 1, int $perPage = 200, $shareType = null, bool $lookup = false): DataResponse {
// only search for string larger than a given threshold
$threshold = $this->config->getSystemValueInt('sharing.minSearchStringLength', 0);
diff --git a/apps/files_sharing/lib/External/Storage.php b/apps/files_sharing/lib/External/Storage.php
index 7b64690d53e..8cd0b50f44f 100644
--- a/apps/files_sharing/lib/External/Storage.php
+++ b/apps/files_sharing/lib/External/Storage.php
@@ -95,7 +95,7 @@ class Storage extends DAV implements ISharedStorage, IDisableEncryptionStorage,
$host = parse_url($remote, PHP_URL_HOST);
$port = parse_url($remote, PHP_URL_PORT);
- $host .= (null === $port) ? '' : ':' . $port; // we add port if available
+ $host .= ($port === null) ? '' : ':' . $port; // we add port if available
// in case remote NC is on a sub folder and using deprecated ocm provider
$tmpPath = rtrim(parse_url($this->cloudId->getRemote(), PHP_URL_PATH) ?? '', '/');
diff --git a/apps/files_sharing/lib/Helper.php b/apps/files_sharing/lib/Helper.php
index 931301a04c4..c080a4f611c 100644
--- a/apps/files_sharing/lib/Helper.php
+++ b/apps/files_sharing/lib/Helper.php
@@ -68,7 +68,7 @@ class Helper {
* @param string|null $userId
* @return string
*/
- public static function getShareFolder(View $view = null, string $userId = null): string {
+ public static function getShareFolder(?View $view = null, ?string $userId = null): string {
if ($view === null) {
$view = Filesystem::getView();
}
diff --git a/apps/files_sharing/lib/ShareBackend/File.php b/apps/files_sharing/lib/ShareBackend/File.php
index 23096d64156..4dec20cabd9 100644
--- a/apps/files_sharing/lib/ShareBackend/File.php
+++ b/apps/files_sharing/lib/ShareBackend/File.php
@@ -51,7 +51,7 @@ class File implements \OCP\Share_Backend_File_Dependent {
/** @var FederatedShareProvider */
private $federatedShareProvider;
- public function __construct(FederatedShareProvider $federatedShareProvider = null) {
+ public function __construct(?FederatedShareProvider $federatedShareProvider = null) {
if ($federatedShareProvider) {
$this->federatedShareProvider = $federatedShareProvider;
} else {