diff options
Diffstat (limited to 'apps/files_external/lib')
-rw-r--r-- | apps/files_external/lib/Command/Import.php | 4 | ||||
-rw-r--r-- | apps/files_external/lib/Command/ListCommand.php | 4 | ||||
-rw-r--r-- | apps/files_external/lib/Command/Notify.php | 4 | ||||
-rw-r--r-- | apps/files_external/lib/Controller/AjaxController.php | 2 | ||||
-rw-r--r-- | apps/files_external/lib/Lib/Auth/Password/LoginCredentials.php | 2 | ||||
-rw-r--r-- | apps/files_external/lib/Lib/FrontendDefinitionTrait.php | 2 | ||||
-rw-r--r-- | apps/files_external/lib/Lib/Storage/AmazonS3.php | 6 | ||||
-rw-r--r-- | apps/files_external/lib/Lib/Storage/FTP.php | 6 | ||||
-rw-r--r-- | apps/files_external/lib/Lib/Storage/FtpConnection.php | 14 | ||||
-rw-r--r-- | apps/files_external/lib/Lib/Storage/OwnCloud.php | 4 | ||||
-rw-r--r-- | apps/files_external/lib/Lib/Storage/SFTP.php | 12 | ||||
-rw-r--r-- | apps/files_external/lib/Lib/Storage/SMB.php | 6 | ||||
-rw-r--r-- | apps/files_external/lib/Lib/Storage/Swift.php | 4 | ||||
-rw-r--r-- | apps/files_external/lib/Settings/Admin.php | 6 | ||||
-rw-r--r-- | apps/files_external/lib/Settings/Personal.php | 6 | ||||
-rw-r--r-- | apps/files_external/lib/Settings/Section.php | 4 |
16 files changed, 43 insertions, 43 deletions
diff --git a/apps/files_external/lib/Command/Import.php b/apps/files_external/lib/Command/Import.php index 858a70b8c14..bf36bf5d5c1 100644 --- a/apps/files_external/lib/Command/Import.php +++ b/apps/files_external/lib/Command/Import.php @@ -59,7 +59,7 @@ class Import extends Base { } protected function execute(InputInterface $input, OutputInterface $output): int { - $user = (string) $input->getOption('user'); + $user = (string)$input->getOption('user'); $path = $input->getArgument('path'); if ($path === '-') { $json = file_get_contents('php://stdin'); @@ -117,7 +117,7 @@ class Import extends Base { $existingMount->getApplicableUsers() === $mount->getApplicableUsers() && $existingMount->getBackendOptions() === $mount->getBackendOptions() ) { - $output->writeln("<error>Duplicate mount (" . $mount->getMountPoint() . ")</error>"); + $output->writeln('<error>Duplicate mount (' . $mount->getMountPoint() . ')</error>'); return self::FAILURE; } } diff --git a/apps/files_external/lib/Command/ListCommand.php b/apps/files_external/lib/Command/ListCommand.php index fabcce67775..84c1b569e9d 100644 --- a/apps/files_external/lib/Command/ListCommand.php +++ b/apps/files_external/lib/Command/ListCommand.php @@ -85,11 +85,11 @@ class ListCommand extends Base { $output->writeln('[]'); } else { if ($userId === self::ALL) { - $output->writeln("<info>No mounts configured</info>"); + $output->writeln('<info>No mounts configured</info>'); } elseif ($userId) { $output->writeln("<info>No mounts configured by $userId</info>"); } else { - $output->writeln("<info>No admin mounts configured</info>"); + $output->writeln('<info>No admin mounts configured</info>'); } } return; diff --git a/apps/files_external/lib/Command/Notify.php b/apps/files_external/lib/Command/Notify.php index a4e7edf0207..09be70ecd16 100644 --- a/apps/files_external/lib/Command/Notify.php +++ b/apps/files_external/lib/Command/Notify.php @@ -136,7 +136,7 @@ class Notify extends StorageAuthBase { $storageIds = array_values(array_unique($storageIds)); if ($dryRun) { - $output->writeln(" dry-run: skipping database write"); + $output->writeln(' dry-run: skipping database write'); } else { $result = $this->updateParent($storageIds, $parent); if ($result === 0) { @@ -215,7 +215,7 @@ class Notify extends StorageAuthBase { private function selfTest(IStorage $storage, INotifyHandler $notifyHandler, OutputInterface $output): void { usleep(100 * 1000); //give time for the notify to start if (!$storage->file_put_contents('/.nc_test_file.txt', 'test content')) { - $output->writeln("Failed to create test file for self-test"); + $output->writeln('Failed to create test file for self-test'); return; } $storage->mkdir('/.nc_test_folder'); diff --git a/apps/files_external/lib/Controller/AjaxController.php b/apps/files_external/lib/Controller/AjaxController.php index 9faba64416f..dab7e092f00 100644 --- a/apps/files_external/lib/Controller/AjaxController.php +++ b/apps/files_external/lib/Controller/AjaxController.php @@ -18,7 +18,7 @@ use OCP\IUserSession; class AjaxController extends Controller { /** @var RSA */ private $rsaMechanism; - /** @var GlobalAuth */ + /** @var GlobalAuth */ private $globalAuth; /** @var IUserSession */ private $userSession; diff --git a/apps/files_external/lib/Lib/Auth/Password/LoginCredentials.php b/apps/files_external/lib/Lib/Auth/Password/LoginCredentials.php index 6fdd1a0e4ba..ea42b0275f7 100644 --- a/apps/files_external/lib/Lib/Auth/Password/LoginCredentials.php +++ b/apps/files_external/lib/Lib/Auth/Password/LoginCredentials.php @@ -100,7 +100,7 @@ class LoginCredentials extends AuthMechanism { } $credentials = $this->getCredentials($user); - $loginKey = $storage->getBackendOption("login_ldap_attr"); + $loginKey = $storage->getBackendOption('login_ldap_attr'); if ($loginKey) { $backend = $user->getBackend(); if ($backend instanceof IUserBackend && $backend->getBackendName() === 'LDAP') { diff --git a/apps/files_external/lib/Lib/FrontendDefinitionTrait.php b/apps/files_external/lib/Lib/FrontendDefinitionTrait.php index 65f46eb4dbc..5602345fe89 100644 --- a/apps/files_external/lib/Lib/FrontendDefinitionTrait.php +++ b/apps/files_external/lib/Lib/FrontendDefinitionTrait.php @@ -12,7 +12,7 @@ namespace OCA\Files_External\Lib; trait FrontendDefinitionTrait { /** @var string human-readable mechanism name */ - private string $text = ""; + private string $text = ''; /** @var array<string, DefinitionParameter> parameters for mechanism */ private array $parameters = []; diff --git a/apps/files_external/lib/Lib/Storage/AmazonS3.php b/apps/files_external/lib/Lib/Storage/AmazonS3.php index 895bd00c462..43646ac681a 100644 --- a/apps/files_external/lib/Lib/Storage/AmazonS3.php +++ b/apps/files_external/lib/Lib/Storage/AmazonS3.php @@ -128,9 +128,9 @@ class AmazonS3 extends \OC\Files\Storage\Common { } } - if (is_array($this->objectCache[$key]) && !isset($this->objectCache[$key]["Key"])) { + if (is_array($this->objectCache[$key]) && !isset($this->objectCache[$key]['Key'])) { /** @psalm-suppress InvalidArgument Psalm doesn't understand nested arrays well */ - $this->objectCache[$key]["Key"] = $key; + $this->objectCache[$key]['Key'] = $key; } return $this->objectCache[$key]; } @@ -766,7 +766,7 @@ class AmazonS3 extends \OC\Files\Storage\Common { } if (!is_resource($stream)) { - throw new \InvalidArgumentException("Invalid stream provided"); + throw new \InvalidArgumentException('Invalid stream provided'); } $path = $this->normalizePath($path); diff --git a/apps/files_external/lib/Lib/Storage/FTP.php b/apps/files_external/lib/Lib/Storage/FTP.php index 0af6ca141bb..d1f67c5a741 100644 --- a/apps/files_external/lib/Lib/Storage/FTP.php +++ b/apps/files_external/lib/Lib/Storage/FTP.php @@ -66,11 +66,11 @@ class FTP extends Common { $this->password ); } catch (\Exception $e) { - throw new StorageNotAvailableException("Failed to create ftp connection", 0, $e); + throw new StorageNotAvailableException('Failed to create ftp connection', 0, $e); } if ($this->utf8Mode) { if (!$this->connection->setUtf8Mode()) { - throw new StorageNotAvailableException("Could not set UTF-8 mode"); + throw new StorageNotAvailableException('Could not set UTF-8 mode'); } } } @@ -219,7 +219,7 @@ class FTP extends Common { } public function is_dir($path) { - if ($path === "") { + if ($path === '') { return true; } if ($this->getConnection()->chdir($this->buildPath($path)) === true) { diff --git a/apps/files_external/lib/Lib/Storage/FtpConnection.php b/apps/files_external/lib/Lib/Storage/FtpConnection.php index 8855dffbc0f..a064bf9b100 100644 --- a/apps/files_external/lib/Lib/Storage/FtpConnection.php +++ b/apps/files_external/lib/Lib/Storage/FtpConnection.php @@ -23,11 +23,11 @@ class FtpConnection { } if ($connection === false) { - throw new \Exception("Failed to connect to ftp"); + throw new \Exception('Failed to connect to ftp'); } if (ftp_login($connection, $username, $password) === false) { - throw new \Exception("Failed to connect to login to ftp"); + throw new \Exception('Failed to connect to login to ftp'); } ftp_pasv($connection, true); @@ -39,7 +39,7 @@ class FtpConnection { } public function setUtf8Mode(): bool { - $response = ftp_raw($this->connection, "OPTS UTF8 ON"); + $response = ftp_raw($this->connection, 'OPTS UTF8 ON'); return substr($response[0], 0, 3) === '200'; } @@ -75,8 +75,8 @@ class FtpConnection { $result = @ftp_mdtm($this->connection, $path); // filezilla doesn't like empty path with mdtm - if ($result === -1 && $path === "") { - $result = @ftp_mdtm($this->connection, "/"); + if ($result === -1 && $path === '') { + $result = @ftp_mdtm($this->connection, '/'); } return $result; } @@ -150,13 +150,13 @@ class FtpConnection { $parsedDate = (new \DateTime()) ->setTimestamp(strtotime("$month $day $time")); - $tomorrow = (new \DateTime())->add(new \DateInterval("P1D")); + $tomorrow = (new \DateTime())->add(new \DateInterval('P1D')); // since the provided date doesn't include the year, we either set it to the correct year // or when the date would otherwise be in the future (by more then 1 day to account for timezone errors) // we use last year if ($parsedDate > $tomorrow) { - $parsedDate = $parsedDate->sub(new \DateInterval("P1Y")); + $parsedDate = $parsedDate->sub(new \DateInterval('P1Y')); } $formattedDate = $parsedDate diff --git a/apps/files_external/lib/Lib/Storage/OwnCloud.php b/apps/files_external/lib/Lib/Storage/OwnCloud.php index d5562a3cb32..fb5c7207486 100644 --- a/apps/files_external/lib/Lib/Storage/OwnCloud.php +++ b/apps/files_external/lib/Lib/Storage/OwnCloud.php @@ -24,10 +24,10 @@ class OwnCloud extends \OC\Files\Storage\DAV implements IDisableEncryptionStorag // (owncloud install path on host) $host = $params['host']; // strip protocol - if (substr($host, 0, 8) === "https://") { + if (substr($host, 0, 8) === 'https://') { $host = substr($host, 8); $params['secure'] = true; - } elseif (substr($host, 0, 7) === "http://") { + } elseif (substr($host, 0, 7) === 'http://') { $host = substr($host, 7); $params['secure'] = false; } diff --git a/apps/files_external/lib/Lib/Storage/SFTP.php b/apps/files_external/lib/Lib/Storage/SFTP.php index 6046b7266f5..1fb6dec671d 100644 --- a/apps/files_external/lib/Lib/Storage/SFTP.php +++ b/apps/files_external/lib/Lib/Storage/SFTP.php @@ -239,7 +239,7 @@ class SFTP extends Common { $lines = file($keyPath, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); if ($lines) { foreach ($lines as $line) { - $hostKeyArray = explode("::", $line, 2); + $hostKeyArray = explode('::', $line, 2); if (count($hostKeyArray) === 2) { $hosts[] = $hostKeyArray[0]; $keys[] = $hostKeyArray[1]; @@ -311,11 +311,11 @@ class SFTP extends Common { if (!is_array($stat) || !array_key_exists('type', $stat)) { return false; } - if ((int) $stat['type'] === NET_SFTP_TYPE_REGULAR) { + if ((int)$stat['type'] === NET_SFTP_TYPE_REGULAR) { return 'file'; } - if ((int) $stat['type'] === NET_SFTP_TYPE_DIRECTORY) { + if ((int)$stat['type'] === NET_SFTP_TYPE_DIRECTORY) { return 'dir'; } } catch (\Exception $e) { @@ -478,7 +478,7 @@ class SFTP extends Common { $size = $writtenSize; }); if (!$stream) { - throw new \Exception("Failed to wrap stream"); + throw new \Exception('Failed to wrap stream'); } } /** @psalm-suppress InternalMethod */ @@ -486,11 +486,11 @@ class SFTP extends Common { fclose($stream); if ($result) { if ($size === null) { - throw new \Exception("Failed to get written size from sftp storage wrapper"); + throw new \Exception('Failed to get written size from sftp storage wrapper'); } return $size; } else { - throw new \Exception("Failed to write steam to sftp storage"); + throw new \Exception('Failed to write steam to sftp storage'); } } diff --git a/apps/files_external/lib/Lib/Storage/SMB.php b/apps/files_external/lib/Lib/Storage/SMB.php index 066d0d08f5b..bd871626bd9 100644 --- a/apps/files_external/lib/Lib/Storage/SMB.php +++ b/apps/files_external/lib/Lib/Storage/SMB.php @@ -111,7 +111,7 @@ class SMB extends Common implements INotifyStorage { $this->root = rtrim($this->root, '/') . '/'; $this->showHidden = isset($params['show_hidden']) && $params['show_hidden']; - $this->caseSensitive = (bool) ($params['case_sensitive'] ?? true); + $this->caseSensitive = (bool)($params['case_sensitive'] ?? true); $this->checkAcl = isset($params['check_acl']) && $params['check_acl']; $this->statCache = new CappedMemoryCache(); @@ -502,7 +502,7 @@ class SMB extends Common implements INotifyStorage { } catch (ForbiddenException $e) { return false; } catch (OutOfSpaceException $e) { - throw new EntityTooLargeException("not enough available space to create file", 0, $e); + throw new EntityTooLargeException('not enough available space to create file', 0, $e); } catch (ConnectException $e) { $this->logger->error('Error while opening file', ['exception' => $e]); throw new StorageNotAvailableException($e->getMessage(), (int)$e->getCode(), $e); @@ -545,7 +545,7 @@ class SMB extends Common implements INotifyStorage { } return false; } catch (OutOfSpaceException $e) { - throw new EntityTooLargeException("not enough available space to create file", 0, $e); + throw new EntityTooLargeException('not enough available space to create file', 0, $e); } catch (ConnectException $e) { $this->logger->error('Error while creating file', ['exception' => $e]); throw new StorageNotAvailableException($e->getMessage(), (int)$e->getCode(), $e); diff --git a/apps/files_external/lib/Lib/Storage/Swift.php b/apps/files_external/lib/Lib/Storage/Swift.php index f25c3cb304b..64b3179efef 100644 --- a/apps/files_external/lib/Lib/Storage/Swift.php +++ b/apps/files_external/lib/Lib/Storage/Swift.php @@ -88,7 +88,7 @@ class Swift extends \OC\Files\Storage\Common { * * @param string $path * @return StorageObject|bool object - * or false if the object did not exist + * or false if the object did not exist * @throws \OCP\Files\StorageAuthException * @throws \OCP\Files\StorageNotAvailableException */ @@ -134,7 +134,7 @@ class Swift extends \OC\Files\Storage\Common { or (empty($params['user']) && empty($params['userid'])) or empty($params['bucket']) or empty($params['region']) ) { - throw new StorageBadConfigException("API Key or password, Login, Bucket and Region have to be configured."); + throw new StorageBadConfigException('API Key or password, Login, Bucket and Region have to be configured.'); } $user = $params['user']; diff --git a/apps/files_external/lib/Settings/Admin.php b/apps/files_external/lib/Settings/Admin.php index f8235778b7c..63a420e749e 100644 --- a/apps/files_external/lib/Settings/Admin.php +++ b/apps/files_external/lib/Settings/Admin.php @@ -23,7 +23,7 @@ class Admin implements ISettings { /** @var BackendService */ private $backendService; - /** @var GlobalAuth */ + /** @var GlobalAuth */ private $globalAuth; public function __construct( @@ -66,8 +66,8 @@ class Admin implements ISettings { /** * @return int whether the form should be rather on the top or bottom of - * the admin section. The forms are arranged in ascending order of the - * priority values. It is required to return a value between 0 and 100. + * the admin section. The forms are arranged in ascending order of the + * priority values. It is required to return a value between 0 and 100. * * E.g.: 70 */ diff --git a/apps/files_external/lib/Settings/Personal.php b/apps/files_external/lib/Settings/Personal.php index 4efa7af6060..ecd56e632a9 100644 --- a/apps/files_external/lib/Settings/Personal.php +++ b/apps/files_external/lib/Settings/Personal.php @@ -24,7 +24,7 @@ class Personal implements ISettings { /** @var BackendService */ private $backendService; - /** @var GlobalAuth */ + /** @var GlobalAuth */ private $globalAuth; /** @var IUserSession */ @@ -74,8 +74,8 @@ class Personal implements ISettings { /** * @return int whether the form should be rather on the top or bottom of - * the admin section. The forms are arranged in ascending order of the - * priority values. It is required to return a value between 0 and 100. + * the admin section. The forms are arranged in ascending order of the + * priority values. It is required to return a value between 0 and 100. * * E.g.: 70 */ diff --git a/apps/files_external/lib/Settings/Section.php b/apps/files_external/lib/Settings/Section.php index eae46471e94..9bf5c092e57 100644 --- a/apps/files_external/lib/Settings/Section.php +++ b/apps/files_external/lib/Settings/Section.php @@ -46,8 +46,8 @@ class Section implements IIconSection { /** * @return int whether the form should be rather on the top or bottom of - * the settings navigation. The sections are arranged in ascending order of - * the priority values. It is required to return a value between 0 and 99. + * the settings navigation. The sections are arranged in ascending order of + * the priority values. It is required to return a value between 0 and 99. * * E.g.: 70 */ |