Passed
Push — master ( 4908d8...fbbdc6 )
by Joas
16:12 queued 12s
created
apps/dav/lib/CardDAV/AddressBookRoot.php 1 patch
Indentation   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -29,45 +29,45 @@
 block discarded – undo
29 29
 
30 30
 class AddressBookRoot extends \Sabre\CardDAV\AddressBookRoot {
31 31
 
32
-	/** @var PluginManager */
33
-	private $pluginManager;
32
+    /** @var PluginManager */
33
+    private $pluginManager;
34 34
 
35
-	/**
36
-	 * @param \Sabre\DAVACL\PrincipalBackend\BackendInterface $principalBackend
37
-	 * @param \Sabre\CardDAV\Backend\BackendInterface $carddavBackend
38
-	 * @param string $principalPrefix
39
-	 */
40
-	public function __construct(\Sabre\DAVACL\PrincipalBackend\BackendInterface $principalBackend,
41
-								\Sabre\CardDAV\Backend\BackendInterface $carddavBackend,
42
-								PluginManager $pluginManager,
43
-								$principalPrefix = 'principals') {
44
-		parent::__construct($principalBackend, $carddavBackend, $principalPrefix);
45
-		$this->pluginManager = $pluginManager;
46
-	}
35
+    /**
36
+     * @param \Sabre\DAVACL\PrincipalBackend\BackendInterface $principalBackend
37
+     * @param \Sabre\CardDAV\Backend\BackendInterface $carddavBackend
38
+     * @param string $principalPrefix
39
+     */
40
+    public function __construct(\Sabre\DAVACL\PrincipalBackend\BackendInterface $principalBackend,
41
+                                \Sabre\CardDAV\Backend\BackendInterface $carddavBackend,
42
+                                PluginManager $pluginManager,
43
+                                $principalPrefix = 'principals') {
44
+        parent::__construct($principalBackend, $carddavBackend, $principalPrefix);
45
+        $this->pluginManager = $pluginManager;
46
+    }
47 47
 
48
-	/**
49
-	 * This method returns a node for a principal.
50
-	 *
51
-	 * The passed array contains principal information, and is guaranteed to
52
-	 * at least contain a uri item. Other properties may or may not be
53
-	 * supplied by the authentication backend.
54
-	 *
55
-	 * @param array $principal
56
-	 *
57
-	 * @return \Sabre\DAV\INode
58
-	 */
59
-	public function getChildForPrincipal(array $principal) {
60
-		return new UserAddressBooks($this->carddavBackend, $principal['uri'], $this->pluginManager);
61
-	}
48
+    /**
49
+     * This method returns a node for a principal.
50
+     *
51
+     * The passed array contains principal information, and is guaranteed to
52
+     * at least contain a uri item. Other properties may or may not be
53
+     * supplied by the authentication backend.
54
+     *
55
+     * @param array $principal
56
+     *
57
+     * @return \Sabre\DAV\INode
58
+     */
59
+    public function getChildForPrincipal(array $principal) {
60
+        return new UserAddressBooks($this->carddavBackend, $principal['uri'], $this->pluginManager);
61
+    }
62 62
 
63
-	public function getName() {
64
-		if ($this->principalPrefix === 'principals') {
65
-			return parent::getName();
66
-		}
67
-		// Grabbing all the components of the principal path.
68
-		$parts = explode('/', $this->principalPrefix);
63
+    public function getName() {
64
+        if ($this->principalPrefix === 'principals') {
65
+            return parent::getName();
66
+        }
67
+        // Grabbing all the components of the principal path.
68
+        $parts = explode('/', $this->principalPrefix);
69 69
 
70
-		// We are only interested in the second part.
71
-		return $parts[1];
72
-	}
70
+        // We are only interested in the second part.
71
+        return $parts[1];
72
+    }
73 73
 }
Please login to merge, or discard this patch.
apps/dav/lib/CardDAV/UserAddressBooks.php 1 patch
Indentation   +78 added lines, -78 removed lines patch added patch discarded remove patch
@@ -41,82 +41,82 @@
 block discarded – undo
41 41
 
42 42
 class UserAddressBooks extends \Sabre\CardDAV\AddressBookHome {
43 43
 
44
-	/** @var IL10N */
45
-	protected $l10n;
46
-
47
-	/** @var IConfig */
48
-	protected $config;
49
-
50
-	/** @var PluginManager */
51
-	private $pluginManager;
52
-
53
-	public function __construct(Backend\BackendInterface $carddavBackend,
54
-								string $principalUri,
55
-								PluginManager $pluginManager) {
56
-		parent::__construct($carddavBackend, $principalUri);
57
-		$this->pluginManager = $pluginManager;
58
-	}
59
-
60
-	/**
61
-	 * Returns a list of address books
62
-	 *
63
-	 * @return IAddressBook[]
64
-	 */
65
-	public function getChildren() {
66
-		if ($this->l10n === null) {
67
-			$this->l10n = \OC::$server->getL10N('dav');
68
-		}
69
-		if ($this->config === null) {
70
-			$this->config = \OC::$server->getConfig();
71
-		}
72
-
73
-		$addressBooks = $this->carddavBackend->getAddressBooksForUser($this->principalUri);
74
-		/** @var IAddressBook[] $objects */
75
-		$objects = array_map(function (array $addressBook) {
76
-			if ($addressBook['principaluri'] === 'principals/system/system') {
77
-				return new SystemAddressbook($this->carddavBackend, $addressBook, $this->l10n, $this->config);
78
-			}
79
-
80
-			return new AddressBook($this->carddavBackend, $addressBook, $this->l10n);
81
-		}, $addressBooks);
82
-		/** @var IAddressBook[][] $objectsFromPlugins */
83
-		$objectsFromPlugins = array_map(function (IAddressBookProvider $plugin): array {
84
-			return $plugin->fetchAllForAddressBookHome($this->principalUri);
85
-		}, $this->pluginManager->getAddressBookPlugins());
86
-
87
-		return array_merge($objects, ...$objectsFromPlugins);
88
-	}
89
-
90
-	public function createExtendedCollection($name, MkCol $mkCol) {
91
-		if (ExternalAddressBook::doesViolateReservedName($name)) {
92
-			throw new MethodNotAllowed('The resource you tried to create has a reserved name');
93
-		}
94
-
95
-		parent::createExtendedCollection($name, $mkCol);
96
-	}
97
-
98
-	/**
99
-	 * Returns a list of ACE's for this node.
100
-	 *
101
-	 * Each ACE has the following properties:
102
-	 *   * 'privilege', a string such as {DAV:}read or {DAV:}write. These are
103
-	 *     currently the only supported privileges
104
-	 *   * 'principal', a url to the principal who owns the node
105
-	 *   * 'protected' (optional), indicating that this ACE is not allowed to
106
-	 *      be updated.
107
-	 *
108
-	 * @return array
109
-	 */
110
-	public function getACL() {
111
-		$acl = parent::getACL();
112
-		if ($this->principalUri === 'principals/system/system') {
113
-			$acl[] = [
114
-				'privilege' => '{DAV:}read',
115
-				'principal' => '{DAV:}authenticated',
116
-				'protected' => true,
117
-			];
118
-		}
119
-
120
-		return $acl;
121
-	}
44
+    /** @var IL10N */
45
+    protected $l10n;
46
+
47
+    /** @var IConfig */
48
+    protected $config;
49
+
50
+    /** @var PluginManager */
51
+    private $pluginManager;
52
+
53
+    public function __construct(Backend\BackendInterface $carddavBackend,
54
+                                string $principalUri,
55
+                                PluginManager $pluginManager) {
56
+        parent::__construct($carddavBackend, $principalUri);
57
+        $this->pluginManager = $pluginManager;
58
+    }
59
+
60
+    /**
61
+     * Returns a list of address books
62
+     *
63
+     * @return IAddressBook[]
64
+     */
65
+    public function getChildren() {
66
+        if ($this->l10n === null) {
67
+            $this->l10n = \OC::$server->getL10N('dav');
68
+        }
69
+        if ($this->config === null) {
70
+            $this->config = \OC::$server->getConfig();
71
+        }
72
+
73
+        $addressBooks = $this->carddavBackend->getAddressBooksForUser($this->principalUri);
74
+        /** @var IAddressBook[] $objects */
75
+        $objects = array_map(function (array $addressBook) {
76
+            if ($addressBook['principaluri'] === 'principals/system/system') {
77
+                return new SystemAddressbook($this->carddavBackend, $addressBook, $this->l10n, $this->config);
78
+            }
79
+
80
+            return new AddressBook($this->carddavBackend, $addressBook, $this->l10n);
81
+        }, $addressBooks);
82
+        /** @var IAddressBook[][] $objectsFromPlugins */
83
+        $objectsFromPlugins = array_map(function (IAddressBookProvider $plugin): array {
84
+            return $plugin->fetchAllForAddressBookHome($this->principalUri);
85
+        }, $this->pluginManager->getAddressBookPlugins());
86
+
87
+        return array_merge($objects, ...$objectsFromPlugins);
88
+    }
89
+
90
+    public function createExtendedCollection($name, MkCol $mkCol) {
91
+        if (ExternalAddressBook::doesViolateReservedName($name)) {
92
+            throw new MethodNotAllowed('The resource you tried to create has a reserved name');
93
+        }
94
+
95
+        parent::createExtendedCollection($name, $mkCol);
96
+    }
97
+
98
+    /**
99
+     * Returns a list of ACE's for this node.
100
+     *
101
+     * Each ACE has the following properties:
102
+     *   * 'privilege', a string such as {DAV:}read or {DAV:}write. These are
103
+     *     currently the only supported privileges
104
+     *   * 'principal', a url to the principal who owns the node
105
+     *   * 'protected' (optional), indicating that this ACE is not allowed to
106
+     *      be updated.
107
+     *
108
+     * @return array
109
+     */
110
+    public function getACL() {
111
+        $acl = parent::getACL();
112
+        if ($this->principalUri === 'principals/system/system') {
113
+            $acl[] = [
114
+                'privilege' => '{DAV:}read',
115
+                'principal' => '{DAV:}authenticated',
116
+                'protected' => true,
117
+            ];
118
+        }
119
+
120
+        return $acl;
121
+    }
122 122
 }
Please login to merge, or discard this patch.
apps/dav/lib/Files/BrowserErrorPagePlugin.php 1 patch
Indentation   +75 added lines, -75 removed lines patch added patch discarded remove patch
@@ -34,86 +34,86 @@
 block discarded – undo
34 34
 use Sabre\DAV\ServerPlugin;
35 35
 
36 36
 class BrowserErrorPagePlugin extends ServerPlugin {
37
-	/** @var Server */
38
-	private $server;
37
+    /** @var Server */
38
+    private $server;
39 39
 
40
-	/**
41
-	 * This initializes the plugin.
42
-	 *
43
-	 * This function is called by Sabre\DAV\Server, after
44
-	 * addPlugin is called.
45
-	 *
46
-	 * This method should set up the required event subscriptions.
47
-	 *
48
-	 * @param Server $server
49
-	 * @return void
50
-	 */
51
-	public function initialize(Server $server) {
52
-		$this->server = $server;
53
-		$server->on('exception', [$this, 'logException'], 1000);
54
-	}
40
+    /**
41
+     * This initializes the plugin.
42
+     *
43
+     * This function is called by Sabre\DAV\Server, after
44
+     * addPlugin is called.
45
+     *
46
+     * This method should set up the required event subscriptions.
47
+     *
48
+     * @param Server $server
49
+     * @return void
50
+     */
51
+    public function initialize(Server $server) {
52
+        $this->server = $server;
53
+        $server->on('exception', [$this, 'logException'], 1000);
54
+    }
55 55
 
56
-	/**
57
-	 * @param IRequest $request
58
-	 * @return bool
59
-	 */
60
-	public static function isBrowserRequest(IRequest $request) {
61
-		if ($request->getMethod() !== 'GET') {
62
-			return false;
63
-		}
64
-		return $request->isUserAgent([
65
-			Request::USER_AGENT_IE,
66
-			Request::USER_AGENT_MS_EDGE,
67
-			Request::USER_AGENT_CHROME,
68
-			Request::USER_AGENT_FIREFOX,
69
-			Request::USER_AGENT_SAFARI,
70
-		]);
71
-	}
56
+    /**
57
+     * @param IRequest $request
58
+     * @return bool
59
+     */
60
+    public static function isBrowserRequest(IRequest $request) {
61
+        if ($request->getMethod() !== 'GET') {
62
+            return false;
63
+        }
64
+        return $request->isUserAgent([
65
+            Request::USER_AGENT_IE,
66
+            Request::USER_AGENT_MS_EDGE,
67
+            Request::USER_AGENT_CHROME,
68
+            Request::USER_AGENT_FIREFOX,
69
+            Request::USER_AGENT_SAFARI,
70
+        ]);
71
+    }
72 72
 
73
-	/**
74
-	 * @param \Exception $ex
75
-	 */
76
-	public function logException(\Exception $ex) {
77
-		if ($ex instanceof Exception) {
78
-			$httpCode = $ex->getHTTPCode();
79
-			$headers = $ex->getHTTPHeaders($this->server);
80
-		} else {
81
-			$httpCode = 500;
82
-			$headers = [];
83
-		}
84
-		$this->server->httpResponse->addHeaders($headers);
85
-		$this->server->httpResponse->setStatus($httpCode);
86
-		$body = $this->generateBody($httpCode);
87
-		$this->server->httpResponse->setBody($body);
88
-		$csp = new ContentSecurityPolicy();
89
-		$this->server->httpResponse->addHeader('Content-Security-Policy', $csp->buildPolicy());
90
-		$this->sendResponse();
91
-	}
73
+    /**
74
+     * @param \Exception $ex
75
+     */
76
+    public function logException(\Exception $ex) {
77
+        if ($ex instanceof Exception) {
78
+            $httpCode = $ex->getHTTPCode();
79
+            $headers = $ex->getHTTPHeaders($this->server);
80
+        } else {
81
+            $httpCode = 500;
82
+            $headers = [];
83
+        }
84
+        $this->server->httpResponse->addHeaders($headers);
85
+        $this->server->httpResponse->setStatus($httpCode);
86
+        $body = $this->generateBody($httpCode);
87
+        $this->server->httpResponse->setBody($body);
88
+        $csp = new ContentSecurityPolicy();
89
+        $this->server->httpResponse->addHeader('Content-Security-Policy', $csp->buildPolicy());
90
+        $this->sendResponse();
91
+    }
92 92
 
93
-	/**
94
-	 * @codeCoverageIgnore
95
-	 * @return bool|string
96
-	 */
97
-	public function generateBody(int $httpCode) {
98
-		$request = \OC::$server->getRequest();
93
+    /**
94
+     * @codeCoverageIgnore
95
+     * @return bool|string
96
+     */
97
+    public function generateBody(int $httpCode) {
98
+        $request = \OC::$server->getRequest();
99 99
 
100
-		$templateName = 'exception';
101
-		if ($httpCode === 403 || $httpCode === 404) {
102
-			$templateName = (string)$httpCode;
103
-		}
100
+        $templateName = 'exception';
101
+        if ($httpCode === 403 || $httpCode === 404) {
102
+            $templateName = (string)$httpCode;
103
+        }
104 104
 
105
-		$content = new OC_Template('core', $templateName, 'guest');
106
-		$content->assign('title', $this->server->httpResponse->getStatusText());
107
-		$content->assign('remoteAddr', $request->getRemoteAddress());
108
-		$content->assign('requestID', $request->getId());
109
-		return $content->fetchPage();
110
-	}
105
+        $content = new OC_Template('core', $templateName, 'guest');
106
+        $content->assign('title', $this->server->httpResponse->getStatusText());
107
+        $content->assign('remoteAddr', $request->getRemoteAddress());
108
+        $content->assign('requestID', $request->getId());
109
+        return $content->fetchPage();
110
+    }
111 111
 
112
-	/**
113
-	 * @codeCoverageIgnore
114
-	 */
115
-	public function sendResponse() {
116
-		$this->server->sapi->sendResponse($this->server->httpResponse);
117
-		exit();
118
-	}
112
+    /**
113
+     * @codeCoverageIgnore
114
+     */
115
+    public function sendResponse() {
116
+        $this->server->sapi->sendResponse($this->server->httpResponse);
117
+        exit();
118
+    }
119 119
 }
Please login to merge, or discard this patch.
apps/workflowengine/lib/Settings/Admin.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@
 block discarded – undo
28 28
 use OCP\WorkflowEngine\IManager;
29 29
 
30 30
 class Admin extends ASettings {
31
-	public function getScope(): int {
32
-		return IManager::SCOPE_ADMIN;
33
-	}
31
+    public function getScope(): int {
32
+        return IManager::SCOPE_ADMIN;
33
+    }
34 34
 }
Please login to merge, or discard this patch.
apps/files_sharing/lib/Activity/Filter.php 1 patch
Indentation   +60 added lines, -60 removed lines patch added patch discarded remove patch
@@ -28,73 +28,73 @@
 block discarded – undo
28 28
 use OCP\IURLGenerator;
29 29
 
30 30
 class Filter implements IFilter {
31
-	public const TYPE_REMOTE_SHARE = 'remote_share';
32
-	public const TYPE_SHARED = 'shared';
31
+    public const TYPE_REMOTE_SHARE = 'remote_share';
32
+    public const TYPE_SHARED = 'shared';
33 33
 
34
-	/** @var IL10N */
35
-	protected $l;
34
+    /** @var IL10N */
35
+    protected $l;
36 36
 
37
-	/** @var IURLGenerator */
38
-	protected $url;
37
+    /** @var IURLGenerator */
38
+    protected $url;
39 39
 
40
-	public function __construct(IL10N $l, IURLGenerator $url) {
41
-		$this->l = $l;
42
-		$this->url = $url;
43
-	}
40
+    public function __construct(IL10N $l, IURLGenerator $url) {
41
+        $this->l = $l;
42
+        $this->url = $url;
43
+    }
44 44
 
45
-	/**
46
-	 * @return string Lowercase a-z only identifier
47
-	 * @since 11.0.0
48
-	 */
49
-	public function getIdentifier() {
50
-		return 'files_sharing';
51
-	}
45
+    /**
46
+     * @return string Lowercase a-z only identifier
47
+     * @since 11.0.0
48
+     */
49
+    public function getIdentifier() {
50
+        return 'files_sharing';
51
+    }
52 52
 
53
-	/**
54
-	 * @return string A translated string
55
-	 * @since 11.0.0
56
-	 */
57
-	public function getName() {
58
-		return $this->l->t('File shares');
59
-	}
53
+    /**
54
+     * @return string A translated string
55
+     * @since 11.0.0
56
+     */
57
+    public function getName() {
58
+        return $this->l->t('File shares');
59
+    }
60 60
 
61
-	/**
62
-	 * @return int
63
-	 * @since 11.0.0
64
-	 */
65
-	public function getPriority() {
66
-		return 31;
67
-	}
61
+    /**
62
+     * @return int
63
+     * @since 11.0.0
64
+     */
65
+    public function getPriority() {
66
+        return 31;
67
+    }
68 68
 
69
-	/**
70
-	 * @return string Full URL to an icon, empty string when none is given
71
-	 * @since 11.0.0
72
-	 */
73
-	public function getIcon() {
74
-		return $this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/share.svg'));
75
-	}
69
+    /**
70
+     * @return string Full URL to an icon, empty string when none is given
71
+     * @since 11.0.0
72
+     */
73
+    public function getIcon() {
74
+        return $this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/share.svg'));
75
+    }
76 76
 
77
-	/**
78
-	 * @param string[] $types
79
-	 * @return string[] An array of allowed apps from which activities should be displayed
80
-	 * @since 11.0.0
81
-	 */
82
-	public function filterTypes(array $types) {
83
-		return array_intersect([
84
-			self::TYPE_SHARED,
85
-			self::TYPE_REMOTE_SHARE,
86
-			'file_downloaded',
87
-		], $types);
88
-	}
77
+    /**
78
+     * @param string[] $types
79
+     * @return string[] An array of allowed apps from which activities should be displayed
80
+     * @since 11.0.0
81
+     */
82
+    public function filterTypes(array $types) {
83
+        return array_intersect([
84
+            self::TYPE_SHARED,
85
+            self::TYPE_REMOTE_SHARE,
86
+            'file_downloaded',
87
+        ], $types);
88
+    }
89 89
 
90
-	/**
91
-	 * @return string[] An array of allowed apps from which activities should be displayed
92
-	 * @since 11.0.0
93
-	 */
94
-	public function allowedApps() {
95
-		return [
96
-			'files_sharing',
97
-			'files_downloadactivity',
98
-		];
99
-	}
90
+    /**
91
+     * @return string[] An array of allowed apps from which activities should be displayed
92
+     * @since 11.0.0
93
+     */
94
+    public function allowedApps() {
95
+        return [
96
+            'files_sharing',
97
+            'files_downloadactivity',
98
+        ];
99
+    }
100 100
 }
Please login to merge, or discard this patch.
apps/files_external/lib/Lib/Auth/AmazonS3/AccessKey.php 1 patch
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -32,17 +32,17 @@
 block discarded – undo
32 32
  * Amazon S3 access key authentication
33 33
  */
34 34
 class AccessKey extends AuthMechanism {
35
-	public const SCHEME_AMAZONS3_ACCESSKEY = 'amazons3_accesskey';
35
+    public const SCHEME_AMAZONS3_ACCESSKEY = 'amazons3_accesskey';
36 36
 
37
-	public function __construct(IL10N $l) {
38
-		$this
39
-			->setIdentifier('amazons3::accesskey')
40
-			->setScheme(self::SCHEME_AMAZONS3_ACCESSKEY)
41
-			->setText($l->t('Access key'))
42
-			->addParameters([
43
-				new DefinitionParameter('key', $l->t('Access key')),
44
-				(new DefinitionParameter('secret', $l->t('Secret key')))
45
-					->setType(DefinitionParameter::VALUE_PASSWORD),
46
-			]);
47
-	}
37
+    public function __construct(IL10N $l) {
38
+        $this
39
+            ->setIdentifier('amazons3::accesskey')
40
+            ->setScheme(self::SCHEME_AMAZONS3_ACCESSKEY)
41
+            ->setText($l->t('Access key'))
42
+            ->addParameters([
43
+                new DefinitionParameter('key', $l->t('Access key')),
44
+                (new DefinitionParameter('secret', $l->t('Secret key')))
45
+                    ->setType(DefinitionParameter::VALUE_PASSWORD),
46
+            ]);
47
+    }
48 48
 }
Please login to merge, or discard this patch.
apps/files_external/lib/Lib/Auth/Password/GlobalAuth.php 1 patch
Indentation   +42 added lines, -42 removed lines patch added patch discarded remove patch
@@ -36,53 +36,53 @@
 block discarded – undo
36 36
  * Global Username and Password
37 37
  */
38 38
 class GlobalAuth extends AuthMechanism {
39
-	public const CREDENTIALS_IDENTIFIER = 'password::global';
39
+    public const CREDENTIALS_IDENTIFIER = 'password::global';
40 40
 
41
-	/** @var ICredentialsManager */
42
-	protected $credentialsManager;
41
+    /** @var ICredentialsManager */
42
+    protected $credentialsManager;
43 43
 
44
-	public function __construct(IL10N $l, ICredentialsManager $credentialsManager) {
45
-		$this->credentialsManager = $credentialsManager;
44
+    public function __construct(IL10N $l, ICredentialsManager $credentialsManager) {
45
+        $this->credentialsManager = $credentialsManager;
46 46
 
47
-		$this
48
-			->setIdentifier('password::global')
49
-			->setVisibility(BackendService::VISIBILITY_DEFAULT)
50
-			->setScheme(self::SCHEME_PASSWORD)
51
-			->setText($l->t('Global credentials'));
52
-	}
47
+        $this
48
+            ->setIdentifier('password::global')
49
+            ->setVisibility(BackendService::VISIBILITY_DEFAULT)
50
+            ->setScheme(self::SCHEME_PASSWORD)
51
+            ->setText($l->t('Global credentials'));
52
+    }
53 53
 
54
-	public function getAuth($uid) {
55
-		$auth = $this->credentialsManager->retrieve($uid, self::CREDENTIALS_IDENTIFIER);
56
-		if (!is_array($auth)) {
57
-			return [
58
-				'user' => '',
59
-				'password' => ''
60
-			];
61
-		} else {
62
-			return $auth;
63
-		}
64
-	}
54
+    public function getAuth($uid) {
55
+        $auth = $this->credentialsManager->retrieve($uid, self::CREDENTIALS_IDENTIFIER);
56
+        if (!is_array($auth)) {
57
+            return [
58
+                'user' => '',
59
+                'password' => ''
60
+            ];
61
+        } else {
62
+            return $auth;
63
+        }
64
+    }
65 65
 
66
-	public function saveAuth($uid, $user, $password) {
67
-		$this->credentialsManager->store($uid, self::CREDENTIALS_IDENTIFIER, [
68
-			'user' => $user,
69
-			'password' => $password
70
-		]);
71
-	}
66
+    public function saveAuth($uid, $user, $password) {
67
+        $this->credentialsManager->store($uid, self::CREDENTIALS_IDENTIFIER, [
68
+            'user' => $user,
69
+            'password' => $password
70
+        ]);
71
+    }
72 72
 
73
-	public function manipulateStorageConfig(StorageConfig &$storage, IUser $user = null) {
74
-		if ($storage->getType() === StorageConfig::MOUNT_TYPE_ADMIN) {
75
-			$uid = '';
76
-		} elseif (is_null($user)) {
77
-			throw new InsufficientDataForMeaningfulAnswerException('No credentials saved');
78
-		} else {
79
-			$uid = $user->getUID();
80
-		}
81
-		$credentials = $this->credentialsManager->retrieve($uid, self::CREDENTIALS_IDENTIFIER);
73
+    public function manipulateStorageConfig(StorageConfig &$storage, IUser $user = null) {
74
+        if ($storage->getType() === StorageConfig::MOUNT_TYPE_ADMIN) {
75
+            $uid = '';
76
+        } elseif (is_null($user)) {
77
+            throw new InsufficientDataForMeaningfulAnswerException('No credentials saved');
78
+        } else {
79
+            $uid = $user->getUID();
80
+        }
81
+        $credentials = $this->credentialsManager->retrieve($uid, self::CREDENTIALS_IDENTIFIER);
82 82
 
83
-		if (is_array($credentials)) {
84
-			$storage->setBackendOption('user', $credentials['user']);
85
-			$storage->setBackendOption('password', $credentials['password']);
86
-		}
87
-	}
83
+        if (is_array($credentials)) {
84
+            $storage->setBackendOption('user', $credentials['user']);
85
+            $storage->setBackendOption('password', $credentials['password']);
86
+        }
87
+    }
88 88
 }
Please login to merge, or discard this patch.
apps/files_external/lib/Lib/Backend/InvalidBackend.php 1 patch
Indentation   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -34,33 +34,33 @@
 block discarded – undo
34 34
  */
35 35
 class InvalidBackend extends Backend {
36 36
 
37
-	/** @var string Invalid backend id */
38
-	private $invalidId;
37
+    /** @var string Invalid backend id */
38
+    private $invalidId;
39 39
 
40
-	/**
41
-	 * Constructs a new InvalidBackend with the id of the invalid backend
42
-	 * for display purposes
43
-	 *
44
-	 * @param string $invalidId id of the backend that did not exist
45
-	 */
46
-	public function __construct($invalidId) {
47
-		$this->invalidId = $invalidId;
48
-		$this
49
-			->setIdentifier($invalidId)
50
-			->setStorageClass('\OC\Files\Storage\FailedStorage')
51
-			->setText('Unknown storage backend ' . $invalidId);
52
-	}
40
+    /**
41
+     * Constructs a new InvalidBackend with the id of the invalid backend
42
+     * for display purposes
43
+     *
44
+     * @param string $invalidId id of the backend that did not exist
45
+     */
46
+    public function __construct($invalidId) {
47
+        $this->invalidId = $invalidId;
48
+        $this
49
+            ->setIdentifier($invalidId)
50
+            ->setStorageClass('\OC\Files\Storage\FailedStorage')
51
+            ->setText('Unknown storage backend ' . $invalidId);
52
+    }
53 53
 
54
-	/**
55
-	 * Returns the invalid backend id
56
-	 *
57
-	 * @return string invalid backend id
58
-	 */
59
-	public function getInvalidId() {
60
-		return $this->invalidId;
61
-	}
54
+    /**
55
+     * Returns the invalid backend id
56
+     *
57
+     * @return string invalid backend id
58
+     */
59
+    public function getInvalidId() {
60
+        return $this->invalidId;
61
+    }
62 62
 
63
-	public function manipulateStorageConfig(StorageConfig &$storage, IUser $user = null) {
64
-		$storage->setBackendOption('exception', new \Exception('Unknown storage backend "' . $this->invalidId . '"', StorageNotAvailableException::STATUS_ERROR));
65
-	}
63
+    public function manipulateStorageConfig(StorageConfig &$storage, IUser $user = null) {
64
+        $storage->setBackendOption('exception', new \Exception('Unknown storage backend "' . $this->invalidId . '"', StorageNotAvailableException::STATUS_ERROR));
65
+    }
66 66
 }
Please login to merge, or discard this patch.
apps/files_external/lib/Lib/Storage/OwnCloud.php 1 patch
Indentation   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -39,45 +39,45 @@
 block discarded – undo
39 39
  *
40 40
  */
41 41
 class OwnCloud extends \OC\Files\Storage\DAV implements IDisableEncryptionStorage {
42
-	public const OC_URL_SUFFIX = 'remote.php/webdav';
42
+    public const OC_URL_SUFFIX = 'remote.php/webdav';
43 43
 
44
-	public function __construct($params) {
45
-		// extract context path from host if specified
46
-		// (owncloud install path on host)
47
-		$host = $params['host'];
48
-		// strip protocol
49
-		if (substr($host, 0, 8) === "https://") {
50
-			$host = substr($host, 8);
51
-			$params['secure'] = true;
52
-		} elseif (substr($host, 0, 7) === "http://") {
53
-			$host = substr($host, 7);
54
-			$params['secure'] = false;
55
-		}
56
-		$contextPath = '';
57
-		$hostSlashPos = strpos($host, '/');
58
-		if ($hostSlashPos !== false) {
59
-			$contextPath = substr($host, $hostSlashPos);
60
-			$host = substr($host, 0, $hostSlashPos);
61
-		}
44
+    public function __construct($params) {
45
+        // extract context path from host if specified
46
+        // (owncloud install path on host)
47
+        $host = $params['host'];
48
+        // strip protocol
49
+        if (substr($host, 0, 8) === "https://") {
50
+            $host = substr($host, 8);
51
+            $params['secure'] = true;
52
+        } elseif (substr($host, 0, 7) === "http://") {
53
+            $host = substr($host, 7);
54
+            $params['secure'] = false;
55
+        }
56
+        $contextPath = '';
57
+        $hostSlashPos = strpos($host, '/');
58
+        if ($hostSlashPos !== false) {
59
+            $contextPath = substr($host, $hostSlashPos);
60
+            $host = substr($host, 0, $hostSlashPos);
61
+        }
62 62
 
63
-		if (substr($contextPath, -1) !== '/') {
64
-			$contextPath .= '/';
65
-		}
63
+        if (substr($contextPath, -1) !== '/') {
64
+            $contextPath .= '/';
65
+        }
66 66
 
67
-		if (isset($params['root'])) {
68
-			$root = '/' . ltrim($params['root'], '/');
69
-		} else {
70
-			$root = '/';
71
-		}
67
+        if (isset($params['root'])) {
68
+            $root = '/' . ltrim($params['root'], '/');
69
+        } else {
70
+            $root = '/';
71
+        }
72 72
 
73
-		$params['host'] = $host;
74
-		$params['root'] = $contextPath . self::OC_URL_SUFFIX . $root;
75
-		$params['authType'] = Client::AUTH_BASIC;
73
+        $params['host'] = $host;
74
+        $params['root'] = $contextPath . self::OC_URL_SUFFIX . $root;
75
+        $params['authType'] = Client::AUTH_BASIC;
76 76
 
77
-		parent::__construct($params);
78
-	}
77
+        parent::__construct($params);
78
+    }
79 79
 
80
-	public function needsPartFile() {
81
-		return false;
82
-	}
80
+    public function needsPartFile() {
81
+        return false;
82
+    }
83 83
 }
Please login to merge, or discard this patch.