Passed
Push — master ( f0dd71...c56a27 )
by Christoph
11:49 queued 12s
created
apps/files_external/lib/Lib/Auth/OAuth2/OAuth2.php 1 patch
Indentation   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -31,22 +31,22 @@
 block discarded – undo
31 31
  */
32 32
 class OAuth2 extends AuthMechanism {
33 33
 
34
-	public function __construct(IL10N $l) {
35
-		$this
36
-			->setIdentifier('oauth2::oauth2')
37
-			->setScheme(self::SCHEME_OAUTH2)
38
-			->setText($l->t('OAuth2'))
39
-			->addParameters([
40
-				(new DefinitionParameter('configured', 'configured'))
41
-					->setType(DefinitionParameter::VALUE_HIDDEN),
42
-				new DefinitionParameter('client_id', $l->t('Client ID')),
43
-				(new DefinitionParameter('client_secret', $l->t('Client secret')))
44
-					->setType(DefinitionParameter::VALUE_PASSWORD),
45
-				(new DefinitionParameter('token', 'token'))
46
-					->setType(DefinitionParameter::VALUE_HIDDEN),
47
-			])
48
-			->addCustomJs('oauth2')
49
-		;
50
-	}
34
+    public function __construct(IL10N $l) {
35
+        $this
36
+            ->setIdentifier('oauth2::oauth2')
37
+            ->setScheme(self::SCHEME_OAUTH2)
38
+            ->setText($l->t('OAuth2'))
39
+            ->addParameters([
40
+                (new DefinitionParameter('configured', 'configured'))
41
+                    ->setType(DefinitionParameter::VALUE_HIDDEN),
42
+                new DefinitionParameter('client_id', $l->t('Client ID')),
43
+                (new DefinitionParameter('client_secret', $l->t('Client secret')))
44
+                    ->setType(DefinitionParameter::VALUE_PASSWORD),
45
+                (new DefinitionParameter('token', 'token'))
46
+                    ->setType(DefinitionParameter::VALUE_HIDDEN),
47
+            ])
48
+            ->addCustomJs('oauth2')
49
+        ;
50
+    }
51 51
 
52 52
 }
Please login to merge, or discard this patch.
apps/files_external/lib/Lib/Auth/OAuth1/OAuth1.php 1 patch
Indentation   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -31,24 +31,24 @@
 block discarded – undo
31 31
  */
32 32
 class OAuth1 extends AuthMechanism {
33 33
 
34
-	public function __construct(IL10N $l) {
35
-		$this
36
-			->setIdentifier('oauth1::oauth1')
37
-			->setScheme(self::SCHEME_OAUTH1)
38
-			->setText($l->t('OAuth1'))
39
-			->addParameters([
40
-				(new DefinitionParameter('configured', 'configured'))
41
-					->setType(DefinitionParameter::VALUE_HIDDEN),
42
-				new DefinitionParameter('app_key', $l->t('App key')),
43
-				(new DefinitionParameter('app_secret', $l->t('App secret')))
44
-					->setType(DefinitionParameter::VALUE_PASSWORD),
45
-				(new DefinitionParameter('token', 'token'))
46
-					->setType(DefinitionParameter::VALUE_HIDDEN),
47
-				(new DefinitionParameter('token_secret', 'token_secret'))
48
-					->setType(DefinitionParameter::VALUE_HIDDEN),
49
-			])
50
-			->addCustomJs('oauth1')
51
-		;
52
-	}
34
+    public function __construct(IL10N $l) {
35
+        $this
36
+            ->setIdentifier('oauth1::oauth1')
37
+            ->setScheme(self::SCHEME_OAUTH1)
38
+            ->setText($l->t('OAuth1'))
39
+            ->addParameters([
40
+                (new DefinitionParameter('configured', 'configured'))
41
+                    ->setType(DefinitionParameter::VALUE_HIDDEN),
42
+                new DefinitionParameter('app_key', $l->t('App key')),
43
+                (new DefinitionParameter('app_secret', $l->t('App secret')))
44
+                    ->setType(DefinitionParameter::VALUE_PASSWORD),
45
+                (new DefinitionParameter('token', 'token'))
46
+                    ->setType(DefinitionParameter::VALUE_HIDDEN),
47
+                (new DefinitionParameter('token_secret', 'token_secret'))
48
+                    ->setType(DefinitionParameter::VALUE_HIDDEN),
49
+            ])
50
+            ->addCustomJs('oauth1')
51
+        ;
52
+    }
53 53
 
54 54
 }
Please login to merge, or discard this patch.
apps/files_external/lib/Lib/Auth/Password/Password.php 1 patch
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -31,16 +31,16 @@
 block discarded – undo
31 31
  */
32 32
 class Password extends AuthMechanism {
33 33
 
34
-	public function __construct(IL10N $l) {
35
-		$this
36
-			->setIdentifier('password::password')
37
-			->setScheme(self::SCHEME_PASSWORD)
38
-			->setText($l->t('Username and password'))
39
-			->addParameters([
40
-				new DefinitionParameter('user', $l->t('Username')),
41
-				(new DefinitionParameter('password', $l->t('Password')))
42
-					->setType(DefinitionParameter::VALUE_PASSWORD),
43
-			]);
44
-	}
34
+    public function __construct(IL10N $l) {
35
+        $this
36
+            ->setIdentifier('password::password')
37
+            ->setScheme(self::SCHEME_PASSWORD)
38
+            ->setText($l->t('Username and password'))
39
+            ->addParameters([
40
+                new DefinitionParameter('user', $l->t('Username')),
41
+                (new DefinitionParameter('password', $l->t('Password')))
42
+                    ->setType(DefinitionParameter::VALUE_PASSWORD),
43
+            ]);
44
+    }
45 45
 
46 46
 }
Please login to merge, or discard this patch.
apps/files_external/lib/Lib/Auth/PublicKey/RSA.php 1 patch
Indentation   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -36,51 +36,51 @@
 block discarded – undo
36 36
  */
37 37
 class RSA extends AuthMechanism {
38 38
 
39
-	/** @var IConfig */
40
-	private $config;
39
+    /** @var IConfig */
40
+    private $config;
41 41
 
42
-	public function __construct(IL10N $l, IConfig $config) {
43
-		$this->config = $config;
42
+    public function __construct(IL10N $l, IConfig $config) {
43
+        $this->config = $config;
44 44
 
45
-		$this
46
-			->setIdentifier('publickey::rsa')
47
-			->setScheme(self::SCHEME_PUBLICKEY)
48
-			->setText($l->t('RSA public key'))
49
-			->addParameters([
50
-				new DefinitionParameter('user', $l->t('Username')),
51
-				new DefinitionParameter('public_key', $l->t('Public key')),
52
-				(new DefinitionParameter('private_key', 'private_key'))
53
-					->setType(DefinitionParameter::VALUE_HIDDEN),
54
-			])
55
-			->addCustomJs('public_key')
56
-		;
57
-	}
45
+        $this
46
+            ->setIdentifier('publickey::rsa')
47
+            ->setScheme(self::SCHEME_PUBLICKEY)
48
+            ->setText($l->t('RSA public key'))
49
+            ->addParameters([
50
+                new DefinitionParameter('user', $l->t('Username')),
51
+                new DefinitionParameter('public_key', $l->t('Public key')),
52
+                (new DefinitionParameter('private_key', 'private_key'))
53
+                    ->setType(DefinitionParameter::VALUE_HIDDEN),
54
+            ])
55
+            ->addCustomJs('public_key')
56
+        ;
57
+    }
58 58
 
59
-	public function manipulateStorageConfig(StorageConfig &$storage, IUser $user = null) {
60
-		$auth = new RSACrypt();
61
-		$auth->setPassword($this->config->getSystemValue('secret', ''));
62
-		if (!$auth->loadKey($storage->getBackendOption('private_key'))) {
63
-			throw new \RuntimeException('unable to load private key');
64
-		}
65
-		$storage->setBackendOption('public_key_auth', $auth);
66
-	}
59
+    public function manipulateStorageConfig(StorageConfig &$storage, IUser $user = null) {
60
+        $auth = new RSACrypt();
61
+        $auth->setPassword($this->config->getSystemValue('secret', ''));
62
+        if (!$auth->loadKey($storage->getBackendOption('private_key'))) {
63
+            throw new \RuntimeException('unable to load private key');
64
+        }
65
+        $storage->setBackendOption('public_key_auth', $auth);
66
+    }
67 67
 
68
-	/**
69
-	 * Generate a keypair
70
-	 *
71
-	 * @param int $keyLenth
72
-	 * @return array ['privatekey' => $privateKey, 'publickey' => $publicKey]
73
-	 */
74
-	public function createKey($keyLength) {
75
-		$rsa = new RSACrypt();
76
-		$rsa->setPublicKeyFormat(RSACrypt::PUBLIC_FORMAT_OPENSSH);
77
-		$rsa->setPassword($this->config->getSystemValue('secret', ''));
68
+    /**
69
+     * Generate a keypair
70
+     *
71
+     * @param int $keyLenth
72
+     * @return array ['privatekey' => $privateKey, 'publickey' => $publicKey]
73
+     */
74
+    public function createKey($keyLength) {
75
+        $rsa = new RSACrypt();
76
+        $rsa->setPublicKeyFormat(RSACrypt::PUBLIC_FORMAT_OPENSSH);
77
+        $rsa->setPassword($this->config->getSystemValue('secret', ''));
78 78
 
79
-		if ($keyLength !== 1024 && $keyLength !== 2048 && $keyLength !== 4096) {
80
-			$keyLength = 1024;
81
-		}
79
+        if ($keyLength !== 1024 && $keyLength !== 2048 && $keyLength !== 4096) {
80
+            $keyLength = 1024;
81
+        }
82 82
 
83
-		return $rsa->createKey($keyLength);
84
-	}
83
+        return $rsa->createKey($keyLength);
84
+    }
85 85
 
86 86
 }
Please login to merge, or discard this patch.
apps/files_external/lib/Lib/Backend/SFTP_Key.php 1 patch
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -32,20 +32,20 @@
 block discarded – undo
32 32
 
33 33
 class SFTP_Key extends Backend {
34 34
 
35
-	public function __construct(IL10N $l, RSA $legacyAuth, SFTP $sftpBackend) {
36
-		$this
37
-			->setIdentifier('\OC\Files\Storage\SFTP_Key')
38
-			->setStorageClass('\OCA\Files_External\Lib\Storage\SFTP')
39
-			->setText($l->t('SFTP with secret key login'))
40
-			->addParameters([
41
-				new DefinitionParameter('host', $l->t('Host')),
42
-				(new DefinitionParameter('root', $l->t('Remote subfolder')))
43
-					->setFlag(DefinitionParameter::FLAG_OPTIONAL),
44
-			])
45
-			->addAuthScheme(AuthMechanism::SCHEME_PUBLICKEY)
46
-			->setLegacyAuthMechanism($legacyAuth)
47
-			->deprecateTo($sftpBackend)
48
-		;
49
-	}
35
+    public function __construct(IL10N $l, RSA $legacyAuth, SFTP $sftpBackend) {
36
+        $this
37
+            ->setIdentifier('\OC\Files\Storage\SFTP_Key')
38
+            ->setStorageClass('\OCA\Files_External\Lib\Storage\SFTP')
39
+            ->setText($l->t('SFTP with secret key login'))
40
+            ->addParameters([
41
+                new DefinitionParameter('host', $l->t('Host')),
42
+                (new DefinitionParameter('root', $l->t('Remote subfolder')))
43
+                    ->setFlag(DefinitionParameter::FLAG_OPTIONAL),
44
+            ])
45
+            ->addAuthScheme(AuthMechanism::SCHEME_PUBLICKEY)
46
+            ->setLegacyAuthMechanism($legacyAuth)
47
+            ->deprecateTo($sftpBackend)
48
+        ;
49
+    }
50 50
 
51 51
 }
Please login to merge, or discard this patch.
apps/files_external/lib/Lib/Backend/OwnCloud.php 1 patch
Indentation   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -33,22 +33,22 @@
 block discarded – undo
33 33
 
34 34
 class OwnCloud extends Backend {
35 35
 
36
-	public function __construct(IL10N $l, Password $legacyAuth) {
37
-		$this
38
-			->setIdentifier('owncloud')
39
-			->addIdentifierAlias('\OC\Files\Storage\OwnCloud') // legacy compat
40
-			->setStorageClass('\OCA\Files_External\Lib\Storage\OwnCloud')
41
-			->setText($l->t('Nextcloud'))
42
-			->addParameters([
43
-				new DefinitionParameter('host', $l->t('URL')),
44
-				(new DefinitionParameter('root', $l->t('Remote subfolder')))
45
-					->setFlag(DefinitionParameter::FLAG_OPTIONAL),
46
-				(new DefinitionParameter('secure', $l->t('Secure https://')))
47
-					->setType(DefinitionParameter::VALUE_BOOLEAN),
48
-			])
49
-			->addAuthScheme(AuthMechanism::SCHEME_PASSWORD)
50
-			->setLegacyAuthMechanism($legacyAuth)
51
-		;
52
-	}
36
+    public function __construct(IL10N $l, Password $legacyAuth) {
37
+        $this
38
+            ->setIdentifier('owncloud')
39
+            ->addIdentifierAlias('\OC\Files\Storage\OwnCloud') // legacy compat
40
+            ->setStorageClass('\OCA\Files_External\Lib\Storage\OwnCloud')
41
+            ->setText($l->t('Nextcloud'))
42
+            ->addParameters([
43
+                new DefinitionParameter('host', $l->t('URL')),
44
+                (new DefinitionParameter('root', $l->t('Remote subfolder')))
45
+                    ->setFlag(DefinitionParameter::FLAG_OPTIONAL),
46
+                (new DefinitionParameter('secure', $l->t('Secure https://')))
47
+                    ->setType(DefinitionParameter::VALUE_BOOLEAN),
48
+            ])
49
+            ->addAuthScheme(AuthMechanism::SCHEME_PASSWORD)
50
+            ->setLegacyAuthMechanism($legacyAuth)
51
+        ;
52
+    }
53 53
 
54 54
 }
Please login to merge, or discard this patch.
apps/files_external/lib/Lib/Backend/SMB_OC.php 1 patch
Indentation   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -38,36 +38,36 @@
 block discarded – undo
38 38
  */
39 39
 class SMB_OC extends Backend {
40 40
 
41
-	use LegacyDependencyCheckPolyfill;
41
+    use LegacyDependencyCheckPolyfill;
42 42
 
43
-	public function __construct(IL10N $l, SessionCredentials $legacyAuth, SMB $smbBackend) {
44
-		$this
45
-			->setIdentifier('\OC\Files\Storage\SMB_OC')
46
-			->setStorageClass('\OCA\Files_External\Lib\Storage\SMB')
47
-			->setText($l->t('SMB / CIFS using OC login'))
48
-			->addParameters([
49
-				new DefinitionParameter('host', $l->t('Host')),
50
-				(new DefinitionParameter('username_as_share', $l->t('Username as share')))
51
-					->setType(DefinitionParameter::VALUE_BOOLEAN),
52
-				(new DefinitionParameter('share', $l->t('Share')))
53
-					->setFlag(DefinitionParameter::FLAG_OPTIONAL),
54
-				(new DefinitionParameter('root', $l->t('Remote subfolder')))
55
-					->setFlag(DefinitionParameter::FLAG_OPTIONAL),
56
-			])
57
-			->setPriority(BackendService::PRIORITY_DEFAULT - 10)
58
-			->addAuthScheme(AuthMechanism::SCHEME_PASSWORD)
59
-			->setLegacyAuthMechanism($legacyAuth)
60
-			->deprecateTo($smbBackend)
61
-		;
62
-	}
43
+    public function __construct(IL10N $l, SessionCredentials $legacyAuth, SMB $smbBackend) {
44
+        $this
45
+            ->setIdentifier('\OC\Files\Storage\SMB_OC')
46
+            ->setStorageClass('\OCA\Files_External\Lib\Storage\SMB')
47
+            ->setText($l->t('SMB / CIFS using OC login'))
48
+            ->addParameters([
49
+                new DefinitionParameter('host', $l->t('Host')),
50
+                (new DefinitionParameter('username_as_share', $l->t('Username as share')))
51
+                    ->setType(DefinitionParameter::VALUE_BOOLEAN),
52
+                (new DefinitionParameter('share', $l->t('Share')))
53
+                    ->setFlag(DefinitionParameter::FLAG_OPTIONAL),
54
+                (new DefinitionParameter('root', $l->t('Remote subfolder')))
55
+                    ->setFlag(DefinitionParameter::FLAG_OPTIONAL),
56
+            ])
57
+            ->setPriority(BackendService::PRIORITY_DEFAULT - 10)
58
+            ->addAuthScheme(AuthMechanism::SCHEME_PASSWORD)
59
+            ->setLegacyAuthMechanism($legacyAuth)
60
+            ->deprecateTo($smbBackend)
61
+        ;
62
+    }
63 63
 
64
-	public function manipulateStorageConfig(StorageConfig &$storage, IUser $user = null) {
65
-		$username_as_share = ($storage->getBackendOption('username_as_share') === true);
64
+    public function manipulateStorageConfig(StorageConfig &$storage, IUser $user = null) {
65
+        $username_as_share = ($storage->getBackendOption('username_as_share') === true);
66 66
 
67
-		if ($username_as_share) {
68
-			$share = '/' . $storage->getBackendOption('user');
69
-			$storage->setBackendOption('share', $share);
70
-		}
71
-	}
67
+        if ($username_as_share) {
68
+            $share = '/' . $storage->getBackendOption('user');
69
+            $storage->setBackendOption('share', $share);
70
+        }
71
+    }
72 72
 
73 73
 }
Please login to merge, or discard this patch.
apps/files_external/lib/Lib/Backend/FTP.php 1 patch
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -33,24 +33,24 @@
 block discarded – undo
33 33
 
34 34
 class FTP extends Backend {
35 35
 
36
-	use LegacyDependencyCheckPolyfill;
36
+    use LegacyDependencyCheckPolyfill;
37 37
 
38
-	public function __construct(IL10N $l, Password $legacyAuth) {
39
-		$this
40
-			->setIdentifier('ftp')
41
-			->addIdentifierAlias('\OC\Files\Storage\FTP') // legacy compat
42
-			->setStorageClass('\OCA\Files_External\Lib\Storage\FTP')
43
-			->setText($l->t('FTP'))
44
-			->addParameters([
45
-				new DefinitionParameter('host', $l->t('Host')),
46
-				(new DefinitionParameter('root', $l->t('Remote subfolder')))
47
-					->setFlag(DefinitionParameter::FLAG_OPTIONAL),
48
-				(new DefinitionParameter('secure', $l->t('Secure ftps://')))
49
-					->setType(DefinitionParameter::VALUE_BOOLEAN),
50
-			])
51
-			->addAuthScheme(AuthMechanism::SCHEME_PASSWORD)
52
-			->setLegacyAuthMechanism($legacyAuth)
53
-		;
54
-	}
38
+    public function __construct(IL10N $l, Password $legacyAuth) {
39
+        $this
40
+            ->setIdentifier('ftp')
41
+            ->addIdentifierAlias('\OC\Files\Storage\FTP') // legacy compat
42
+            ->setStorageClass('\OCA\Files_External\Lib\Storage\FTP')
43
+            ->setText($l->t('FTP'))
44
+            ->addParameters([
45
+                new DefinitionParameter('host', $l->t('Host')),
46
+                (new DefinitionParameter('root', $l->t('Remote subfolder')))
47
+                    ->setFlag(DefinitionParameter::FLAG_OPTIONAL),
48
+                (new DefinitionParameter('secure', $l->t('Secure ftps://')))
49
+                    ->setType(DefinitionParameter::VALUE_BOOLEAN),
50
+            ])
51
+            ->addAuthScheme(AuthMechanism::SCHEME_PASSWORD)
52
+            ->setLegacyAuthMechanism($legacyAuth)
53
+        ;
54
+    }
55 55
 
56 56
 }
Please login to merge, or discard this patch.
apps/files_external/lib/Lib/Backend/DAV.php 1 patch
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -33,24 +33,24 @@
 block discarded – undo
33 33
 
34 34
 class DAV extends Backend {
35 35
 
36
-	use LegacyDependencyCheckPolyfill;
36
+    use LegacyDependencyCheckPolyfill;
37 37
 
38
-	public function __construct(IL10N $l, Password $legacyAuth) {
39
-		$this
40
-			->setIdentifier('dav')
41
-			->addIdentifierAlias('\OC\Files\Storage\DAV') // legacy compat
42
-			->setStorageClass('\OC\Files\Storage\DAV')
43
-			->setText($l->t('WebDAV'))
44
-			->addParameters([
45
-				new DefinitionParameter('host', $l->t('URL')),
46
-				(new DefinitionParameter('root', $l->t('Remote subfolder')))
47
-					->setFlag(DefinitionParameter::FLAG_OPTIONAL),
48
-				(new DefinitionParameter('secure', $l->t('Secure https://')))
49
-					->setType(DefinitionParameter::VALUE_BOOLEAN),
50
-			])
51
-			->addAuthScheme(AuthMechanism::SCHEME_PASSWORD)
52
-			->setLegacyAuthMechanism($legacyAuth)
53
-		;
54
-	}
38
+    public function __construct(IL10N $l, Password $legacyAuth) {
39
+        $this
40
+            ->setIdentifier('dav')
41
+            ->addIdentifierAlias('\OC\Files\Storage\DAV') // legacy compat
42
+            ->setStorageClass('\OC\Files\Storage\DAV')
43
+            ->setText($l->t('WebDAV'))
44
+            ->addParameters([
45
+                new DefinitionParameter('host', $l->t('URL')),
46
+                (new DefinitionParameter('root', $l->t('Remote subfolder')))
47
+                    ->setFlag(DefinitionParameter::FLAG_OPTIONAL),
48
+                (new DefinitionParameter('secure', $l->t('Secure https://')))
49
+                    ->setType(DefinitionParameter::VALUE_BOOLEAN),
50
+            ])
51
+            ->addAuthScheme(AuthMechanism::SCHEME_PASSWORD)
52
+            ->setLegacyAuthMechanism($legacyAuth)
53
+        ;
54
+    }
55 55
 
56 56
 }
Please login to merge, or discard this patch.