Completed
Push — master ( 038d94...a8369c )
by
unknown
27:17
created
apps/files/lib/Activity/Filter/Favorites.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
 		}
139 139
 		foreach ($favorites['folders'] as $favorite) {
140 140
 			$limitations[] = $query->expr()->like('file', $query->createNamedParameter(
141
-				$this->db->escapeLikeParameter($favorite . '/') . '%'
141
+				$this->db->escapeLikeParameter($favorite.'/').'%'
142 142
 			));
143 143
 		}
144 144
 
@@ -148,9 +148,9 @@  discard block
 block discarded – undo
148 148
 
149 149
 		$function = $query->createFunction('
150 150
 			CASE 
151
-				WHEN ' . $query->getColumnName('app') . ' <> ' . $query->createNamedParameter('files') . ' THEN 1
152
-				WHEN ' . $query->getColumnName('app') . ' = ' . $query->createNamedParameter('files') . '
153
-					AND (' . implode(' OR ', $limitations) . ')
151
+				WHEN ' . $query->getColumnName('app').' <> '.$query->createNamedParameter('files').' THEN 1
152
+				WHEN ' . $query->getColumnName('app').' = '.$query->createNamedParameter('files').'
153
+					AND (' . implode(' OR ', $limitations).')
154 154
 					THEN 1 
155 155
 			END = 1'
156 156
 		);
Please login to merge, or discard this patch.
Indentation   +104 added lines, -104 removed lines patch added patch discarded remove patch
@@ -16,115 +16,115 @@
 block discarded – undo
16 16
 
17 17
 class Favorites implements IFilter {
18 18
 
19
-	/**
20
-	 * @param IL10N $l
21
-	 * @param IURLGenerator $url
22
-	 * @param IManager $activityManager
23
-	 * @param Helper $helper
24
-	 * @param IDBConnection $db
25
-	 */
26
-	public function __construct(
27
-		protected IL10N $l,
28
-		protected IURLGenerator $url,
29
-		protected IManager $activityManager,
30
-		protected Helper $helper,
31
-		protected IDBConnection $db,
32
-	) {
33
-	}
34
-
35
-	/**
36
-	 * @return string Lowercase a-z only identifier
37
-	 * @since 11.0.0
38
-	 */
39
-	public function getIdentifier() {
40
-		return 'files_favorites';
41
-	}
42
-
43
-	/**
44
-	 * @return string A translated string
45
-	 * @since 11.0.0
46
-	 */
47
-	public function getName() {
48
-		return $this->l->t('Favorites');
49
-	}
50
-
51
-	/**
52
-	 * @return int
53
-	 * @since 11.0.0
54
-	 */
55
-	public function getPriority() {
56
-		return 10;
57
-	}
58
-
59
-	/**
60
-	 * @return string Full URL to an icon, empty string when none is given
61
-	 * @since 11.0.0
62
-	 */
63
-	public function getIcon() {
64
-		return $this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/star-dark.svg'));
65
-	}
66
-
67
-	/**
68
-	 * @param string[] $types
69
-	 * @return string[] An array of allowed apps from which activities should be displayed
70
-	 * @since 11.0.0
71
-	 */
72
-	public function filterTypes(array $types) {
73
-		return array_intersect([
74
-			'file_created',
75
-			'file_changed',
76
-			'file_deleted',
77
-			'file_restored',
78
-		], $types);
79
-	}
80
-
81
-	/**
82
-	 * @return string[] An array of allowed apps from which activities should be displayed
83
-	 * @since 11.0.0
84
-	 */
85
-	public function allowedApps() {
86
-		return ['files'];
87
-	}
88
-
89
-	/**
90
-	 * @param IQueryBuilder $query
91
-	 */
92
-	public function filterFavorites(IQueryBuilder $query) {
93
-		try {
94
-			$user = $this->activityManager->getCurrentUserId();
95
-		} catch (\UnexpectedValueException $e) {
96
-			return;
97
-		}
98
-
99
-		try {
100
-			$favorites = $this->helper->getFavoriteFilePaths($user);
101
-		} catch (\RuntimeException $e) {
102
-			return;
103
-		}
104
-
105
-		$limitations = [];
106
-		if (!empty($favorites['items'])) {
107
-			$limitations[] = $query->expr()->in('file', $query->createNamedParameter($favorites['items'], IQueryBuilder::PARAM_STR_ARRAY));
108
-		}
109
-		foreach ($favorites['folders'] as $favorite) {
110
-			$limitations[] = $query->expr()->like('file', $query->createNamedParameter(
111
-				$this->db->escapeLikeParameter($favorite . '/') . '%'
112
-			));
113
-		}
114
-
115
-		if (empty($limitations)) {
116
-			return;
117
-		}
118
-
119
-		$function = $query->createFunction('
19
+    /**
20
+     * @param IL10N $l
21
+     * @param IURLGenerator $url
22
+     * @param IManager $activityManager
23
+     * @param Helper $helper
24
+     * @param IDBConnection $db
25
+     */
26
+    public function __construct(
27
+        protected IL10N $l,
28
+        protected IURLGenerator $url,
29
+        protected IManager $activityManager,
30
+        protected Helper $helper,
31
+        protected IDBConnection $db,
32
+    ) {
33
+    }
34
+
35
+    /**
36
+     * @return string Lowercase a-z only identifier
37
+     * @since 11.0.0
38
+     */
39
+    public function getIdentifier() {
40
+        return 'files_favorites';
41
+    }
42
+
43
+    /**
44
+     * @return string A translated string
45
+     * @since 11.0.0
46
+     */
47
+    public function getName() {
48
+        return $this->l->t('Favorites');
49
+    }
50
+
51
+    /**
52
+     * @return int
53
+     * @since 11.0.0
54
+     */
55
+    public function getPriority() {
56
+        return 10;
57
+    }
58
+
59
+    /**
60
+     * @return string Full URL to an icon, empty string when none is given
61
+     * @since 11.0.0
62
+     */
63
+    public function getIcon() {
64
+        return $this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/star-dark.svg'));
65
+    }
66
+
67
+    /**
68
+     * @param string[] $types
69
+     * @return string[] An array of allowed apps from which activities should be displayed
70
+     * @since 11.0.0
71
+     */
72
+    public function filterTypes(array $types) {
73
+        return array_intersect([
74
+            'file_created',
75
+            'file_changed',
76
+            'file_deleted',
77
+            'file_restored',
78
+        ], $types);
79
+    }
80
+
81
+    /**
82
+     * @return string[] An array of allowed apps from which activities should be displayed
83
+     * @since 11.0.0
84
+     */
85
+    public function allowedApps() {
86
+        return ['files'];
87
+    }
88
+
89
+    /**
90
+     * @param IQueryBuilder $query
91
+     */
92
+    public function filterFavorites(IQueryBuilder $query) {
93
+        try {
94
+            $user = $this->activityManager->getCurrentUserId();
95
+        } catch (\UnexpectedValueException $e) {
96
+            return;
97
+        }
98
+
99
+        try {
100
+            $favorites = $this->helper->getFavoriteFilePaths($user);
101
+        } catch (\RuntimeException $e) {
102
+            return;
103
+        }
104
+
105
+        $limitations = [];
106
+        if (!empty($favorites['items'])) {
107
+            $limitations[] = $query->expr()->in('file', $query->createNamedParameter($favorites['items'], IQueryBuilder::PARAM_STR_ARRAY));
108
+        }
109
+        foreach ($favorites['folders'] as $favorite) {
110
+            $limitations[] = $query->expr()->like('file', $query->createNamedParameter(
111
+                $this->db->escapeLikeParameter($favorite . '/') . '%'
112
+            ));
113
+        }
114
+
115
+        if (empty($limitations)) {
116
+            return;
117
+        }
118
+
119
+        $function = $query->createFunction('
120 120
 			CASE 
121 121
 				WHEN ' . $query->getColumnName('app') . ' <> ' . $query->createNamedParameter('files') . ' THEN 1
122 122
 				WHEN ' . $query->getColumnName('app') . ' = ' . $query->createNamedParameter('files') . '
123 123
 					AND (' . implode(' OR ', $limitations) . ')
124 124
 					THEN 1 
125 125
 			END = 1'
126
-		);
126
+        );
127 127
 
128
-		$query->andWhere($function);
129
-	}
128
+        $query->andWhere($function);
129
+    }
130 130
 }
Please login to merge, or discard this patch.
apps/files_external/lib/Service/ImportLegacyStoragesService.php 1 patch
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -24,25 +24,25 @@
 block discarded – undo
24 24
 namespace OCA\Files_External\Service;
25 25
 
26 26
 class ImportLegacyStoragesService extends LegacyStoragesService {
27
-	private $data;
27
+    private $data;
28 28
 
29
-	/**
30
-	 * @param BackendService $backendService
31
-	 */
32
-	public function __construct(BackendService $backendService) {
33
-		$this->backendService = $backendService;
34
-	}
29
+    /**
30
+     * @param BackendService $backendService
31
+     */
32
+    public function __construct(BackendService $backendService) {
33
+        $this->backendService = $backendService;
34
+    }
35 35
 
36
-	public function setData($data) {
37
-		$this->data = $data;
38
-	}
36
+    public function setData($data) {
37
+        $this->data = $data;
38
+    }
39 39
 
40
-	/**
41
-	 * Read legacy config data
42
-	 *
43
-	 * @return array list of mount configs
44
-	 */
45
-	protected function readLegacyConfig() {
46
-		return $this->data;
47
-	}
40
+    /**
41
+     * Read legacy config data
42
+     *
43
+     * @return array list of mount configs
44
+     */
45
+    protected function readLegacyConfig() {
46
+        return $this->data;
47
+    }
48 48
 }
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.
apps/files_external/lib/Lib/Config/IAuthMechanismProvider.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 IAuthMechanismProvider {
32 32
 
33
-	/**
34
-	 * @since 9.1.0
35
-	 * @return AuthMechanism[]
36
-	 */
37
-	public function getAuthMechanisms();
33
+    /**
34
+     * @since 9.1.0
35
+     * @return AuthMechanism[]
36
+     */
37
+    public function getAuthMechanisms();
38 38
 
39 39
 }
Please login to merge, or discard this patch.
apps/files_external/lib/Lib/Notify/SMBNotifyHandler.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@
 block discarded – undo
64 64
 
65 65
 	public function listen(callable $callback) {
66 66
 		$oldRenamePath = null;
67
-		$this->shareNotifyHandler->listen(function (\Icewind\SMB\Change $shareChange) use ($callback) {
67
+		$this->shareNotifyHandler->listen(function(\Icewind\SMB\Change $shareChange) use ($callback) {
68 68
 			$change = $this->mapChange($shareChange);
69 69
 			if (!is_null($change)) {
70 70
 				return $callback($change);
Please login to merge, or discard this patch.
Indentation   +107 added lines, -107 removed lines patch added patch discarded remove patch
@@ -11,119 +11,119 @@
 block discarded – undo
11 11
 use OCP\Files\Notify\INotifyHandler;
12 12
 
13 13
 class SMBNotifyHandler implements INotifyHandler {
14
-	/**
15
-	 * @var string
16
-	 */
17
-	private $root;
14
+    /**
15
+     * @var string
16
+     */
17
+    private $root;
18 18
 
19
-	private $oldRenamePath = null;
19
+    private $oldRenamePath = null;
20 20
 
21
-	/**
22
-	 * SMBNotifyHandler constructor.
23
-	 *
24
-	 * @param \Icewind\SMB\INotifyHandler $shareNotifyHandler
25
-	 * @param string $root
26
-	 */
27
-	public function __construct(
28
-		private \Icewind\SMB\INotifyHandler $shareNotifyHandler,
29
-		$root,
30
-	) {
31
-		$this->root = str_replace('\\', '/', $root);
32
-	}
21
+    /**
22
+     * SMBNotifyHandler constructor.
23
+     *
24
+     * @param \Icewind\SMB\INotifyHandler $shareNotifyHandler
25
+     * @param string $root
26
+     */
27
+    public function __construct(
28
+        private \Icewind\SMB\INotifyHandler $shareNotifyHandler,
29
+        $root,
30
+    ) {
31
+        $this->root = str_replace('\\', '/', $root);
32
+    }
33 33
 
34
-	private function relativePath($fullPath) {
35
-		if ($fullPath === $this->root) {
36
-			return '';
37
-		} elseif (substr($fullPath, 0, strlen($this->root)) === $this->root) {
38
-			return substr($fullPath, strlen($this->root));
39
-		} else {
40
-			return null;
41
-		}
42
-	}
34
+    private function relativePath($fullPath) {
35
+        if ($fullPath === $this->root) {
36
+            return '';
37
+        } elseif (substr($fullPath, 0, strlen($this->root)) === $this->root) {
38
+            return substr($fullPath, strlen($this->root));
39
+        } else {
40
+            return null;
41
+        }
42
+    }
43 43
 
44
-	public function listen(callable $callback) {
45
-		$oldRenamePath = null;
46
-		$this->shareNotifyHandler->listen(function (\Icewind\SMB\Change $shareChange) use ($callback) {
47
-			$change = $this->mapChange($shareChange);
48
-			if (!is_null($change)) {
49
-				return $callback($change);
50
-			} else {
51
-				return true;
52
-			}
53
-		});
54
-	}
44
+    public function listen(callable $callback) {
45
+        $oldRenamePath = null;
46
+        $this->shareNotifyHandler->listen(function (\Icewind\SMB\Change $shareChange) use ($callback) {
47
+            $change = $this->mapChange($shareChange);
48
+            if (!is_null($change)) {
49
+                return $callback($change);
50
+            } else {
51
+                return true;
52
+            }
53
+        });
54
+    }
55 55
 
56
-	/**
57
-	 * Get all changes detected since the start of the notify process or the last call to getChanges
58
-	 *
59
-	 * @return IChange[]
60
-	 */
61
-	public function getChanges() {
62
-		$shareChanges = $this->shareNotifyHandler->getChanges();
63
-		$changes = [];
64
-		foreach ($shareChanges as $shareChange) {
65
-			$change = $this->mapChange($shareChange);
66
-			if ($change) {
67
-				$changes[] = $change;
68
-			}
69
-		}
70
-		return $changes;
71
-	}
56
+    /**
57
+     * Get all changes detected since the start of the notify process or the last call to getChanges
58
+     *
59
+     * @return IChange[]
60
+     */
61
+    public function getChanges() {
62
+        $shareChanges = $this->shareNotifyHandler->getChanges();
63
+        $changes = [];
64
+        foreach ($shareChanges as $shareChange) {
65
+            $change = $this->mapChange($shareChange);
66
+            if ($change) {
67
+                $changes[] = $change;
68
+            }
69
+        }
70
+        return $changes;
71
+    }
72 72
 
73
-	/**
74
-	 * Stop listening for changes
75
-	 *
76
-	 * Note that any pending changes will be discarded
77
-	 */
78
-	public function stop() {
79
-		$this->shareNotifyHandler->stop();
80
-	}
73
+    /**
74
+     * Stop listening for changes
75
+     *
76
+     * Note that any pending changes will be discarded
77
+     */
78
+    public function stop() {
79
+        $this->shareNotifyHandler->stop();
80
+    }
81 81
 
82
-	/**
83
-	 * @param \Icewind\SMB\Change $change
84
-	 * @return IChange|null
85
-	 */
86
-	private function mapChange(\Icewind\SMB\Change $change) {
87
-		$path = $this->relativePath($change->getPath());
88
-		if (is_null($path)) {
89
-			return null;
90
-		}
91
-		if ($change->getCode() === \Icewind\SMB\INotifyHandler::NOTIFY_RENAMED_OLD) {
92
-			$this->oldRenamePath = $path;
93
-			return null;
94
-		}
95
-		$type = $this->mapNotifyType($change->getCode());
96
-		if (is_null($type)) {
97
-			return null;
98
-		}
99
-		if ($type === IChange::RENAMED) {
100
-			if (!is_null($this->oldRenamePath)) {
101
-				$result = new RenameChange($type, $this->oldRenamePath, $path);
102
-				$this->oldRenamePath = null;
103
-			} else {
104
-				$result = null;
105
-			}
106
-		} else {
107
-			$result = new Change($type, $path);
108
-		}
109
-		return $result;
110
-	}
82
+    /**
83
+     * @param \Icewind\SMB\Change $change
84
+     * @return IChange|null
85
+     */
86
+    private function mapChange(\Icewind\SMB\Change $change) {
87
+        $path = $this->relativePath($change->getPath());
88
+        if (is_null($path)) {
89
+            return null;
90
+        }
91
+        if ($change->getCode() === \Icewind\SMB\INotifyHandler::NOTIFY_RENAMED_OLD) {
92
+            $this->oldRenamePath = $path;
93
+            return null;
94
+        }
95
+        $type = $this->mapNotifyType($change->getCode());
96
+        if (is_null($type)) {
97
+            return null;
98
+        }
99
+        if ($type === IChange::RENAMED) {
100
+            if (!is_null($this->oldRenamePath)) {
101
+                $result = new RenameChange($type, $this->oldRenamePath, $path);
102
+                $this->oldRenamePath = null;
103
+            } else {
104
+                $result = null;
105
+            }
106
+        } else {
107
+            $result = new Change($type, $path);
108
+        }
109
+        return $result;
110
+    }
111 111
 
112
-	private function mapNotifyType($smbType) {
113
-		switch ($smbType) {
114
-			case \Icewind\SMB\INotifyHandler::NOTIFY_ADDED:
115
-				return IChange::ADDED;
116
-			case \Icewind\SMB\INotifyHandler::NOTIFY_REMOVED:
117
-				return IChange::REMOVED;
118
-			case \Icewind\SMB\INotifyHandler::NOTIFY_MODIFIED:
119
-			case \Icewind\SMB\INotifyHandler::NOTIFY_ADDED_STREAM:
120
-			case \Icewind\SMB\INotifyHandler::NOTIFY_MODIFIED_STREAM:
121
-			case \Icewind\SMB\INotifyHandler::NOTIFY_REMOVED_STREAM:
122
-				return IChange::MODIFIED;
123
-			case \Icewind\SMB\INotifyHandler::NOTIFY_RENAMED_NEW:
124
-				return IChange::RENAMED;
125
-			default:
126
-				return null;
127
-		}
128
-	}
112
+    private function mapNotifyType($smbType) {
113
+        switch ($smbType) {
114
+            case \Icewind\SMB\INotifyHandler::NOTIFY_ADDED:
115
+                return IChange::ADDED;
116
+            case \Icewind\SMB\INotifyHandler::NOTIFY_REMOVED:
117
+                return IChange::REMOVED;
118
+            case \Icewind\SMB\INotifyHandler::NOTIFY_MODIFIED:
119
+            case \Icewind\SMB\INotifyHandler::NOTIFY_ADDED_STREAM:
120
+            case \Icewind\SMB\INotifyHandler::NOTIFY_MODIFIED_STREAM:
121
+            case \Icewind\SMB\INotifyHandler::NOTIFY_REMOVED_STREAM:
122
+                return IChange::MODIFIED;
123
+            case \Icewind\SMB\INotifyHandler::NOTIFY_RENAMED_NEW:
124
+                return IChange::RENAMED;
125
+            default:
126
+                return null;
127
+        }
128
+    }
129 129
 }
Please login to merge, or discard this patch.
apps/files_external/lib/Lib/DependencyTrait.php 1 patch
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -29,14 +29,14 @@
 block discarded – undo
29 29
  */
30 30
 trait DependencyTrait {
31 31
 
32
-	/**
33
-	 * Check if object is valid for use
34
-	 *
35
-	 * @return MissingDependency[] Unsatisfied dependencies
36
-	 */
37
-	public function checkDependencies() {
38
-		return []; // no dependencies by default
39
-	}
32
+    /**
33
+     * Check if object is valid for use
34
+     *
35
+     * @return MissingDependency[] Unsatisfied dependencies
36
+     */
37
+    public function checkDependencies() {
38
+        return []; // no dependencies by default
39
+    }
40 40
 
41 41
 }
42 42
 
Please login to merge, or discard this patch.
apps/files_sharing/lib/External/Watcher.php 1 patch
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -23,12 +23,12 @@
 block discarded – undo
23 23
 namespace OCA\Files_Sharing\External;
24 24
 
25 25
 class Watcher extends \OC\Files\Cache\Watcher {
26
-	/**
27
-	 * remove deleted files in $path from the cache
28
-	 *
29
-	 * @param string $path
30
-	 */
31
-	public function cleanFolder($path) {
32
-		// not needed, the scanner takes care of this
33
-	}
26
+    /**
27
+     * remove deleted files in $path from the cache
28
+     *
29
+     * @param string $path
30
+     */
31
+    public function cleanFolder($path) {
32
+        // not needed, the scanner takes care of this
33
+    }
34 34
 }
Please login to merge, or discard this patch.
apps/twofactor_backupcodes/lib/Db/BackupCode.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -34,13 +34,13 @@
 block discarded – undo
34 34
  */
35 35
 class BackupCode extends Entity {
36 36
 
37
-	/** @var string */
38
-	protected $userId;
37
+    /** @var string */
38
+    protected $userId;
39 39
 
40
-	/** @var string */
41
-	protected $code;
40
+    /** @var string */
41
+    protected $code;
42 42
 
43
-	/** @var int */
44
-	protected $used;
43
+    /** @var int */
44
+    protected $used;
45 45
 
46 46
 }
Please login to merge, or discard this patch.