Passed
Push — master ( 4908d8...fbbdc6 )
by Joas
16:12 queued 12s
created
lib/public/AppFramework/Http/StreamResponse.php 1 patch
Indentation   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -35,35 +35,35 @@
 block discarded – undo
35 35
  * @since 8.1.0
36 36
  */
37 37
 class StreamResponse extends Response implements ICallbackResponse {
38
-	/** @var string */
39
-	private $filePath;
38
+    /** @var string */
39
+    private $filePath;
40 40
 
41
-	/**
42
-	 * @param string|resource $filePath the path to the file or a file handle which should be streamed
43
-	 * @since 8.1.0
44
-	 */
45
-	public function __construct($filePath) {
46
-		parent::__construct();
41
+    /**
42
+     * @param string|resource $filePath the path to the file or a file handle which should be streamed
43
+     * @since 8.1.0
44
+     */
45
+    public function __construct($filePath) {
46
+        parent::__construct();
47 47
 
48
-		$this->filePath = $filePath;
49
-	}
48
+        $this->filePath = $filePath;
49
+    }
50 50
 
51 51
 
52
-	/**
53
-	 * Streams the file using readfile
54
-	 *
55
-	 * @param IOutput $output a small wrapper that handles output
56
-	 * @since 8.1.0
57
-	 */
58
-	public function callback(IOutput $output) {
59
-		// handle caching
60
-		if ($output->getHttpResponseCode() !== Http::STATUS_NOT_MODIFIED) {
61
-			if (!(is_resource($this->filePath) || file_exists($this->filePath))) {
62
-				$output->setHttpResponseCode(Http::STATUS_NOT_FOUND);
63
-			} elseif ($output->setReadfile($this->filePath) === false) {
64
-				$output->setHttpResponseCode(Http::STATUS_BAD_REQUEST);
65
-			}
66
-		}
67
-	}
52
+    /**
53
+     * Streams the file using readfile
54
+     *
55
+     * @param IOutput $output a small wrapper that handles output
56
+     * @since 8.1.0
57
+     */
58
+    public function callback(IOutput $output) {
59
+        // handle caching
60
+        if ($output->getHttpResponseCode() !== Http::STATUS_NOT_MODIFIED) {
61
+            if (!(is_resource($this->filePath) || file_exists($this->filePath))) {
62
+                $output->setHttpResponseCode(Http::STATUS_NOT_FOUND);
63
+            } elseif ($output->setReadfile($this->filePath) === false) {
64
+                $output->setHttpResponseCode(Http::STATUS_BAD_REQUEST);
65
+            }
66
+        }
67
+    }
68 68
 
69 69
 }
Please login to merge, or discard this patch.
lib/public/Diagnostics/IQueryLogger.php 1 patch
Indentation   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -34,43 +34,43 @@
 block discarded – undo
34 34
  * @since 8.0.0
35 35
  */
36 36
 interface IQueryLogger extends SQLLogger {
37
-	/**
38
-	 * Mark the start of a query providing query SQL statement, its parameters and types.
39
-	 * This method should be called as close to the DB as possible and after
40
-	 * query is finished finalized with stopQuery() method.
41
-	 *
42
-	 * @param string $sql
43
-	 * @param array|null $params
44
-	 * @param array|null $types
45
-	 * @since 8.0.0
46
-	 */
47
-	public function startQuery($sql, array $params = null, array $types = null);
37
+    /**
38
+     * Mark the start of a query providing query SQL statement, its parameters and types.
39
+     * This method should be called as close to the DB as possible and after
40
+     * query is finished finalized with stopQuery() method.
41
+     *
42
+     * @param string $sql
43
+     * @param array|null $params
44
+     * @param array|null $types
45
+     * @since 8.0.0
46
+     */
47
+    public function startQuery($sql, array $params = null, array $types = null);
48 48
 
49
-	/**
50
-	 * Mark the end of the current active query. Ending query should store \OCP\Diagnostics\IQuery to
51
-	 * be returned with getQueries() method.
52
-	 *
53
-	 * @return mixed
54
-	 * @since 8.0.0
55
-	 */
56
-	public function stopQuery();
49
+    /**
50
+     * Mark the end of the current active query. Ending query should store \OCP\Diagnostics\IQuery to
51
+     * be returned with getQueries() method.
52
+     *
53
+     * @return mixed
54
+     * @since 8.0.0
55
+     */
56
+    public function stopQuery();
57 57
 
58
-	/**
59
-	 * This method should return all \OCP\Diagnostics\IQuery objects stored using
60
-	 * startQuery()/stopQuery() methods.
61
-	 *
62
-	 * @return \OCP\Diagnostics\IQuery[]
63
-	 * @since 8.0.0
64
-	 */
65
-	public function getQueries();
58
+    /**
59
+     * This method should return all \OCP\Diagnostics\IQuery objects stored using
60
+     * startQuery()/stopQuery() methods.
61
+     *
62
+     * @return \OCP\Diagnostics\IQuery[]
63
+     * @since 8.0.0
64
+     */
65
+    public function getQueries();
66 66
 
67
-	/**
68
-	 * Activate the module for the duration of the request. Deactivated module
69
-	 * does not create and store \OCP\Diagnostics\IQuery objects.
70
-	 * Only activated module should create and store objects to be
71
-	 * returned with getQueries() call.
72
-	 *
73
-	 * @since 12.0.0
74
-	 */
75
-	public function activate();
67
+    /**
68
+     * Activate the module for the duration of the request. Deactivated module
69
+     * does not create and store \OCP\Diagnostics\IQuery objects.
70
+     * Only activated module should create and store objects to be
71
+     * returned with getQueries() call.
72
+     *
73
+     * @since 12.0.0
74
+     */
75
+    public function activate();
76 76
 }
Please login to merge, or discard this patch.
lib/private/Color.php 1 patch
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -24,12 +24,12 @@
 block discarded – undo
24 24
 namespace OC;
25 25
 
26 26
 class Color {
27
-	public $r;
28
-	public $g;
29
-	public $b;
30
-	public function __construct($r, $g, $b) {
31
-		$this->r = $r;
32
-		$this->g = $g;
33
-		$this->b = $b;
34
-	}
27
+    public $r;
28
+    public $g;
29
+    public $b;
30
+    public function __construct($r, $g, $b) {
31
+        $this->r = $r;
32
+        $this->g = $g;
33
+        $this->b = $b;
34
+    }
35 35
 }
Please login to merge, or discard this patch.
apps/encryption/templates/settings-personal.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2
-	/** @var array $_ */
3
-	/** @var \OCP\IL10N $l */
2
+    /** @var array $_ */
3
+    /** @var \OCP\IL10N $l */
4 4
 script('encryption', 'settings-personal');
5 5
 ?>
6 6
 <form id="ocDefaultEncryptionModule" class="section">
@@ -19,8 +19,8 @@  discard block
 block discarded – undo
19 19
 			<br />
20 20
 			<?php p($l->t("Set your old private key password to your current log-in password:")); ?>
21 21
 			<?php if ($_["recoveryEnabledForUser"]):
22
-					p($l->t(" If you don't remember your old password you can ask your administrator to recover your files."));
23
-			endif; ?>
22
+                    p($l->t(" If you don't remember your old password you can ask your administrator to recover your files."));
23
+            endif; ?>
24 24
 			<br />
25 25
 			<input
26 26
 				type="password"
Please login to merge, or discard this patch.
apps/comments/lib/Listener/LoadAdditionalScripts.php 1 patch
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -34,14 +34,14 @@
 block discarded – undo
34 34
 use OCP\Util;
35 35
 
36 36
 class LoadAdditionalScripts implements IEventListener {
37
-	public function handle(Event $event): void {
38
-		if (!($event instanceof LoadAdditionalScriptsEvent)) {
39
-			return;
40
-		}
37
+    public function handle(Event $event): void {
38
+        if (!($event instanceof LoadAdditionalScriptsEvent)) {
39
+            return;
40
+        }
41 41
 
42
-		// TODO: make sure to only include the sidebar script when
43
-		// we properly split it between files list and sidebar
44
-		Util::addScript(Application::APP_ID, 'comments');
45
-	}
42
+        // TODO: make sure to only include the sidebar script when
43
+        // we properly split it between files list and sidebar
44
+        Util::addScript(Application::APP_ID, 'comments');
45
+    }
46 46
 
47 47
 }
Please login to merge, or discard this patch.
apps/files_versions/lib/Listener/LoadSidebarListener.php 1 patch
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -34,14 +34,14 @@
 block discarded – undo
34 34
 use OCP\Util;
35 35
 
36 36
 class LoadSidebarListener implements IEventListener {
37
-	public function handle(Event $event): void {
38
-		if (!($event instanceof LoadSidebar)) {
39
-			return;
40
-		}
37
+    public function handle(Event $event): void {
38
+        if (!($event instanceof LoadSidebar)) {
39
+            return;
40
+        }
41 41
 
42
-		// TODO: make sure to only include the sidebar script when
43
-		// we properly split it between files list and sidebar
44
-		Util::addScript(Application::APP_ID, 'files_versions');
45
-	}
42
+        // TODO: make sure to only include the sidebar script when
43
+        // we properly split it between files list and sidebar
44
+        Util::addScript(Application::APP_ID, 'files_versions');
45
+    }
46 46
 
47 47
 }
Please login to merge, or discard this patch.
apps/files_versions/lib/Listener/LoadAdditionalListener.php 1 patch
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -34,14 +34,14 @@
 block discarded – undo
34 34
 use OCP\Util;
35 35
 
36 36
 class LoadAdditionalListener implements IEventListener {
37
-	public function handle(Event $event): void {
38
-		if (!($event instanceof LoadAdditionalScriptsEvent)) {
39
-			return;
40
-		}
37
+    public function handle(Event $event): void {
38
+        if (!($event instanceof LoadAdditionalScriptsEvent)) {
39
+            return;
40
+        }
41 41
 
42
-		// TODO: make sure to only include the sidebar script when
43
-		// we properly split it between files list and sidebar
44
-		Util::addScript(Application::APP_ID, 'files_versions');
45
-	}
42
+        // TODO: make sure to only include the sidebar script when
43
+        // we properly split it between files list and sidebar
44
+        Util::addScript(Application::APP_ID, 'files_versions');
45
+    }
46 46
 
47 47
 }
Please login to merge, or discard this patch.
apps/files_sharing/lib/Notification/Listener.php 1 patch
Indentation   +93 added lines, -93 removed lines patch added patch discarded remove patch
@@ -37,97 +37,97 @@
 block discarded – undo
37 37
 
38 38
 class Listener {
39 39
 
40
-	/** @var INotificationManager */
41
-	protected $notificationManager;
42
-	/** @var IShareManager */
43
-	protected $shareManager;
44
-	/** @var IGroupManager */
45
-	protected $groupManager;
46
-
47
-	public function __construct(
48
-		INotificationManager $notificationManager,
49
-		IShareManager $shareManager,
50
-		IGroupManager $groupManager
51
-	) {
52
-		$this->notificationManager = $notificationManager;
53
-		$this->shareManager = $shareManager;
54
-		$this->groupManager = $groupManager;
55
-	}
56
-
57
-	/**
58
-	 * @param GenericEvent $event
59
-	 */
60
-	public function shareNotification(GenericEvent $event): void {
61
-		/** @var IShare $share */
62
-		$share = $event->getSubject();
63
-		$notification = $this->instantiateNotification($share);
64
-
65
-		if ($share->getShareType() === IShare::TYPE_USER) {
66
-			$notification->setSubject(Notifier::INCOMING_USER_SHARE)
67
-				->setUser($share->getSharedWith());
68
-			$this->notificationManager->notify($notification);
69
-		} elseif ($share->getShareType() === IShare::TYPE_GROUP) {
70
-			$notification->setSubject(Notifier::INCOMING_GROUP_SHARE);
71
-			$group = $this->groupManager->get($share->getSharedWith());
72
-
73
-			foreach ($group->getUsers() as $user) {
74
-				if ($user->getUID() === $share->getShareOwner() ||
75
-					$user->getUID() === $share->getSharedBy()) {
76
-					continue;
77
-				}
78
-
79
-				$notification->setUser($user->getUID());
80
-				$this->notificationManager->notify($notification);
81
-			}
82
-		}
83
-	}
84
-
85
-	/**
86
-	 * @param GenericEvent $event
87
-	 */
88
-	public function userAddedToGroup(GenericEvent $event): void {
89
-		/** @var IGroup $group */
90
-		$group = $event->getSubject();
91
-		/** @var IUser $user */
92
-		$user = $event->getArgument('user');
93
-
94
-		$offset = 0;
95
-		while (true) {
96
-			$shares = $this->shareManager->getSharedWith($user->getUID(), IShare::TYPE_GROUP, null, 50, $offset);
97
-			if (empty($shares)) {
98
-				break;
99
-			}
100
-
101
-			foreach ($shares as $share) {
102
-				if ($share->getSharedWith() !== $group->getGID()) {
103
-					continue;
104
-				}
105
-
106
-				if ($user->getUID() === $share->getShareOwner() ||
107
-					$user->getUID() === $share->getSharedBy()) {
108
-					continue;
109
-				}
110
-
111
-				$notification = $this->instantiateNotification($share);
112
-				$notification->setSubject(Notifier::INCOMING_GROUP_SHARE)
113
-					->setUser($user->getUID());
114
-				$this->notificationManager->notify($notification);
115
-			}
116
-			$offset += 50;
117
-		}
118
-	}
119
-
120
-	/**
121
-	 * @param IShare $share
122
-	 * @return INotification
123
-	 */
124
-	protected function instantiateNotification(IShare $share): INotification {
125
-		$notification = $this->notificationManager->createNotification();
126
-		$notification
127
-			->setApp('files_sharing')
128
-			->setObject('share', $share->getFullId())
129
-			->setDateTime($share->getShareTime());
130
-
131
-		return $notification;
132
-	}
40
+    /** @var INotificationManager */
41
+    protected $notificationManager;
42
+    /** @var IShareManager */
43
+    protected $shareManager;
44
+    /** @var IGroupManager */
45
+    protected $groupManager;
46
+
47
+    public function __construct(
48
+        INotificationManager $notificationManager,
49
+        IShareManager $shareManager,
50
+        IGroupManager $groupManager
51
+    ) {
52
+        $this->notificationManager = $notificationManager;
53
+        $this->shareManager = $shareManager;
54
+        $this->groupManager = $groupManager;
55
+    }
56
+
57
+    /**
58
+     * @param GenericEvent $event
59
+     */
60
+    public function shareNotification(GenericEvent $event): void {
61
+        /** @var IShare $share */
62
+        $share = $event->getSubject();
63
+        $notification = $this->instantiateNotification($share);
64
+
65
+        if ($share->getShareType() === IShare::TYPE_USER) {
66
+            $notification->setSubject(Notifier::INCOMING_USER_SHARE)
67
+                ->setUser($share->getSharedWith());
68
+            $this->notificationManager->notify($notification);
69
+        } elseif ($share->getShareType() === IShare::TYPE_GROUP) {
70
+            $notification->setSubject(Notifier::INCOMING_GROUP_SHARE);
71
+            $group = $this->groupManager->get($share->getSharedWith());
72
+
73
+            foreach ($group->getUsers() as $user) {
74
+                if ($user->getUID() === $share->getShareOwner() ||
75
+                    $user->getUID() === $share->getSharedBy()) {
76
+                    continue;
77
+                }
78
+
79
+                $notification->setUser($user->getUID());
80
+                $this->notificationManager->notify($notification);
81
+            }
82
+        }
83
+    }
84
+
85
+    /**
86
+     * @param GenericEvent $event
87
+     */
88
+    public function userAddedToGroup(GenericEvent $event): void {
89
+        /** @var IGroup $group */
90
+        $group = $event->getSubject();
91
+        /** @var IUser $user */
92
+        $user = $event->getArgument('user');
93
+
94
+        $offset = 0;
95
+        while (true) {
96
+            $shares = $this->shareManager->getSharedWith($user->getUID(), IShare::TYPE_GROUP, null, 50, $offset);
97
+            if (empty($shares)) {
98
+                break;
99
+            }
100
+
101
+            foreach ($shares as $share) {
102
+                if ($share->getSharedWith() !== $group->getGID()) {
103
+                    continue;
104
+                }
105
+
106
+                if ($user->getUID() === $share->getShareOwner() ||
107
+                    $user->getUID() === $share->getSharedBy()) {
108
+                    continue;
109
+                }
110
+
111
+                $notification = $this->instantiateNotification($share);
112
+                $notification->setSubject(Notifier::INCOMING_GROUP_SHARE)
113
+                    ->setUser($user->getUID());
114
+                $this->notificationManager->notify($notification);
115
+            }
116
+            $offset += 50;
117
+        }
118
+    }
119
+
120
+    /**
121
+     * @param IShare $share
122
+     * @return INotification
123
+     */
124
+    protected function instantiateNotification(IShare $share): INotification {
125
+        $notification = $this->notificationManager->createNotification();
126
+        $notification
127
+            ->setApp('files_sharing')
128
+            ->setObject('share', $share->getFullId())
129
+            ->setDateTime($share->getShareTime());
130
+
131
+        return $notification;
132
+    }
133 133
 }
Please login to merge, or discard this patch.
apps/workflowengine/lib/Check/AbstractStringCheck.php 1 patch
Indentation   +82 added lines, -82 removed lines patch added patch discarded remove patch
@@ -27,96 +27,96 @@
 block discarded – undo
27 27
 
28 28
 abstract class AbstractStringCheck implements ICheck {
29 29
 
30
-	/** @var array[] Nested array: [Pattern => [ActualValue => Regex Result]] */
31
-	protected $matches;
30
+    /** @var array[] Nested array: [Pattern => [ActualValue => Regex Result]] */
31
+    protected $matches;
32 32
 
33
-	/** @var IL10N */
34
-	protected $l;
33
+    /** @var IL10N */
34
+    protected $l;
35 35
 
36
-	/**
37
-	 * @param IL10N $l
38
-	 */
39
-	public function __construct(IL10N $l) {
40
-		$this->l = $l;
41
-	}
36
+    /**
37
+     * @param IL10N $l
38
+     */
39
+    public function __construct(IL10N $l) {
40
+        $this->l = $l;
41
+    }
42 42
 
43
-	/**
44
-	 * @return string
45
-	 */
46
-	abstract protected function getActualValue();
43
+    /**
44
+     * @return string
45
+     */
46
+    abstract protected function getActualValue();
47 47
 
48
-	/**
49
-	 * @param string $operator
50
-	 * @param string $value
51
-	 * @return bool
52
-	 */
53
-	public function executeCheck($operator, $value) {
54
-		$actualValue = $this->getActualValue();
55
-		return $this->executeStringCheck($operator, $value, $actualValue);
56
-	}
48
+    /**
49
+     * @param string $operator
50
+     * @param string $value
51
+     * @return bool
52
+     */
53
+    public function executeCheck($operator, $value) {
54
+        $actualValue = $this->getActualValue();
55
+        return $this->executeStringCheck($operator, $value, $actualValue);
56
+    }
57 57
 
58
-	/**
59
-	 * @param string $operator
60
-	 * @param string $checkValue
61
-	 * @param string $actualValue
62
-	 * @return bool
63
-	 */
64
-	protected function executeStringCheck($operator, $checkValue, $actualValue) {
65
-		if ($operator === 'is') {
66
-			return $checkValue === $actualValue;
67
-		} elseif ($operator === '!is') {
68
-			return $checkValue !== $actualValue;
69
-		} else {
70
-			$match = $this->match($checkValue, $actualValue);
71
-			if ($operator === 'matches') {
72
-				return $match === 1;
73
-			} else {
74
-				return $match === 0;
75
-			}
76
-		}
77
-	}
58
+    /**
59
+     * @param string $operator
60
+     * @param string $checkValue
61
+     * @param string $actualValue
62
+     * @return bool
63
+     */
64
+    protected function executeStringCheck($operator, $checkValue, $actualValue) {
65
+        if ($operator === 'is') {
66
+            return $checkValue === $actualValue;
67
+        } elseif ($operator === '!is') {
68
+            return $checkValue !== $actualValue;
69
+        } else {
70
+            $match = $this->match($checkValue, $actualValue);
71
+            if ($operator === 'matches') {
72
+                return $match === 1;
73
+            } else {
74
+                return $match === 0;
75
+            }
76
+        }
77
+    }
78 78
 
79
-	/**
80
-	 * @param string $operator
81
-	 * @param string $value
82
-	 * @throws \UnexpectedValueException
83
-	 */
84
-	public function validateCheck($operator, $value) {
85
-		if (!in_array($operator, ['is', '!is', 'matches', '!matches'])) {
86
-			throw new \UnexpectedValueException($this->l->t('The given operator is invalid'), 1);
87
-		}
79
+    /**
80
+     * @param string $operator
81
+     * @param string $value
82
+     * @throws \UnexpectedValueException
83
+     */
84
+    public function validateCheck($operator, $value) {
85
+        if (!in_array($operator, ['is', '!is', 'matches', '!matches'])) {
86
+            throw new \UnexpectedValueException($this->l->t('The given operator is invalid'), 1);
87
+        }
88 88
 
89
-		if (in_array($operator, ['matches', '!matches']) &&
90
-			  @preg_match($value, null) === false) {
91
-			throw new \UnexpectedValueException($this->l->t('The given regular expression is invalid'), 2);
92
-		}
93
-	}
89
+        if (in_array($operator, ['matches', '!matches']) &&
90
+              @preg_match($value, null) === false) {
91
+            throw new \UnexpectedValueException($this->l->t('The given regular expression is invalid'), 2);
92
+        }
93
+    }
94 94
 
95
-	public function supportedEntities(): array {
96
-		// universal by default
97
-		return [];
98
-	}
95
+    public function supportedEntities(): array {
96
+        // universal by default
97
+        return [];
98
+    }
99 99
 
100
-	public function isAvailableForScope(int $scope): bool {
101
-		// admin only by default
102
-		return $scope === IManager::SCOPE_ADMIN;
103
-	}
100
+    public function isAvailableForScope(int $scope): bool {
101
+        // admin only by default
102
+        return $scope === IManager::SCOPE_ADMIN;
103
+    }
104 104
 
105
-	/**
106
-	 * @param string $pattern
107
-	 * @param string $subject
108
-	 * @return int|bool
109
-	 */
110
-	protected function match($pattern, $subject) {
111
-		$patternHash = md5($pattern);
112
-		$subjectHash = md5($subject);
113
-		if (isset($this->matches[$patternHash][$subjectHash])) {
114
-			return $this->matches[$patternHash][$subjectHash];
115
-		}
116
-		if (!isset($this->matches[$patternHash])) {
117
-			$this->matches[$patternHash] = [];
118
-		}
119
-		$this->matches[$patternHash][$subjectHash] = preg_match($pattern, $subject);
120
-		return $this->matches[$patternHash][$subjectHash];
121
-	}
105
+    /**
106
+     * @param string $pattern
107
+     * @param string $subject
108
+     * @return int|bool
109
+     */
110
+    protected function match($pattern, $subject) {
111
+        $patternHash = md5($pattern);
112
+        $subjectHash = md5($subject);
113
+        if (isset($this->matches[$patternHash][$subjectHash])) {
114
+            return $this->matches[$patternHash][$subjectHash];
115
+        }
116
+        if (!isset($this->matches[$patternHash])) {
117
+            $this->matches[$patternHash] = [];
118
+        }
119
+        $this->matches[$patternHash][$subjectHash] = preg_match($pattern, $subject);
120
+        return $this->matches[$patternHash][$subjectHash];
121
+    }
122 122
 }
Please login to merge, or discard this patch.