diff options
Diffstat (limited to 'apps/files_external/lib')
65 files changed, 36 insertions, 128 deletions
diff --git a/apps/files_external/lib/AppInfo/Application.php b/apps/files_external/lib/AppInfo/Application.php index cc587dcd80f..0a81f227b15 100644 --- a/apps/files_external/lib/AppInfo/Application.php +++ b/apps/files_external/lib/AppInfo/Application.php @@ -181,5 +181,4 @@ class Application extends App implements IBackendProvider, IAuthMechanismProvide $container->query(KerberosAuth::class), ]; } - } diff --git a/apps/files_external/lib/Command/Export.php b/apps/files_external/lib/Command/Export.php index 8d5f6990318..242f408a54d 100644 --- a/apps/files_external/lib/Command/Export.php +++ b/apps/files_external/lib/Command/Export.php @@ -29,7 +29,6 @@ use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; class Export extends ListCommand { - protected function configure() { $this ->setName('files_external:export') diff --git a/apps/files_external/lib/Config/SimpleSubstitutionTrait.php b/apps/files_external/lib/Config/SimpleSubstitutionTrait.php index b736216842b..cd57f973a21 100644 --- a/apps/files_external/lib/Config/SimpleSubstitutionTrait.php +++ b/apps/files_external/lib/Config/SimpleSubstitutionTrait.php @@ -63,12 +63,12 @@ trait SimpleSubstitutionTrait { */ protected function checkPlaceholder(): void { $this->sanitizedPlaceholder = trim(strtolower($this->placeholder)); - if(!(bool)\preg_match('/^[a-z0-9]*$/', $this->sanitizedPlaceholder)) { + if (!(bool)\preg_match('/^[a-z0-9]*$/', $this->sanitizedPlaceholder)) { throw new \RuntimeException(sprintf( 'Invalid placeholder %s, only [a-z0-9] are allowed', $this->sanitizedPlaceholder )); } - if($this->sanitizedPlaceholder === '') { + if ($this->sanitizedPlaceholder === '') { throw new \RuntimeException('Invalid empty placeholder'); } } @@ -79,7 +79,7 @@ trait SimpleSubstitutionTrait { * @return mixed */ protected function substituteIfString($value, string $replacement) { - if(is_string($value)) { + if (is_string($value)) { return str_ireplace('$' . $this->sanitizedPlaceholder, $replacement, $value); } return $value; diff --git a/apps/files_external/lib/Config/UserContext.php b/apps/files_external/lib/Config/UserContext.php index 94ac02c545b..fe65c2f2bf6 100644 --- a/apps/files_external/lib/Config/UserContext.php +++ b/apps/files_external/lib/Config/UserContext.php @@ -67,24 +67,24 @@ class UserContext { if ($this->userId !== null) { return $this->userId; } - if($this->session && $this->session->getUser() !== null) { + if ($this->session && $this->session->getUser() !== null) { return $this->session->getUser()->getUID(); } try { $shareToken = $this->request->getParam('token'); $share = $this->shareManager->getShareByToken($shareToken); return $share->getShareOwner(); - } catch (ShareNotFound $e) {} + } catch (ShareNotFound $e) { + } return null; } protected function getUser(): ?IUser { $userId = $this->getUserId(); - if($userId !== null) { + if ($userId !== null) { return $this->userManager->get($userId); } return null; } - } diff --git a/apps/files_external/lib/Config/UserPlaceholderHandler.php b/apps/files_external/lib/Config/UserPlaceholderHandler.php index 4922143fa63..bc324931a7e 100644 --- a/apps/files_external/lib/Config/UserPlaceholderHandler.php +++ b/apps/files_external/lib/Config/UserPlaceholderHandler.php @@ -35,7 +35,7 @@ class UserPlaceholderHandler extends UserContext implements IConfigHandler { public function handle($optionValue) { $this->placeholder = 'user'; $uid = $this->getUserId(); - if($uid === null) { + if ($uid === null) { return $optionValue; } return $this->processInput($optionValue, $uid); diff --git a/apps/files_external/lib/Controller/ApiController.php b/apps/files_external/lib/Controller/ApiController.php index 9da869ce5a8..6418e5d73ad 100644 --- a/apps/files_external/lib/Controller/ApiController.php +++ b/apps/files_external/lib/Controller/ApiController.php @@ -100,7 +100,7 @@ class ApiController extends OCSController { $user = $this->userSession->getUser()->getUID(); $mounts = \OC_Mount_Config::getAbsoluteMountPoints($user); - foreach($mounts as $mountPoint => $mount) { + foreach ($mounts as $mountPoint => $mount) { $entries[] = $this->formatMount($mountPoint, $mount); } diff --git a/apps/files_external/lib/Controller/GlobalStoragesController.php b/apps/files_external/lib/Controller/GlobalStoragesController.php index 398399d820d..d42facb18ac 100644 --- a/apps/files_external/lib/Controller/GlobalStoragesController.php +++ b/apps/files_external/lib/Controller/GlobalStoragesController.php @@ -183,8 +183,5 @@ class GlobalStoragesController extends StoragesController { $this->formatStorageForUI($storage), Http::STATUS_OK ); - } - - } diff --git a/apps/files_external/lib/Controller/StoragesController.php b/apps/files_external/lib/Controller/StoragesController.php index d087a5e3900..a3a2712520a 100644 --- a/apps/files_external/lib/Controller/StoragesController.php +++ b/apps/files_external/lib/Controller/StoragesController.php @@ -363,5 +363,4 @@ abstract class StoragesController extends Controller { return new DataResponse([], Http::STATUS_NO_CONTENT); } - } diff --git a/apps/files_external/lib/Controller/UserGlobalStoragesController.php b/apps/files_external/lib/Controller/UserGlobalStoragesController.php index 3773461d00c..1f7eb595701 100644 --- a/apps/files_external/lib/Controller/UserGlobalStoragesController.php +++ b/apps/files_external/lib/Controller/UserGlobalStoragesController.php @@ -186,7 +186,6 @@ class UserGlobalStoragesController extends StoragesController { $this->formatStorageForUI($storage), Http::STATUS_OK ); - } /** @@ -206,5 +205,4 @@ class UserGlobalStoragesController extends StoragesController { } } } - } diff --git a/apps/files_external/lib/Controller/UserStoragesController.php b/apps/files_external/lib/Controller/UserStoragesController.php index 787e7affaf5..8c588fc967e 100644 --- a/apps/files_external/lib/Controller/UserStoragesController.php +++ b/apps/files_external/lib/Controller/UserStoragesController.php @@ -211,7 +211,6 @@ class UserStoragesController extends StoragesController { $this->formatStorageForUI($storage), Http::STATUS_OK ); - } /** @@ -224,5 +223,4 @@ class UserStoragesController extends StoragesController { public function destroy($id) { return parent::destroy($id); } - } diff --git a/apps/files_external/lib/Lib/Auth/AmazonS3/AccessKey.php b/apps/files_external/lib/Lib/Auth/AmazonS3/AccessKey.php index 78c9241a83c..4822789ba2b 100644 --- a/apps/files_external/lib/Lib/Auth/AmazonS3/AccessKey.php +++ b/apps/files_external/lib/Lib/Auth/AmazonS3/AccessKey.php @@ -32,7 +32,6 @@ use OCP\IL10N; * Amazon S3 access key authentication */ class AccessKey extends AuthMechanism { - const SCHEME_AMAZONS3_ACCESSKEY = 'amazons3_accesskey'; public function __construct(IL10N $l) { @@ -46,5 +45,4 @@ class AccessKey extends AuthMechanism { ->setType(DefinitionParameter::VALUE_PASSWORD), ]); } - } diff --git a/apps/files_external/lib/Lib/Auth/AuthMechanism.php b/apps/files_external/lib/Lib/Auth/AuthMechanism.php index cd8f8242e30..c13774ea5e0 100644 --- a/apps/files_external/lib/Lib/Auth/AuthMechanism.php +++ b/apps/files_external/lib/Lib/Auth/AuthMechanism.php @@ -118,5 +118,4 @@ class AuthMechanism implements \JsonSerializable { return $this->validateStorageDefinition($storage); } - } diff --git a/apps/files_external/lib/Lib/Auth/Builtin.php b/apps/files_external/lib/Lib/Auth/Builtin.php index 87c98d6957b..0f3d5342c6e 100644 --- a/apps/files_external/lib/Lib/Auth/Builtin.php +++ b/apps/files_external/lib/Lib/Auth/Builtin.php @@ -29,7 +29,6 @@ use OCP\IL10N; * Builtin authentication mechanism, for legacy backends */ class Builtin extends AuthMechanism { - public function __construct(IL10N $l) { $this ->setIdentifier('builtin::builtin') @@ -37,5 +36,4 @@ class Builtin extends AuthMechanism { ->setText($l->t('Builtin')) ; } - } diff --git a/apps/files_external/lib/Lib/Auth/InvalidAuth.php b/apps/files_external/lib/Lib/Auth/InvalidAuth.php index 8aff7bc163d..61302125b4f 100644 --- a/apps/files_external/lib/Lib/Auth/InvalidAuth.php +++ b/apps/files_external/lib/Lib/Auth/InvalidAuth.php @@ -41,5 +41,4 @@ class InvalidAuth extends AuthMechanism { ->setText('Unknown auth mechanism backend ' . $invalidId) ; } - } diff --git a/apps/files_external/lib/Lib/Auth/NullMechanism.php b/apps/files_external/lib/Lib/Auth/NullMechanism.php index 57b9774b441..e7a30ea613e 100644 --- a/apps/files_external/lib/Lib/Auth/NullMechanism.php +++ b/apps/files_external/lib/Lib/Auth/NullMechanism.php @@ -29,7 +29,6 @@ use OCP\IL10N; * Null authentication mechanism */ class NullMechanism extends AuthMechanism { - public function __construct(IL10N $l) { $this ->setIdentifier('null::null') @@ -37,5 +36,4 @@ class NullMechanism extends AuthMechanism { ->setText($l->t('None')) ; } - } diff --git a/apps/files_external/lib/Lib/Auth/OAuth1/OAuth1.php b/apps/files_external/lib/Lib/Auth/OAuth1/OAuth1.php index 26b8c6348db..d93a09292ad 100644 --- a/apps/files_external/lib/Lib/Auth/OAuth1/OAuth1.php +++ b/apps/files_external/lib/Lib/Auth/OAuth1/OAuth1.php @@ -32,7 +32,6 @@ use OCP\IL10N; * OAuth1 authentication */ class OAuth1 extends AuthMechanism { - public function __construct(IL10N $l) { $this ->setIdentifier('oauth1::oauth1') @@ -52,5 +51,4 @@ class OAuth1 extends AuthMechanism { ->addCustomJs('oauth1') ; } - } diff --git a/apps/files_external/lib/Lib/Auth/OAuth2/OAuth2.php b/apps/files_external/lib/Lib/Auth/OAuth2/OAuth2.php index 8fbe412c2cf..17add489776 100644 --- a/apps/files_external/lib/Lib/Auth/OAuth2/OAuth2.php +++ b/apps/files_external/lib/Lib/Auth/OAuth2/OAuth2.php @@ -32,7 +32,6 @@ use OCP\IL10N; * OAuth2 authentication */ class OAuth2 extends AuthMechanism { - public function __construct(IL10N $l) { $this ->setIdentifier('oauth2::oauth2') @@ -50,5 +49,4 @@ class OAuth2 extends AuthMechanism { ->addCustomJs('oauth2') ; } - } diff --git a/apps/files_external/lib/Lib/Auth/OpenStack/OpenStackV2.php b/apps/files_external/lib/Lib/Auth/OpenStack/OpenStackV2.php index 688911b7d52..723ecc5068b 100644 --- a/apps/files_external/lib/Lib/Auth/OpenStack/OpenStackV2.php +++ b/apps/files_external/lib/Lib/Auth/OpenStack/OpenStackV2.php @@ -33,7 +33,6 @@ use OCP\IL10N; * OpenStack Keystone authentication */ class OpenStackV2 extends AuthMechanism { - public function __construct(IL10N $l) { $this ->setIdentifier('openstack::openstack') @@ -48,5 +47,4 @@ class OpenStackV2 extends AuthMechanism { ]) ; } - } diff --git a/apps/files_external/lib/Lib/Auth/OpenStack/OpenStackV3.php b/apps/files_external/lib/Lib/Auth/OpenStack/OpenStackV3.php index 75f2fc3173c..c8a78f52c41 100644 --- a/apps/files_external/lib/Lib/Auth/OpenStack/OpenStackV3.php +++ b/apps/files_external/lib/Lib/Auth/OpenStack/OpenStackV3.php @@ -36,7 +36,6 @@ use OCP\IL10N; * OpenStack Keystone authentication */ class OpenStackV3 extends AuthMechanism { - public function __construct(IL10N $l) { $this ->setIdentifier('openstack::openstackv3') @@ -51,5 +50,4 @@ class OpenStackV3 extends AuthMechanism { ]) ; } - } diff --git a/apps/files_external/lib/Lib/Auth/OpenStack/Rackspace.php b/apps/files_external/lib/Lib/Auth/OpenStack/Rackspace.php index 2d3fbcdcc73..4fa2a07440c 100644 --- a/apps/files_external/lib/Lib/Auth/OpenStack/Rackspace.php +++ b/apps/files_external/lib/Lib/Auth/OpenStack/Rackspace.php @@ -32,7 +32,6 @@ use OCP\IL10N; * Rackspace authentication */ class Rackspace extends AuthMechanism { - public function __construct(IL10N $l) { $this ->setIdentifier('openstack::rackspace') @@ -45,5 +44,4 @@ class Rackspace extends AuthMechanism { ]) ; } - } diff --git a/apps/files_external/lib/Lib/Auth/Password/GlobalAuth.php b/apps/files_external/lib/Lib/Auth/Password/GlobalAuth.php index 8051e863609..de6e34c4443 100644 --- a/apps/files_external/lib/Lib/Auth/Password/GlobalAuth.php +++ b/apps/files_external/lib/Lib/Auth/Password/GlobalAuth.php @@ -36,7 +36,6 @@ use OCP\Security\ICredentialsManager; * Global Username and Password */ class GlobalAuth extends AuthMechanism { - const CREDENTIALS_IDENTIFIER = 'password::global'; /** @var ICredentialsManager */ @@ -86,5 +85,4 @@ class GlobalAuth extends AuthMechanism { $storage->setBackendOption('password', $credentials['password']); } } - } diff --git a/apps/files_external/lib/Lib/Auth/Password/LoginCredentials.php b/apps/files_external/lib/Lib/Auth/Password/LoginCredentials.php index fe5f11ca203..0165bb6d077 100644 --- a/apps/files_external/lib/Lib/Auth/Password/LoginCredentials.php +++ b/apps/files_external/lib/Lib/Auth/Password/LoginCredentials.php @@ -35,7 +35,6 @@ use OCP\Security\ICredentialsManager; * Username and password from login credentials, saved in DB */ class LoginCredentials extends AuthMechanism { - const CREDENTIALS_IDENTIFIER = 'password::logincredentials/credentials'; /** @var ISession */ @@ -87,5 +86,4 @@ class LoginCredentials extends AuthMechanism { $storage->setBackendOption('user', $credentials['user']); $storage->setBackendOption('password', $credentials['password']); } - } diff --git a/apps/files_external/lib/Lib/Auth/Password/Password.php b/apps/files_external/lib/Lib/Auth/Password/Password.php index 4429379fda1..79be4282014 100644 --- a/apps/files_external/lib/Lib/Auth/Password/Password.php +++ b/apps/files_external/lib/Lib/Auth/Password/Password.php @@ -32,7 +32,6 @@ use OCP\IL10N; * Basic password authentication mechanism */ class Password extends AuthMechanism { - public function __construct(IL10N $l) { $this ->setIdentifier('password::password') @@ -44,5 +43,4 @@ class Password extends AuthMechanism { ->setType(DefinitionParameter::VALUE_PASSWORD), ]); } - } diff --git a/apps/files_external/lib/Lib/Auth/Password/SessionCredentials.php b/apps/files_external/lib/Lib/Auth/Password/SessionCredentials.php index 1e899c79d7e..47fb044f885 100644 --- a/apps/files_external/lib/Lib/Auth/Password/SessionCredentials.php +++ b/apps/files_external/lib/Lib/Auth/Password/SessionCredentials.php @@ -65,5 +65,4 @@ class SessionCredentials extends AuthMechanism { public function wrapStorage(Storage $storage) { return new SessionStorageWrapper(['storage' => $storage]); } - } diff --git a/apps/files_external/lib/Lib/Auth/Password/UserGlobalAuth.php b/apps/files_external/lib/Lib/Auth/Password/UserGlobalAuth.php index 80829b6a07c..ea39cabb2d0 100644 --- a/apps/files_external/lib/Lib/Auth/Password/UserGlobalAuth.php +++ b/apps/files_external/lib/Lib/Auth/Password/UserGlobalAuth.php @@ -40,7 +40,6 @@ use OCP\Security\ICredentialsManager; * User provided Global Username and Password */ class UserGlobalAuth extends AuthMechanism { - private const CREDENTIALS_IDENTIFIER = 'password::global'; /** @var ICredentialsManager */ @@ -59,7 +58,7 @@ class UserGlobalAuth extends AuthMechanism { public function saveBackendOptions(IUser $user, $id, $backendOptions) { // backendOptions are set when invoked via Files app // but they are not set when invoked via ext storage settings - if(!isset($backendOptions['user']) && !isset($backendOptions['password'])) { + if (!isset($backendOptions['user']) && !isset($backendOptions['password'])) { return; } // make sure we're not setting any unexpected keys @@ -83,5 +82,4 @@ class UserGlobalAuth extends AuthMechanism { $storage->setBackendOption('password', $credentials['password']); } } - } diff --git a/apps/files_external/lib/Lib/Auth/Password/UserProvided.php b/apps/files_external/lib/Lib/Auth/Password/UserProvided.php index 0594730d1b8..552b707b544 100644 --- a/apps/files_external/lib/Lib/Auth/Password/UserProvided.php +++ b/apps/files_external/lib/Lib/Auth/Password/UserProvided.php @@ -37,7 +37,6 @@ use OCP\Security\ICredentialsManager; * User provided Username and Password */ class UserProvided extends AuthMechanism implements IUserProvided { - const CREDENTIALS_IDENTIFIER_PREFIX = 'password::userprovided/'; /** @var ICredentialsManager */ @@ -85,5 +84,4 @@ class UserProvided extends AuthMechanism implements IUserProvided { $storage->setBackendOption('user', $credentials['user']); $storage->setBackendOption('password', $credentials['password']); } - } diff --git a/apps/files_external/lib/Lib/Auth/PublicKey/RSA.php b/apps/files_external/lib/Lib/Auth/PublicKey/RSA.php index 2135b758818..f3e6c891e73 100644 --- a/apps/files_external/lib/Lib/Auth/PublicKey/RSA.php +++ b/apps/files_external/lib/Lib/Auth/PublicKey/RSA.php @@ -83,5 +83,4 @@ class RSA extends AuthMechanism { return $rsa->createKey($keyLength); } - } diff --git a/apps/files_external/lib/Lib/Backend/AmazonS3.php b/apps/files_external/lib/Lib/Backend/AmazonS3.php index dff2cca9f23..5473975f372 100644 --- a/apps/files_external/lib/Lib/Backend/AmazonS3.php +++ b/apps/files_external/lib/Lib/Backend/AmazonS3.php @@ -31,7 +31,6 @@ use OCA\Files_External\Lib\LegacyDependencyCheckPolyfill; use OCP\IL10N; class AmazonS3 extends Backend { - use LegacyDependencyCheckPolyfill; public function __construct(IL10N $l, AccessKey $legacyAuth) { @@ -59,5 +58,4 @@ class AmazonS3 extends Backend { ->setLegacyAuthMechanism($legacyAuth) ; } - } diff --git a/apps/files_external/lib/Lib/Backend/Backend.php b/apps/files_external/lib/Lib/Backend/Backend.php index 4b3d5c31011..69d41f85ecf 100644 --- a/apps/files_external/lib/Lib/Backend/Backend.php +++ b/apps/files_external/lib/Lib/Backend/Backend.php @@ -57,7 +57,6 @@ use OCA\Files_External\Lib\VisibilityTrait; * Object can affect storage mounting */ class Backend implements \JsonSerializable { - use VisibilityTrait; use FrontendDefinitionTrait; use PriorityTrait; @@ -162,5 +161,4 @@ class Backend implements \JsonSerializable { public function validateStorage(StorageConfig $storage) { return $this->validateStorageDefinition($storage); } - } diff --git a/apps/files_external/lib/Lib/Backend/DAV.php b/apps/files_external/lib/Lib/Backend/DAV.php index c7c13143628..0991c5ac1df 100644 --- a/apps/files_external/lib/Lib/Backend/DAV.php +++ b/apps/files_external/lib/Lib/Backend/DAV.php @@ -31,7 +31,6 @@ use OCA\Files_External\Lib\LegacyDependencyCheckPolyfill; use OCP\IL10N; class DAV extends Backend { - use LegacyDependencyCheckPolyfill; public function __construct(IL10N $l, Password $legacyAuth) { @@ -51,5 +50,4 @@ class DAV extends Backend { ->setLegacyAuthMechanism($legacyAuth) ; } - } diff --git a/apps/files_external/lib/Lib/Backend/FTP.php b/apps/files_external/lib/Lib/Backend/FTP.php index 63be8fa5696..bc35a5d386a 100644 --- a/apps/files_external/lib/Lib/Backend/FTP.php +++ b/apps/files_external/lib/Lib/Backend/FTP.php @@ -31,7 +31,6 @@ use OCA\Files_External\Lib\LegacyDependencyCheckPolyfill; use OCP\IL10N; class FTP extends Backend { - use LegacyDependencyCheckPolyfill; public function __construct(IL10N $l, Password $legacyAuth) { @@ -51,5 +50,4 @@ class FTP extends Backend { ->setLegacyAuthMechanism($legacyAuth) ; } - } diff --git a/apps/files_external/lib/Lib/Backend/LegacyBackend.php b/apps/files_external/lib/Lib/Backend/LegacyBackend.php index a1d6bbfad63..87dabda8bb6 100644 --- a/apps/files_external/lib/Lib/Backend/LegacyBackend.php +++ b/apps/files_external/lib/Lib/Backend/LegacyBackend.php @@ -32,7 +32,6 @@ use OCA\Files_External\Lib\MissingDependency; * Legacy compatibility for OC_Mount_Config::registerBackend() */ class LegacyBackend extends Backend { - use LegacyDependencyCheckPolyfill { LegacyDependencyCheckPolyfill::checkDependencies as doCheckDependencies; } @@ -101,5 +100,4 @@ class LegacyBackend extends Backend { } return []; } - } diff --git a/apps/files_external/lib/Lib/Backend/Local.php b/apps/files_external/lib/Lib/Backend/Local.php index b22b0db5749..67b50e127e9 100644 --- a/apps/files_external/lib/Lib/Backend/Local.php +++ b/apps/files_external/lib/Lib/Backend/Local.php @@ -31,7 +31,6 @@ use OCA\Files_External\Service\BackendService; use OCP\IL10N; class Local extends Backend { - public function __construct(IL10N $l, NullMechanism $legacyAuth) { $this ->setIdentifier('local') @@ -47,5 +46,4 @@ class Local extends Backend { ->setLegacyAuthMechanism($legacyAuth) ; } - } diff --git a/apps/files_external/lib/Lib/Backend/OwnCloud.php b/apps/files_external/lib/Lib/Backend/OwnCloud.php index 1221cf9ef63..876f8709cc3 100644 --- a/apps/files_external/lib/Lib/Backend/OwnCloud.php +++ b/apps/files_external/lib/Lib/Backend/OwnCloud.php @@ -31,7 +31,6 @@ use OCA\Files_External\Lib\DefinitionParameter; use OCP\IL10N; class OwnCloud extends Backend { - public function __construct(IL10N $l, Password $legacyAuth) { $this ->setIdentifier('owncloud') @@ -49,5 +48,4 @@ class OwnCloud extends Backend { ->setLegacyAuthMechanism($legacyAuth) ; } - } diff --git a/apps/files_external/lib/Lib/Backend/SFTP.php b/apps/files_external/lib/Lib/Backend/SFTP.php index 88e9ce14b4a..a7f97c6b79a 100644 --- a/apps/files_external/lib/Lib/Backend/SFTP.php +++ b/apps/files_external/lib/Lib/Backend/SFTP.php @@ -30,7 +30,6 @@ use OCA\Files_External\Lib\DefinitionParameter; use OCP\IL10N; class SFTP extends Backend { - public function __construct(IL10N $l, Password $legacyAuth) { $this ->setIdentifier('sftp') @@ -47,5 +46,4 @@ class SFTP extends Backend { ->setLegacyAuthMechanism($legacyAuth) ; } - } diff --git a/apps/files_external/lib/Lib/Backend/SFTP_Key.php b/apps/files_external/lib/Lib/Backend/SFTP_Key.php index a9420a909e8..924d6a62ffe 100644 --- a/apps/files_external/lib/Lib/Backend/SFTP_Key.php +++ b/apps/files_external/lib/Lib/Backend/SFTP_Key.php @@ -30,7 +30,6 @@ use OCA\Files_External\Lib\DefinitionParameter; use OCP\IL10N; class SFTP_Key extends Backend { - public function __construct(IL10N $l, RSA $legacyAuth, SFTP $sftpBackend) { $this ->setIdentifier('\OC\Files\Storage\SFTP_Key') @@ -46,5 +45,4 @@ class SFTP_Key extends Backend { ->deprecateTo($sftpBackend) ; } - } diff --git a/apps/files_external/lib/Lib/Backend/SMB.php b/apps/files_external/lib/Lib/Backend/SMB.php index 20501e5bfe1..eefeb137bf8 100644 --- a/apps/files_external/lib/Lib/Backend/SMB.php +++ b/apps/files_external/lib/Lib/Backend/SMB.php @@ -38,7 +38,6 @@ use OCP\IL10N; use OCP\IUser; class SMB extends Backend { - use LegacyDependencyCheckPolyfill; public function __construct(IL10N $l, Password $legacyAuth) { @@ -90,5 +89,4 @@ class SMB extends Backend { $storage->setBackendOption('auth', $smbAuth); } - } diff --git a/apps/files_external/lib/Lib/Backend/SMB_OC.php b/apps/files_external/lib/Lib/Backend/SMB_OC.php index 9c28a52e049..439d85164cc 100644 --- a/apps/files_external/lib/Lib/Backend/SMB_OC.php +++ b/apps/files_external/lib/Lib/Backend/SMB_OC.php @@ -37,7 +37,6 @@ use OCP\IUser; * Deprecated SMB_OC class - use SMB with the password::sessioncredentials auth mechanism */ class SMB_OC extends Backend { - use LegacyDependencyCheckPolyfill; public function __construct(IL10N $l, SessionCredentials $legacyAuth, SMB $smbBackend) { @@ -69,5 +68,4 @@ class SMB_OC extends Backend { $storage->setBackendOption('share', $share); } } - } diff --git a/apps/files_external/lib/Lib/Backend/Swift.php b/apps/files_external/lib/Lib/Backend/Swift.php index 5d4d5ec1408..25ed72337a1 100644 --- a/apps/files_external/lib/Lib/Backend/Swift.php +++ b/apps/files_external/lib/Lib/Backend/Swift.php @@ -33,7 +33,6 @@ use OCA\Files_External\Lib\LegacyDependencyCheckPolyfill; use OCP\IL10N; class Swift extends Backend { - use LegacyDependencyCheckPolyfill; public function __construct(IL10N $l, OpenStackV2 $openstackAuth, Rackspace $rackspaceAuth) { @@ -60,5 +59,4 @@ class Swift extends Backend { }) ; } - } diff --git a/apps/files_external/lib/Lib/Config/IAuthMechanismProvider.php b/apps/files_external/lib/Lib/Config/IAuthMechanismProvider.php index 674f3ccf371..e8f142c01da 100644 --- a/apps/files_external/lib/Lib/Config/IAuthMechanismProvider.php +++ b/apps/files_external/lib/Lib/Config/IAuthMechanismProvider.php @@ -36,5 +36,4 @@ interface IAuthMechanismProvider { * @return AuthMechanism[] */ public function getAuthMechanisms(); - } diff --git a/apps/files_external/lib/Lib/Config/IBackendProvider.php b/apps/files_external/lib/Lib/Config/IBackendProvider.php index fd0deadcb23..7757f204c8c 100644 --- a/apps/files_external/lib/Lib/Config/IBackendProvider.php +++ b/apps/files_external/lib/Lib/Config/IBackendProvider.php @@ -36,5 +36,4 @@ interface IBackendProvider { * @return Backend[] */ public function getBackends(); - } diff --git a/apps/files_external/lib/Lib/DependencyTrait.php b/apps/files_external/lib/Lib/DependencyTrait.php index df7e29c7a79..b88a111392a 100644 --- a/apps/files_external/lib/Lib/DependencyTrait.php +++ b/apps/files_external/lib/Lib/DependencyTrait.php @@ -35,5 +35,4 @@ trait DependencyTrait { public function checkDependencies() { return []; // no dependencies by default } - } diff --git a/apps/files_external/lib/Lib/IdentifierTrait.php b/apps/files_external/lib/Lib/IdentifierTrait.php index 9aa6095c25e..6bdde976753 100644 --- a/apps/files_external/lib/Lib/IdentifierTrait.php +++ b/apps/files_external/lib/Lib/IdentifierTrait.php @@ -100,5 +100,4 @@ trait IdentifierTrait { } return $data; } - } diff --git a/apps/files_external/lib/Lib/LegacyDependencyCheckPolyfill.php b/apps/files_external/lib/Lib/LegacyDependencyCheckPolyfill.php index cf720b35a5b..787872511f9 100644 --- a/apps/files_external/lib/Lib/LegacyDependencyCheckPolyfill.php +++ b/apps/files_external/lib/Lib/LegacyDependencyCheckPolyfill.php @@ -64,5 +64,4 @@ trait LegacyDependencyCheckPolyfill { return $ret; } - } diff --git a/apps/files_external/lib/Lib/PriorityTrait.php b/apps/files_external/lib/Lib/PriorityTrait.php index f6cfb7c4dfb..12e30de231f 100644 --- a/apps/files_external/lib/Lib/PriorityTrait.php +++ b/apps/files_external/lib/Lib/PriorityTrait.php @@ -57,5 +57,4 @@ trait PriorityTrait { public static function priorityCompare(PriorityTrait $a, PriorityTrait $b) { return ($a->getPriority() - $b->getPriority()); } - } diff --git a/apps/files_external/lib/Lib/SessionStorageWrapper.php b/apps/files_external/lib/Lib/SessionStorageWrapper.php index de082ccc3ad..2b8f2b8613b 100644 --- a/apps/files_external/lib/Lib/SessionStorageWrapper.php +++ b/apps/files_external/lib/Lib/SessionStorageWrapper.php @@ -39,5 +39,4 @@ class SessionStorageWrapper extends PermissionsMask { $arguments['mask'] = Constants::PERMISSION_ALL & ~Constants::PERMISSION_SHARE; parent::__construct($arguments); } - } diff --git a/apps/files_external/lib/Lib/Storage/AmazonS3.php b/apps/files_external/lib/Lib/Storage/AmazonS3.php index 99cfcb594a9..0fb520cf9d4 100644 --- a/apps/files_external/lib/Lib/Storage/AmazonS3.php +++ b/apps/files_external/lib/Lib/Storage/AmazonS3.php @@ -649,7 +649,6 @@ class AmazonS3 extends \OC\Files\Storage\Common { $path2 = $this->normalizePath($path2); if ($this->is_file($path1)) { - if ($this->copy($path1, $path2) === false) { return false; } @@ -659,7 +658,6 @@ class AmazonS3 extends \OC\Files\Storage\Common { return false; } } else { - if ($this->copy($path1, $path2) === false) { return false; } @@ -704,5 +702,4 @@ class AmazonS3 extends \OC\Files\Storage\Common { public static function checkDependencies() { return true; } - } diff --git a/apps/files_external/lib/Lib/Storage/FTP.php b/apps/files_external/lib/Lib/Storage/FTP.php index 0015f3008ef..d514bd7b7b0 100644 --- a/apps/files_external/lib/Lib/Storage/FTP.php +++ b/apps/files_external/lib/Lib/Storage/FTP.php @@ -38,7 +38,7 @@ namespace OCA\Files_External\Lib\Storage; use Icewind\Streams\CallbackWrapper; use Icewind\Streams\RetryWrapper; -class FTP extends StreamWrapper{ +class FTP extends StreamWrapper { private $password; private $user; private $host; @@ -65,7 +65,6 @@ class FTP extends StreamWrapper{ } else { throw new \Exception('Creating FTP storage failed'); } - } public function getId() { @@ -93,8 +92,7 @@ class FTP extends StreamWrapper{ public function unlink($path) { if ($this->is_dir($path)) { return $this->rmdir($path); - } - else { + } else { $url = $this->constructUrl($path); $result = unlink($url); clearstatcache(true, $url); @@ -102,7 +100,7 @@ class FTP extends StreamWrapper{ } } public function fopen($path,$mode) { - switch($mode) { + switch ($mode) { case 'r': case 'rb': case 'w': @@ -154,5 +152,4 @@ class FTP extends StreamWrapper{ return ['ftp']; } } - } diff --git a/apps/files_external/lib/Lib/Storage/OwnCloud.php b/apps/files_external/lib/Lib/Storage/OwnCloud.php index 1738aacd258..d8e3ee321b7 100644 --- a/apps/files_external/lib/Lib/Storage/OwnCloud.php +++ b/apps/files_external/lib/Lib/Storage/OwnCloud.php @@ -55,19 +55,18 @@ class OwnCloud extends \OC\Files\Storage\DAV implements IDisableEncryptionStorag } $contextPath = ''; $hostSlashPos = strpos($host, '/'); - if ($hostSlashPos !== false){ + if ($hostSlashPos !== false) { $contextPath = substr($host, $hostSlashPos); $host = substr($host, 0, $hostSlashPos); } - if (substr($contextPath, -1) !== '/'){ + if (substr($contextPath, -1) !== '/') { $contextPath .= '/'; } - if (isset($params['root'])){ + if (isset($params['root'])) { $root = '/' . ltrim($params['root'], '/'); - } - else{ + } else { $root = '/'; } diff --git a/apps/files_external/lib/Lib/Storage/SFTP.php b/apps/files_external/lib/Lib/Storage/SFTP.php index 9682ebd4535..bc6cd663b6d 100644 --- a/apps/files_external/lib/Lib/Storage/SFTP.php +++ b/apps/files_external/lib/Lib/Storage/SFTP.php @@ -70,7 +70,7 @@ class SFTP extends \OC\Files\Storage\Common { } $parsed = parse_url($host); - if(is_array($parsed) && isset($parsed['port'])) { + if (is_array($parsed) && isset($parsed['port'])) { return [$parsed['host'], $parsed['port']]; } elseif (is_array($parsed)) { return [$parsed['host'], 22]; @@ -310,13 +310,13 @@ class SFTP extends \OC\Files\Storage\Common { $id = md5('sftp:' . $path); $dirStream = []; - foreach($list as $file) { + foreach ($list as $file) { if ($file !== '.' && $file !== '..') { $dirStream[] = $file; } } return IteratorDirectory::wrap($dirStream); - } catch(\Exception $e) { + } catch (\Exception $e) { return false; } } @@ -335,7 +335,6 @@ class SFTP extends \OC\Files\Storage\Common { return 'dir'; } } catch (\Exception $e) { - } return false; } @@ -368,7 +367,7 @@ class SFTP extends \OC\Files\Storage\Common { public function fopen($path, $mode) { try { $absPath = $this->absPath($path); - switch($mode) { + switch ($mode) { case 'r': case 'rb': if (!$this->file_exists($path)) { diff --git a/apps/files_external/lib/Lib/Storage/SFTPReadStream.php b/apps/files_external/lib/Lib/Storage/SFTPReadStream.php index 455b4a7cf28..a3023d1a22b 100644 --- a/apps/files_external/lib/Lib/Storage/SFTPReadStream.php +++ b/apps/files_external/lib/Lib/Storage/SFTPReadStream.php @@ -200,5 +200,4 @@ class SFTPReadStream implements File { return false; } } - } diff --git a/apps/files_external/lib/Lib/Storage/SFTPWriteStream.php b/apps/files_external/lib/Lib/Storage/SFTPWriteStream.php index b5bc3ab667d..50faf8f466c 100644 --- a/apps/files_external/lib/Lib/Storage/SFTPWriteStream.php +++ b/apps/files_external/lib/Lib/Storage/SFTPWriteStream.php @@ -178,5 +178,4 @@ class SFTPWriteStream implements File { return false; } } - } diff --git a/apps/files_external/lib/Lib/Storage/SMB.php b/apps/files_external/lib/Lib/Storage/SMB.php index 506774d5cea..d010fb54840 100644 --- a/apps/files_external/lib/Lib/Storage/SMB.php +++ b/apps/files_external/lib/Lib/Storage/SMB.php @@ -185,7 +185,7 @@ class SMB extends Common implements INotifyStorage { } catch (ForbiddenException $e) { // with php-smbclient, this exceptions is thrown when the provided password is invalid. // Possible is also ForbiddenException with a different error code, so we check it. - if($e->getCode() === 1) { + if ($e->getCode() === 1) { $this->throwUnavailable($e); } throw $e; diff --git a/apps/files_external/lib/Lib/Storage/StreamWrapper.php b/apps/files_external/lib/Lib/Storage/StreamWrapper.php index 5d85aaace6e..b77b9e0fe46 100644 --- a/apps/files_external/lib/Lib/Storage/StreamWrapper.php +++ b/apps/files_external/lib/Lib/Storage/StreamWrapper.php @@ -126,5 +126,4 @@ abstract class StreamWrapper extends \OC\Files\Storage\Common { public function stat($path) { return stat($this->constructUrl($path)); } - } diff --git a/apps/files_external/lib/Lib/Storage/Swift.php b/apps/files_external/lib/Lib/Storage/Swift.php index a928f5b75d9..96fb4f0ac9a 100644 --- a/apps/files_external/lib/Lib/Storage/Swift.php +++ b/apps/files_external/lib/Lib/Storage/Swift.php @@ -316,7 +316,6 @@ class Swift extends \OC\Files\Storage\Common { ]); return false; } - } public function stat($path) { @@ -505,7 +504,6 @@ class Swift extends \OC\Files\Storage\Common { ]); return false; } - } elseif ($fileType === 'dir') { try { $source = $this->fetchObject($path1 . '/'); @@ -533,7 +531,6 @@ class Swift extends \OC\Files\Storage\Common { $target = $path2 . '/' . $file; $this->copy($source, $target); } - } else { //file does not exist return false; @@ -625,5 +622,4 @@ class Swift extends \OC\Files\Storage\Common { public static function checkDependencies() { return true; } - } diff --git a/apps/files_external/lib/Lib/StorageConfig.php b/apps/files_external/lib/Lib/StorageConfig.php index aba5d3247c8..5ed65918b22 100644 --- a/apps/files_external/lib/Lib/StorageConfig.php +++ b/apps/files_external/lib/Lib/StorageConfig.php @@ -215,10 +215,10 @@ class StorageConfig implements \JsonSerializable { * @param array $backendOptions backend options */ public function setBackendOptions($backendOptions) { - if($this->getBackend() instanceof Backend) { + if ($this->getBackend() instanceof Backend) { $parameters = $this->getBackend()->getParameters(); - foreach($backendOptions as $key => $value) { - if(isset($parameters[$key])) { + foreach ($backendOptions as $key => $value) { + if (isset($parameters[$key])) { switch ($parameters[$key]->getType()) { case \OCA\Files_External\Lib\DefinitionParameter::VALUE_BOOLEAN: $value = (bool)$value; diff --git a/apps/files_external/lib/Lib/StorageModifierTrait.php b/apps/files_external/lib/Lib/StorageModifierTrait.php index 2d7140e68a9..304eadb2254 100644 --- a/apps/files_external/lib/Lib/StorageModifierTrait.php +++ b/apps/files_external/lib/Lib/StorageModifierTrait.php @@ -64,5 +64,4 @@ trait StorageModifierTrait { public function wrapStorage(Storage $storage) { return $storage; } - } diff --git a/apps/files_external/lib/Lib/VisibilityTrait.php b/apps/files_external/lib/Lib/VisibilityTrait.php index a056891403e..dc4ba7b366f 100644 --- a/apps/files_external/lib/Lib/VisibilityTrait.php +++ b/apps/files_external/lib/Lib/VisibilityTrait.php @@ -134,5 +134,4 @@ trait VisibilityTrait { public function removeAllowedVisibility($allowedVisibility) { return $this->setAllowedVisibility($this->allowedVisibility & ~$allowedVisibility); } - } diff --git a/apps/files_external/lib/Migration/DummyUserSession.php b/apps/files_external/lib/Migration/DummyUserSession.php index 496c4dfa760..10ab505cd3b 100644 --- a/apps/files_external/lib/Migration/DummyUserSession.php +++ b/apps/files_external/lib/Migration/DummyUserSession.php @@ -70,5 +70,4 @@ class DummyUserSession implements IUserSession { public function setImpersonatingUserID(bool $useCurrentUser = true): void { //no OP } - } diff --git a/apps/files_external/lib/Service/BackendService.php b/apps/files_external/lib/Service/BackendService.php index 6c2ea72b840..617b44651ae 100644 --- a/apps/files_external/lib/Service/BackendService.php +++ b/apps/files_external/lib/Service/BackendService.php @@ -111,7 +111,7 @@ class BackendService { private function callForRegistrations() { static $eventSent = false; - if(!$eventSent) { + if (!$eventSent) { \OC::$server->getEventDispatcher()->dispatch( 'OCA\\Files_External::loadAdditionalBackends', new GenericEvent() @@ -322,15 +322,15 @@ class BackendService { */ public function registerConfigHandler(string $placeholder, callable $configHandlerLoader) { $placeholder = trim(strtolower($placeholder)); - if(!(bool)\preg_match('/^[a-z0-9]*$/', $placeholder)) { + if (!(bool)\preg_match('/^[a-z0-9]*$/', $placeholder)) { throw new \RuntimeException(sprintf( 'Invalid placeholder %s, only [a-z0-9] are allowed', $placeholder )); } - if($placeholder === '') { + if ($placeholder === '') { throw new \RuntimeException('Invalid empty placeholder'); } - if(isset($this->configHandlerLoaders[$placeholder]) || isset($this->configHandlers[$placeholder])) { + if (isset($this->configHandlerLoaders[$placeholder]) || isset($this->configHandlers[$placeholder])) { throw new \RuntimeException(sprintf('A handler is already registered for %s', $placeholder)); } $this->configHandlerLoaders[$placeholder] = $configHandlerLoader; @@ -341,7 +341,7 @@ class BackendService { $newLoaded = false; foreach ($this->configHandlerLoaders as $placeholder => $loader) { $handler = $loader(); - if(!$handler instanceof IConfigHandler) { + if (!$handler instanceof IConfigHandler) { throw new \RuntimeException(sprintf( 'Handler for %s is not an instance of IConfigHandler', $placeholder )); @@ -350,7 +350,7 @@ class BackendService { $newLoaded = true; } $this->configHandlerLoaders = []; - if($newLoaded) { + if ($newLoaded) { // ensure those with longest placeholders come first, // to avoid substring matches uksort($this->configHandlers, function ($phA, $phB) { diff --git a/apps/files_external/lib/Service/DBConfigService.php b/apps/files_external/lib/Service/DBConfigService.php index 265848289f3..51373e8dda6 100644 --- a/apps/files_external/lib/Service/DBConfigService.php +++ b/apps/files_external/lib/Service/DBConfigService.php @@ -140,7 +140,7 @@ class DBConfigService { $stmt->closeCursor(); foreach ($result as $row) { - if((int)$row['count'] > 1) { + if ((int)$row['count'] > 1) { $this->removeApplicable($row['mount_id'], $applicableType, $applicableId); } else { $this->removeMount($row['mount_id']); @@ -343,7 +343,7 @@ class DBConfigService { ->setValue('key', $builder->createNamedParameter($key, IQueryBuilder::PARAM_STR)) ->setValue('value', $builder->createNamedParameter($value, IQueryBuilder::PARAM_STR)) ->execute(); - } catch(UniqueConstraintViolationException $e) { + } catch (UniqueConstraintViolationException $e) { $builder = $this->connection->getQueryBuilder(); $query = $builder->update('external_config') ->set('value', $builder->createNamedParameter($value, IQueryBuilder::PARAM_STR)) @@ -366,7 +366,7 @@ class DBConfigService { ->setValue('key', $builder->createNamedParameter($key, IQueryBuilder::PARAM_STR)) ->setValue('value', $builder->createNamedParameter(json_encode($value), IQueryBuilder::PARAM_STR)) ->execute(); - } catch(UniqueConstraintViolationException $e) { + } catch (UniqueConstraintViolationException $e) { $builder = $this->connection->getQueryBuilder(); $query = $builder->update('external_options') ->set('value', $builder->createNamedParameter(json_encode($value), IQueryBuilder::PARAM_STR)) @@ -384,7 +384,7 @@ class DBConfigService { ->setValue('type', $builder->createNamedParameter($type)) ->setValue('value', $builder->createNamedParameter($value)) ->execute(); - } catch(UniqueConstraintViolationException $e) { + } catch (UniqueConstraintViolationException $e) { // applicable exists already } } diff --git a/apps/files_external/lib/Service/UserGlobalStoragesService.php b/apps/files_external/lib/Service/UserGlobalStoragesService.php index 0cad7b2535e..7b9af773233 100644 --- a/apps/files_external/lib/Service/UserGlobalStoragesService.php +++ b/apps/files_external/lib/Service/UserGlobalStoragesService.php @@ -34,7 +34,6 @@ use OCP\IUserSession; * Read-only access available, attempting to write will throw DomainException */ class UserGlobalStoragesService extends GlobalStoragesService { - use UserTrait; /** @var IGroupManager */ diff --git a/apps/files_external/lib/Settings/Admin.php b/apps/files_external/lib/Settings/Admin.php index fe2d7598a17..d3c2c07aa83 100644 --- a/apps/files_external/lib/Settings/Admin.php +++ b/apps/files_external/lib/Settings/Admin.php @@ -92,5 +92,4 @@ class Admin implements ISettings { public function getPriority() { return 40; } - } diff --git a/apps/files_external/lib/Settings/Personal.php b/apps/files_external/lib/Settings/Personal.php index 927955cb420..de94793a6af 100644 --- a/apps/files_external/lib/Settings/Personal.php +++ b/apps/files_external/lib/Settings/Personal.php @@ -100,5 +100,4 @@ class Personal implements ISettings { public function getPriority() { return 40; } - } diff --git a/apps/files_external/lib/config.php b/apps/files_external/lib/config.php index c02d9d71566..c69955c3406 100644 --- a/apps/files_external/lib/config.php +++ b/apps/files_external/lib/config.php @@ -247,7 +247,7 @@ class OC_Mount_Config { return StorageNotAvailableException::STATUS_SUCCESS; } foreach ($options as $key => &$option) { - if($key === 'password') { + if ($key === 'password') { // no replacements in passwords continue; } |