Passed
Push — master ( a70fd1...19a845 )
by Lukas
14:52 queued 14s
created
lib/public/AppFramework/Http/TextPlainResponse.php 1 patch
Indentation   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -32,31 +32,31 @@
 block discarded – undo
32 32
  * @since 22.0.0
33 33
  */
34 34
 class TextPlainResponse extends Response {
35
-	/** @var string */
36
-	private $text = '';
37
-
38
-	/**
39
-	 * constructor of TextPlainResponse
40
-	 * @param string $text The text body
41
-	 * @param int $statusCode the Http status code, defaults to 200
42
-	 * @since 22.0.0
43
-	 */
44
-	public function __construct(string $text = '', int $statusCode = Http::STATUS_OK) {
45
-		parent::__construct();
46
-
47
-		$this->text = $text;
48
-		$this->setStatus($statusCode);
49
-		$this->addHeader('Content-Type', 'text/plain');
50
-	}
51
-
52
-
53
-	/**
54
-	 * Returns the text
55
-	 * @return string
56
-	 * @since 22.0.0
57
-	 * @throws \Exception If data could not get encoded
58
-	 */
59
-	public function render() : string {
60
-		return $this->text;
61
-	}
35
+    /** @var string */
36
+    private $text = '';
37
+
38
+    /**
39
+     * constructor of TextPlainResponse
40
+     * @param string $text The text body
41
+     * @param int $statusCode the Http status code, defaults to 200
42
+     * @since 22.0.0
43
+     */
44
+    public function __construct(string $text = '', int $statusCode = Http::STATUS_OK) {
45
+        parent::__construct();
46
+
47
+        $this->text = $text;
48
+        $this->setStatus($statusCode);
49
+        $this->addHeader('Content-Type', 'text/plain');
50
+    }
51
+
52
+
53
+    /**
54
+     * Returns the text
55
+     * @return string
56
+     * @since 22.0.0
57
+     * @throws \Exception If data could not get encoded
58
+     */
59
+    public function render() : string {
60
+        return $this->text;
61
+    }
62 62
 }
Please login to merge, or discard this patch.
apps/settings/lib/AppInfo/Application.php 1 patch
Indentation   +94 added lines, -94 removed lines patch added patch discarded remove patch
@@ -59,109 +59,109 @@
 block discarded – undo
59 59
 use OCP\Util;
60 60
 
61 61
 class Application extends App implements IBootstrap {
62
-	public const APP_ID = 'settings';
62
+    public const APP_ID = 'settings';
63 63
 
64
-	/**
65
-	 * @param array $urlParams
66
-	 */
67
-	public function __construct(array $urlParams = []) {
68
-		parent::__construct(self::APP_ID, $urlParams);
69
-	}
64
+    /**
65
+     * @param array $urlParams
66
+     */
67
+    public function __construct(array $urlParams = []) {
68
+        parent::__construct(self::APP_ID, $urlParams);
69
+    }
70 70
 
71
-	public function register(IRegistrationContext $context): void {
72
-		// Register Middleware
73
-		$context->registerServiceAlias('SubadminMiddleware', SubadminMiddleware::class);
74
-		$context->registerMiddleware(SubadminMiddleware::class);
75
-		$context->registerSearchProvider(SectionSearch::class);
76
-		$context->registerSearchProvider(AppSearch::class);
71
+    public function register(IRegistrationContext $context): void {
72
+        // Register Middleware
73
+        $context->registerServiceAlias('SubadminMiddleware', SubadminMiddleware::class);
74
+        $context->registerMiddleware(SubadminMiddleware::class);
75
+        $context->registerSearchProvider(SectionSearch::class);
76
+        $context->registerSearchProvider(AppSearch::class);
77 77
 
78
-		// Register listeners
79
-		$context->registerEventListener(AppPasswordCreatedEvent::class, AppPasswordCreatedActivityListener::class);
80
-		$context->registerEventListener(UserAddedEvent::class, UserAddedToGroupActivityListener::class);
81
-		$context->registerEventListener(UserRemovedEvent::class, UserRemovedFromGroupActivityListener::class);
78
+        // Register listeners
79
+        $context->registerEventListener(AppPasswordCreatedEvent::class, AppPasswordCreatedActivityListener::class);
80
+        $context->registerEventListener(UserAddedEvent::class, UserAddedToGroupActivityListener::class);
81
+        $context->registerEventListener(UserRemovedEvent::class, UserRemovedFromGroupActivityListener::class);
82 82
 
83
-		// Register well-known handlers
84
-		$context->registerWellKnownHandler(SecurityTxtHandler::class);
83
+        // Register well-known handlers
84
+        $context->registerWellKnownHandler(SecurityTxtHandler::class);
85 85
 
86
-		/**
87
-		 * Core class wrappers
88
-		 */
89
-		/** FIXME: Remove once OC_User is non-static and mockable */
90
-		$context->registerService('isAdmin', function () {
91
-			return \OC_User::isAdminUser(\OC_User::getUser());
92
-		});
93
-		/** FIXME: Remove once OC_SubAdmin is non-static and mockable */
94
-		$context->registerService('isSubAdmin', function () {
95
-			$userObject = \OC::$server->getUserSession()->getUser();
96
-			$isSubAdmin = false;
97
-			if ($userObject !== null) {
98
-				$isSubAdmin = \OC::$server->getGroupManager()->getSubAdmin()->isSubAdmin($userObject);
99
-			}
100
-			return $isSubAdmin;
101
-		});
102
-		$context->registerService(IProvider::class, function (IAppContainer $appContainer) {
103
-			/** @var IServerContainer $serverContainer */
104
-			$serverContainer = $appContainer->query(IServerContainer::class);
105
-			return $serverContainer->query(IProvider::class);
106
-		});
107
-		$context->registerService(IManager::class, function (IAppContainer $appContainer) {
108
-			/** @var IServerContainer $serverContainer */
109
-			$serverContainer = $appContainer->query(IServerContainer::class);
110
-			return $serverContainer->getSettingsManager();
111
-		});
86
+        /**
87
+         * Core class wrappers
88
+         */
89
+        /** FIXME: Remove once OC_User is non-static and mockable */
90
+        $context->registerService('isAdmin', function () {
91
+            return \OC_User::isAdminUser(\OC_User::getUser());
92
+        });
93
+        /** FIXME: Remove once OC_SubAdmin is non-static and mockable */
94
+        $context->registerService('isSubAdmin', function () {
95
+            $userObject = \OC::$server->getUserSession()->getUser();
96
+            $isSubAdmin = false;
97
+            if ($userObject !== null) {
98
+                $isSubAdmin = \OC::$server->getGroupManager()->getSubAdmin()->isSubAdmin($userObject);
99
+            }
100
+            return $isSubAdmin;
101
+        });
102
+        $context->registerService(IProvider::class, function (IAppContainer $appContainer) {
103
+            /** @var IServerContainer $serverContainer */
104
+            $serverContainer = $appContainer->query(IServerContainer::class);
105
+            return $serverContainer->query(IProvider::class);
106
+        });
107
+        $context->registerService(IManager::class, function (IAppContainer $appContainer) {
108
+            /** @var IServerContainer $serverContainer */
109
+            $serverContainer = $appContainer->query(IServerContainer::class);
110
+            return $serverContainer->getSettingsManager();
111
+        });
112 112
 
113
-		$context->registerService(NewUserMailHelper::class, function (IAppContainer $appContainer) {
114
-			/** @var Server $server */
115
-			$server = $appContainer->query(IServerContainer::class);
116
-			/** @var Defaults $defaults */
117
-			$defaults = $server->query(Defaults::class);
113
+        $context->registerService(NewUserMailHelper::class, function (IAppContainer $appContainer) {
114
+            /** @var Server $server */
115
+            $server = $appContainer->query(IServerContainer::class);
116
+            /** @var Defaults $defaults */
117
+            $defaults = $server->query(Defaults::class);
118 118
 
119
-			return new NewUserMailHelper(
120
-				$defaults,
121
-				$server->getURLGenerator(),
122
-				$server->getL10NFactory(),
123
-				$server->getMailer(),
124
-				$server->getSecureRandom(),
125
-				new TimeFactory(),
126
-				$server->getConfig(),
127
-				$server->getCrypto(),
128
-				Util::getDefaultEmailAddress('no-reply')
129
-			);
130
-		});
131
-	}
119
+            return new NewUserMailHelper(
120
+                $defaults,
121
+                $server->getURLGenerator(),
122
+                $server->getL10NFactory(),
123
+                $server->getMailer(),
124
+                $server->getSecureRandom(),
125
+                new TimeFactory(),
126
+                $server->getConfig(),
127
+                $server->getCrypto(),
128
+                Util::getDefaultEmailAddress('no-reply')
129
+            );
130
+        });
131
+    }
132 132
 
133
-	public function boot(IBootContext $context): void {
134
-		Util::connectHook('OC_User', 'post_setPassword', $this, 'onChangePassword');
135
-		Util::connectHook('OC_User', 'changeUser', $this, 'onChangeInfo');
136
-	}
133
+    public function boot(IBootContext $context): void {
134
+        Util::connectHook('OC_User', 'post_setPassword', $this, 'onChangePassword');
135
+        Util::connectHook('OC_User', 'changeUser', $this, 'onChangeInfo');
136
+    }
137 137
 
138
-	/**
139
-	 * @param array $parameters
140
-	 * @throws \InvalidArgumentException
141
-	 * @throws \BadMethodCallException
142
-	 * @throws \Exception
143
-	 * @throws \OCP\AppFramework\QueryException
144
-	 */
145
-	public function onChangePassword(array $parameters) {
146
-		/** @var Hooks $hooks */
147
-		$hooks = $this->getContainer()->query(Hooks::class);
148
-		$hooks->onChangePassword($parameters['uid']);
149
-	}
138
+    /**
139
+     * @param array $parameters
140
+     * @throws \InvalidArgumentException
141
+     * @throws \BadMethodCallException
142
+     * @throws \Exception
143
+     * @throws \OCP\AppFramework\QueryException
144
+     */
145
+    public function onChangePassword(array $parameters) {
146
+        /** @var Hooks $hooks */
147
+        $hooks = $this->getContainer()->query(Hooks::class);
148
+        $hooks->onChangePassword($parameters['uid']);
149
+    }
150 150
 
151
-	/**
152
-	 * @param array $parameters
153
-	 * @throws \InvalidArgumentException
154
-	 * @throws \BadMethodCallException
155
-	 * @throws \Exception
156
-	 * @throws \OCP\AppFramework\QueryException
157
-	 */
158
-	public function onChangeInfo(array $parameters) {
159
-		if ($parameters['feature'] !== 'eMailAddress') {
160
-			return;
161
-		}
151
+    /**
152
+     * @param array $parameters
153
+     * @throws \InvalidArgumentException
154
+     * @throws \BadMethodCallException
155
+     * @throws \Exception
156
+     * @throws \OCP\AppFramework\QueryException
157
+     */
158
+    public function onChangeInfo(array $parameters) {
159
+        if ($parameters['feature'] !== 'eMailAddress') {
160
+            return;
161
+        }
162 162
 
163
-		/** @var Hooks $hooks */
164
-		$hooks = $this->getContainer()->query(Hooks::class);
165
-		$hooks->onChangeEmail($parameters['user'], $parameters['old_value']);
166
-	}
163
+        /** @var Hooks $hooks */
164
+        $hooks = $this->getContainer()->query(Hooks::class);
165
+        $hooks->onChangeEmail($parameters['user'], $parameters['old_value']);
166
+    }
167 167
 }
Please login to merge, or discard this patch.
apps/settings/lib/WellKnown/SecurityTxtHandler.php 1 patch
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -32,17 +32,17 @@
 block discarded – undo
32 32
 use OCP\Http\WellKnown\IResponse;
33 33
 
34 34
 class SecurityTxtHandler implements IHandler {
35
-	public function handle(string $service, IRequestContext $context, ?IResponse $previousResponse): ?IResponse {
36
-		if ($service !== 'security.txt') {
37
-			return $previousResponse;
38
-		}
35
+    public function handle(string $service, IRequestContext $context, ?IResponse $previousResponse): ?IResponse {
36
+        if ($service !== 'security.txt') {
37
+            return $previousResponse;
38
+        }
39 39
 
40
-		$response = "Contact: https://hackerone.com/nextcloud
40
+        $response = "Contact: https://hackerone.com/nextcloud
41 41
 Expires: 2021-12-31T23:00:00.000Z
42 42
 Acknowledgments: https://hackerone.com/nextcloud/thanks
43 43
 Acknowledgments: https://github.com/nextcloud/security-advisories/security/advisories
44 44
 Policy: https://hackerone.com/nextcloud";
45 45
 
46
-		return new GenericResponse(new TextPlainResponse($response, 200));
47
-	}
46
+        return new GenericResponse(new TextPlainResponse($response, 200));
47
+    }
48 48
 }
Please login to merge, or discard this patch.