Passed
Push — master ( 3c2dd0...7c6e77 )
by Robin
10:46 queued 14s
created
apps/files_external/lib/Service/UserLegacyStoragesService.php 1 patch
Indentation   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -29,28 +29,28 @@
 block discarded – undo
29 29
  * Read user defined mounts from the legacy mount.json
30 30
  */
31 31
 class UserLegacyStoragesService extends LegacyStoragesService {
32
-	/**
33
-	 * @var IUserSession
34
-	 */
35
-	private $userSession;
32
+    /**
33
+     * @var IUserSession
34
+     */
35
+    private $userSession;
36 36
 
37
-	/**
38
-	 * @param BackendService $backendService
39
-	 * @param IUserSession $userSession
40
-	 */
41
-	public function __construct(BackendService $backendService, IUserSession $userSession) {
42
-		$this->backendService = $backendService;
43
-		$this->userSession = $userSession;
44
-	}
37
+    /**
38
+     * @param BackendService $backendService
39
+     * @param IUserSession $userSession
40
+     */
41
+    public function __construct(BackendService $backendService, IUserSession $userSession) {
42
+        $this->backendService = $backendService;
43
+        $this->userSession = $userSession;
44
+    }
45 45
 
46
-	/**
47
-	 * Read legacy config data
48
-	 *
49
-	 * @return array list of storage configs
50
-	 */
51
-	protected function readLegacyConfig() {
52
-		// read user config
53
-		$user = $this->userSession->getUser()->getUID();
54
-		return \OC_Mount_Config::readData($user);
55
-	}
46
+    /**
47
+     * Read legacy config data
48
+     *
49
+     * @return array list of storage configs
50
+     */
51
+    protected function readLegacyConfig() {
52
+        // read user config
53
+        $user = $this->userSession->getUser()->getUID();
54
+        return \OC_Mount_Config::readData($user);
55
+    }
56 56
 }
Please login to merge, or discard this patch.
apps/files_external/lib/Service/UserTrait.php 1 patch
Indentation   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -30,46 +30,46 @@
 block discarded – undo
30 30
  */
31 31
 trait UserTrait {
32 32
 
33
-	/** @var IUserSession */
34
-	protected $userSession;
33
+    /** @var IUserSession */
34
+    protected $userSession;
35 35
 
36
-	/**
37
-	 * User override
38
-	 *
39
-	 * @var IUser|null
40
-	 */
41
-	private $user = null;
36
+    /**
37
+     * User override
38
+     *
39
+     * @var IUser|null
40
+     */
41
+    private $user = null;
42 42
 
43
-	/**
44
-	 * @return IUser|null
45
-	 */
46
-	protected function getUser() {
47
-		if ($this->user) {
48
-			return $this->user;
49
-		}
50
-		return $this->userSession->getUser();
51
-	}
43
+    /**
44
+     * @return IUser|null
45
+     */
46
+    protected function getUser() {
47
+        if ($this->user) {
48
+            return $this->user;
49
+        }
50
+        return $this->userSession->getUser();
51
+    }
52 52
 
53
-	/**
54
-	 * Override the user from the session
55
-	 * Unset with ->resetUser() when finished!
56
-	 *
57
-	 * @param IUser
58
-	 * @return self
59
-	 */
60
-	public function setUser(IUser $user) {
61
-		$this->user = $user;
62
-		return $this;
63
-	}
53
+    /**
54
+     * Override the user from the session
55
+     * Unset with ->resetUser() when finished!
56
+     *
57
+     * @param IUser
58
+     * @return self
59
+     */
60
+    public function setUser(IUser $user) {
61
+        $this->user = $user;
62
+        return $this;
63
+    }
64 64
 
65
-	/**
66
-	 * Reset the user override
67
-	 *
68
-	 * @return self
69
-	 */
70
-	public function resetUser() {
71
-		$this->user = null;
72
-		return $this;
73
-	}
65
+    /**
66
+     * Reset the user override
67
+     *
68
+     * @return self
69
+     */
70
+    public function resetUser() {
71
+        $this->user = null;
72
+        return $this;
73
+    }
74 74
 }
75 75
 
Please login to merge, or discard this patch.
apps/files_external/lib/Command/Option.php 1 patch
Indentation   +44 added lines, -44 removed lines patch added patch discarded remove patch
@@ -28,50 +28,50 @@
 block discarded – undo
28 28
 use Symfony\Component\Console\Output\OutputInterface;
29 29
 
30 30
 class Option extends Config {
31
-	protected function configure() {
32
-		$this
33
-			->setName('files_external:option')
34
-			->setDescription('Manage mount options for a mount')
35
-			->addArgument(
36
-				'mount_id',
37
-				InputArgument::REQUIRED,
38
-				'The id of the mount to edit'
39
-			)->addArgument(
40
-				'key',
41
-				InputArgument::REQUIRED,
42
-				'key of the mount option to set/get'
43
-			)->addArgument(
44
-				'value',
45
-				InputArgument::OPTIONAL,
46
-				'value to set the mount option to, when no value is provided the existing value will be printed'
47
-			);
48
-	}
31
+    protected function configure() {
32
+        $this
33
+            ->setName('files_external:option')
34
+            ->setDescription('Manage mount options for a mount')
35
+            ->addArgument(
36
+                'mount_id',
37
+                InputArgument::REQUIRED,
38
+                'The id of the mount to edit'
39
+            )->addArgument(
40
+                'key',
41
+                InputArgument::REQUIRED,
42
+                'key of the mount option to set/get'
43
+            )->addArgument(
44
+                'value',
45
+                InputArgument::OPTIONAL,
46
+                'value to set the mount option to, when no value is provided the existing value will be printed'
47
+            );
48
+    }
49 49
 
50
-	/**
51
-	 * @param StorageConfig $mount
52
-	 * @param string $key
53
-	 * @param OutputInterface $output
54
-	 */
55
-	protected function getOption(StorageConfig $mount, $key, OutputInterface $output) {
56
-		$value = $mount->getMountOption($key);
57
-		if (!is_string($value)) { // show bools and objects correctly
58
-			$value = json_encode($value);
59
-		}
60
-		$output->writeln($value);
61
-	}
50
+    /**
51
+     * @param StorageConfig $mount
52
+     * @param string $key
53
+     * @param OutputInterface $output
54
+     */
55
+    protected function getOption(StorageConfig $mount, $key, OutputInterface $output) {
56
+        $value = $mount->getMountOption($key);
57
+        if (!is_string($value)) { // show bools and objects correctly
58
+            $value = json_encode($value);
59
+        }
60
+        $output->writeln($value);
61
+    }
62 62
 
63
-	/**
64
-	 * @param StorageConfig $mount
65
-	 * @param string $key
66
-	 * @param string $value
67
-	 * @param OutputInterface $output
68
-	 */
69
-	protected function setOption(StorageConfig $mount, $key, $value, OutputInterface $output) {
70
-		$decoded = json_decode($value, true);
71
-		if (!is_null($decoded)) {
72
-			$value = $decoded;
73
-		}
74
-		$mount->setMountOption($key, $value);
75
-		$this->globalService->updateStorage($mount);
76
-	}
63
+    /**
64
+     * @param StorageConfig $mount
65
+     * @param string $key
66
+     * @param string $value
67
+     * @param OutputInterface $output
68
+     */
69
+    protected function setOption(StorageConfig $mount, $key, $value, OutputInterface $output) {
70
+        $decoded = json_decode($value, true);
71
+        if (!is_null($decoded)) {
72
+            $value = $decoded;
73
+        }
74
+        $mount->setMountOption($key, $value);
75
+        $this->globalService->updateStorage($mount);
76
+    }
77 77
 }
Please login to merge, or discard this patch.
apps/files_external/lib/Settings/Section.php 1 patch
Indentation   +46 added lines, -46 removed lines patch added patch discarded remove patch
@@ -28,55 +28,55 @@
 block discarded – undo
28 28
 use OCP\Settings\IIconSection;
29 29
 
30 30
 class Section implements IIconSection {
31
-	/** @var IL10N */
32
-	private $l;
33
-	/** @var IURLGenerator */
34
-	private $url;
31
+    /** @var IL10N */
32
+    private $l;
33
+    /** @var IURLGenerator */
34
+    private $url;
35 35
 
36
-	/**
37
-	 * @param IURLGenerator $url
38
-	 * @param IL10N $l
39
-	 */
40
-	public function __construct(IURLGenerator $url, IL10N $l) {
41
-		$this->url = $url;
42
-		$this->l = $l;
43
-	}
36
+    /**
37
+     * @param IURLGenerator $url
38
+     * @param IL10N $l
39
+     */
40
+    public function __construct(IURLGenerator $url, IL10N $l) {
41
+        $this->url = $url;
42
+        $this->l = $l;
43
+    }
44 44
 
45
-	/**
46
-	 * returns the ID of the section. It is supposed to be a lower case string,
47
-	 * e.g. 'ldap'
48
-	 *
49
-	 * @returns string
50
-	 */
51
-	public function getID() {
52
-		return 'externalstorages';
53
-	}
45
+    /**
46
+     * returns the ID of the section. It is supposed to be a lower case string,
47
+     * e.g. 'ldap'
48
+     *
49
+     * @returns string
50
+     */
51
+    public function getID() {
52
+        return 'externalstorages';
53
+    }
54 54
 
55
-	/**
56
-	 * returns the translated name as it should be displayed, e.g. 'LDAP / AD
57
-	 * integration'. Use the L10N service to translate it.
58
-	 *
59
-	 * @return string
60
-	 */
61
-	public function getName() {
62
-		return $this->l->t('External storages');
63
-	}
55
+    /**
56
+     * returns the translated name as it should be displayed, e.g. 'LDAP / AD
57
+     * integration'. Use the L10N service to translate it.
58
+     *
59
+     * @return string
60
+     */
61
+    public function getName() {
62
+        return $this->l->t('External storages');
63
+    }
64 64
 
65
-	/**
66
-	 * @return int whether the form should be rather on the top or bottom of
67
-	 * the settings navigation. The sections are arranged in ascending order of
68
-	 * the priority values. It is required to return a value between 0 and 99.
69
-	 *
70
-	 * E.g.: 70
71
-	 */
72
-	public function getPriority() {
73
-		return 10;
74
-	}
65
+    /**
66
+     * @return int whether the form should be rather on the top or bottom of
67
+     * the settings navigation. The sections are arranged in ascending order of
68
+     * the priority values. It is required to return a value between 0 and 99.
69
+     *
70
+     * E.g.: 70
71
+     */
72
+    public function getPriority() {
73
+        return 10;
74
+    }
75 75
 
76
-	/**
77
-	 * {@inheritdoc}
78
-	 */
79
-	public function getIcon() {
80
-		return $this->url->imagePath('files_external', 'app-dark.svg');
81
-	}
76
+    /**
77
+     * {@inheritdoc}
78
+     */
79
+    public function getIcon() {
80
+        return $this->url->imagePath('files_external', 'app-dark.svg');
81
+    }
82 82
 }
Please login to merge, or discard this patch.
apps/files_external/lib/Settings/Admin.php 1 patch
Indentation   +52 added lines, -52 removed lines patch added patch discarded remove patch
@@ -32,65 +32,65 @@
 block discarded – undo
32 32
 
33 33
 class Admin implements ISettings {
34 34
 
35
-	/** @var IManager */
36
-	private $encryptionManager;
35
+    /** @var IManager */
36
+    private $encryptionManager;
37 37
 
38
-	/** @var GlobalStoragesService */
39
-	private $globalStoragesService;
38
+    /** @var GlobalStoragesService */
39
+    private $globalStoragesService;
40 40
 
41
-	/** @var BackendService */
42
-	private $backendService;
41
+    /** @var BackendService */
42
+    private $backendService;
43 43
 
44
-	/** @var GlobalAuth	 */
45
-	private $globalAuth;
44
+    /** @var GlobalAuth	 */
45
+    private $globalAuth;
46 46
 
47
-	public function __construct(
48
-		IManager $encryptionManager,
49
-		GlobalStoragesService $globalStoragesService,
50
-		BackendService $backendService,
51
-		GlobalAuth $globalAuth
52
-	) {
53
-		$this->encryptionManager = $encryptionManager;
54
-		$this->globalStoragesService = $globalStoragesService;
55
-		$this->backendService = $backendService;
56
-		$this->globalAuth = $globalAuth;
57
-	}
47
+    public function __construct(
48
+        IManager $encryptionManager,
49
+        GlobalStoragesService $globalStoragesService,
50
+        BackendService $backendService,
51
+        GlobalAuth $globalAuth
52
+    ) {
53
+        $this->encryptionManager = $encryptionManager;
54
+        $this->globalStoragesService = $globalStoragesService;
55
+        $this->backendService = $backendService;
56
+        $this->globalAuth = $globalAuth;
57
+    }
58 58
 
59
-	/**
60
-	 * @return TemplateResponse
61
-	 */
62
-	public function getForm() {
63
-		$parameters = [
64
-			'encryptionEnabled'    => $this->encryptionManager->isEnabled(),
65
-			'visibilityType'       => BackendService::VISIBILITY_ADMIN,
66
-			'storages'             => $this->globalStoragesService->getStorages(),
67
-			'backends'             => $this->backendService->getAvailableBackends(),
68
-			'authMechanisms'       => $this->backendService->getAuthMechanisms(),
69
-			'dependencies'         => \OC_Mount_Config::dependencyMessage($this->backendService->getBackends()),
70
-			'allowUserMounting'    => $this->backendService->isUserMountingAllowed(),
71
-			'globalCredentials'    => $this->globalAuth->getAuth(''),
72
-			'globalCredentialsUid' => '',
73
-		];
59
+    /**
60
+     * @return TemplateResponse
61
+     */
62
+    public function getForm() {
63
+        $parameters = [
64
+            'encryptionEnabled'    => $this->encryptionManager->isEnabled(),
65
+            'visibilityType'       => BackendService::VISIBILITY_ADMIN,
66
+            'storages'             => $this->globalStoragesService->getStorages(),
67
+            'backends'             => $this->backendService->getAvailableBackends(),
68
+            'authMechanisms'       => $this->backendService->getAuthMechanisms(),
69
+            'dependencies'         => \OC_Mount_Config::dependencyMessage($this->backendService->getBackends()),
70
+            'allowUserMounting'    => $this->backendService->isUserMountingAllowed(),
71
+            'globalCredentials'    => $this->globalAuth->getAuth(''),
72
+            'globalCredentialsUid' => '',
73
+        ];
74 74
 
75
-		return new TemplateResponse('files_external', 'settings', $parameters, '');
76
-	}
75
+        return new TemplateResponse('files_external', 'settings', $parameters, '');
76
+    }
77 77
 
78
-	/**
79
-	 * @return string the section ID, e.g. 'sharing'
80
-	 */
81
-	public function getSection() {
82
-		return 'externalstorages';
83
-	}
78
+    /**
79
+     * @return string the section ID, e.g. 'sharing'
80
+     */
81
+    public function getSection() {
82
+        return 'externalstorages';
83
+    }
84 84
 
85
-	/**
86
-	 * @return int whether the form should be rather on the top or bottom of
87
-	 * the admin section. The forms are arranged in ascending order of the
88
-	 * priority values. It is required to return a value between 0 and 100.
89
-	 *
90
-	 * E.g.: 70
91
-	 */
92
-	public function getPriority() {
93
-		return 40;
94
-	}
85
+    /**
86
+     * @return int whether the form should be rather on the top or bottom of
87
+     * the admin section. The forms are arranged in ascending order of the
88
+     * priority values. It is required to return a value between 0 and 100.
89
+     *
90
+     * E.g.: 70
91
+     */
92
+    public function getPriority() {
93
+        return 40;
94
+    }
95 95
 
96 96
 }
Please login to merge, or discard this patch.
apps/files_external/lib/Lib/LegacyDependencyCheckPolyfill.php 1 patch
Indentation   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -29,43 +29,43 @@
 block discarded – undo
29 29
  */
30 30
 trait LegacyDependencyCheckPolyfill {
31 31
 
32
-	/**
33
-	 * @return string
34
-	 */
35
-	abstract public function getStorageClass();
32
+    /**
33
+     * @return string
34
+     */
35
+    abstract public function getStorageClass();
36 36
 
37
-	/**
38
-	 * Check if object is valid for use
39
-	 *
40
-	 * @return MissingDependency[] Unsatisfied dependencies
41
-	 */
42
-	public function checkDependencies() {
43
-		$ret = [];
37
+    /**
38
+     * Check if object is valid for use
39
+     *
40
+     * @return MissingDependency[] Unsatisfied dependencies
41
+     */
42
+    public function checkDependencies() {
43
+        $ret = [];
44 44
 
45
-		$result = call_user_func([$this->getStorageClass(), 'checkDependencies']);
46
-		if ($result !== true) {
47
-			if (!is_array($result)) {
48
-				$result = [$result];
49
-			}
50
-			foreach ($result as $key => $value) {
51
-				if (!($value instanceof MissingDependency)) {
52
-					$module = null;
53
-					$message = null;
54
-					if (is_numeric($key)) {
55
-						$module = $value;
56
-					} else {
57
-						$module = $key;
58
-						$message = $value;
59
-					}
60
-					$value = new MissingDependency($module, $this);
61
-					$value->setMessage($message);
62
-				}
63
-				$ret[] = $value;
64
-			}
65
-		}
45
+        $result = call_user_func([$this->getStorageClass(), 'checkDependencies']);
46
+        if ($result !== true) {
47
+            if (!is_array($result)) {
48
+                $result = [$result];
49
+            }
50
+            foreach ($result as $key => $value) {
51
+                if (!($value instanceof MissingDependency)) {
52
+                    $module = null;
53
+                    $message = null;
54
+                    if (is_numeric($key)) {
55
+                        $module = $value;
56
+                    } else {
57
+                        $module = $key;
58
+                        $message = $value;
59
+                    }
60
+                    $value = new MissingDependency($module, $this);
61
+                    $value->setMessage($message);
62
+                }
63
+                $ret[] = $value;
64
+            }
65
+        }
66 66
 
67
-		return $ret;
68
-	}
67
+        return $ret;
68
+    }
69 69
 
70 70
 }
71 71
 
Please login to merge, or discard this patch.
apps/files_external/lib/Lib/Auth/Password/SessionCredentials.php 1 patch
Indentation   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -39,31 +39,31 @@
 block discarded – undo
39 39
  */
40 40
 class SessionCredentials extends AuthMechanism {
41 41
 
42
-	/** @var CredentialsStore */
43
-	private $credentialsStore;
42
+    /** @var CredentialsStore */
43
+    private $credentialsStore;
44 44
 
45
-	public function __construct(IL10N $l, CredentialsStore $credentialsStore) {
46
-		$this->credentialsStore = $credentialsStore;
45
+    public function __construct(IL10N $l, CredentialsStore $credentialsStore) {
46
+        $this->credentialsStore = $credentialsStore;
47 47
 
48
-		$this->setIdentifier('password::sessioncredentials')
49
-			->setScheme(self::SCHEME_PASSWORD)
50
-			->setText($l->t('Log-in credentials, save in session'))
51
-			->addParameters([]);
52
-	}
48
+        $this->setIdentifier('password::sessioncredentials')
49
+            ->setScheme(self::SCHEME_PASSWORD)
50
+            ->setText($l->t('Log-in credentials, save in session'))
51
+            ->addParameters([]);
52
+    }
53 53
 
54
-	public function manipulateStorageConfig(StorageConfig &$storage, IUser $user = null) {
55
-		try {
56
-			$credentials = $this->credentialsStore->getLoginCredentials();
57
-		} catch (CredentialsUnavailableException $e) {
58
-			throw new InsufficientDataForMeaningfulAnswerException('No session credentials saved');
59
-		}
54
+    public function manipulateStorageConfig(StorageConfig &$storage, IUser $user = null) {
55
+        try {
56
+            $credentials = $this->credentialsStore->getLoginCredentials();
57
+        } catch (CredentialsUnavailableException $e) {
58
+            throw new InsufficientDataForMeaningfulAnswerException('No session credentials saved');
59
+        }
60 60
 
61
-		$storage->setBackendOption('user', $credentials->getLoginName());
62
-		$storage->setBackendOption('password', $credentials->getPassword());
63
-	}
61
+        $storage->setBackendOption('user', $credentials->getLoginName());
62
+        $storage->setBackendOption('password', $credentials->getPassword());
63
+    }
64 64
 
65
-	public function wrapStorage(Storage $storage) {
66
-		return new SessionStorageWrapper(['storage' => $storage]);
67
-	}
65
+    public function wrapStorage(Storage $storage) {
66
+        return new SessionStorageWrapper(['storage' => $storage]);
67
+    }
68 68
 
69 69
 }
Please login to merge, or discard this patch.
apps/files_external/lib/Lib/Auth/IUserProvided.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -28,10 +28,10 @@
 block discarded – undo
28 28
  * For auth mechanisms where the user needs to provide credentials
29 29
  */
30 30
 interface IUserProvided {
31
-	/**
32
-	 * @param IUser $user the user for which to save the user provided options
33
-	 * @param int $mountId the mount id to save the options for
34
-	 * @param array $options the user provided options
35
-	 */
36
-	public function saveBackendOptions(IUser $user, $mountId, array $options);
31
+    /**
32
+     * @param IUser $user the user for which to save the user provided options
33
+     * @param int $mountId the mount id to save the options for
34
+     * @param array $options the user provided options
35
+     */
36
+    public function saveBackendOptions(IUser $user, $mountId, array $options);
37 37
 }
Please login to merge, or discard this patch.
apps/files_external/lib/Lib/Config/IBackendProvider.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -30,10 +30,10 @@
 block discarded – undo
30 30
  */
31 31
 interface IBackendProvider {
32 32
 
33
-	/**
34
-	 * @since 9.1.0
35
-	 * @return Backend[]
36
-	 */
37
-	public function getBackends();
33
+    /**
34
+     * @since 9.1.0
35
+     * @return Backend[]
36
+     */
37
+    public function getBackends();
38 38
 
39 39
 }
Please login to merge, or discard this patch.