Passed
Push — master ( b67ac4...89cf1c )
by Joas
15:14 queued 12s
created
apps/dav/lib/Migration/RemoveClassifiedEventActivity.php 1 patch
Indentation   +100 added lines, -100 removed lines patch added patch discarded remove patch
@@ -29,104 +29,104 @@
 block discarded – undo
29 29
 
30 30
 class RemoveClassifiedEventActivity implements IRepairStep {
31 31
 
32
-	/** @var IDBConnection */
33
-	private $connection;
34
-
35
-	public function __construct(IDBConnection $connection) {
36
-		$this->connection = $connection;
37
-	}
38
-
39
-	/**
40
-	 * @inheritdoc
41
-	 */
42
-	public function getName() {
43
-		return 'Remove activity entries of private events';
44
-	}
45
-
46
-	/**
47
-	 * @inheritdoc
48
-	 */
49
-	public function run(IOutput $output) {
50
-		if (!$this->connection->tableExists('activity')) {
51
-			return;
52
-		}
53
-
54
-		$deletedEvents = $this->removePrivateEventActivity();
55
-		$deletedEvents += $this->removeConfidentialUncensoredEventActivity();
56
-
57
-		$output->info("Removed $deletedEvents activity entries");
58
-	}
59
-
60
-	protected function removePrivateEventActivity(): int {
61
-		$deletedEvents = 0;
62
-
63
-		$delete = $this->connection->getQueryBuilder();
64
-		$delete->delete('activity')
65
-			->where($delete->expr()->neq('affecteduser', $delete->createParameter('owner')))
66
-			->andWhere($delete->expr()->eq('object_type', $delete->createParameter('type')))
67
-			->andWhere($delete->expr()->eq('object_id', $delete->createParameter('calendar_id')))
68
-			->andWhere($delete->expr()->like('subjectparams', $delete->createParameter('event_uid')));
69
-
70
-		$query = $this->connection->getQueryBuilder();
71
-		$query->select('c.principaluri', 'o.calendarid', 'o.uid')
72
-			->from('calendarobjects', 'o')
73
-			->leftJoin('o', 'calendars', 'c', $query->expr()->eq('c.id', 'o.calendarid'))
74
-			->where($query->expr()->eq('o.classification', $query->createNamedParameter(CalDavBackend::CLASSIFICATION_PRIVATE)));
75
-		$result = $query->execute();
76
-
77
-		while ($row = $result->fetch()) {
78
-			if ($row['principaluri'] === null) {
79
-				continue;
80
-			}
81
-
82
-			$delete->setParameter('owner', $this->getPrincipal($row['principaluri']))
83
-				->setParameter('type', 'calendar')
84
-				->setParameter('calendar_id', $row['calendarid'])
85
-				->setParameter('event_uid', '%' . $this->connection->escapeLikeParameter('{"id":"' . $row['uid'] . '"') . '%');
86
-			$deletedEvents += $delete->execute();
87
-		}
88
-		$result->closeCursor();
89
-
90
-		return $deletedEvents;
91
-	}
92
-
93
-	protected function removeConfidentialUncensoredEventActivity(): int {
94
-		$deletedEvents = 0;
95
-
96
-		$delete = $this->connection->getQueryBuilder();
97
-		$delete->delete('activity')
98
-			->where($delete->expr()->neq('affecteduser', $delete->createParameter('owner')))
99
-			->andWhere($delete->expr()->eq('object_type', $delete->createParameter('type')))
100
-			->andWhere($delete->expr()->eq('object_id', $delete->createParameter('calendar_id')))
101
-			->andWhere($delete->expr()->like('subjectparams', $delete->createParameter('event_uid')))
102
-			->andWhere($delete->expr()->notLike('subjectparams', $delete->createParameter('filtered_name')));
103
-
104
-		$query = $this->connection->getQueryBuilder();
105
-		$query->select('c.principaluri', 'o.calendarid', 'o.uid')
106
-			->from('calendarobjects', 'o')
107
-			->leftJoin('o', 'calendars', 'c', $query->expr()->eq('c.id', 'o.calendarid'))
108
-			->where($query->expr()->eq('o.classification', $query->createNamedParameter(CalDavBackend::CLASSIFICATION_CONFIDENTIAL)));
109
-		$result = $query->execute();
110
-
111
-		while ($row = $result->fetch()) {
112
-			if ($row['principaluri'] === null) {
113
-				continue;
114
-			}
115
-
116
-			$delete->setParameter('owner', $this->getPrincipal($row['principaluri']))
117
-				->setParameter('type', 'calendar')
118
-				->setParameter('calendar_id', $row['calendarid'])
119
-				->setParameter('event_uid', '%' . $this->connection->escapeLikeParameter('{"id":"' . $row['uid'] . '"') . '%')
120
-				->setParameter('filtered_name', '%' . $this->connection->escapeLikeParameter('{"id":"' . $row['uid'] . '","name":"Busy"') . '%');
121
-			$deletedEvents += $delete->execute();
122
-		}
123
-		$result->closeCursor();
124
-
125
-		return $deletedEvents;
126
-	}
127
-
128
-	protected function getPrincipal(string $principalUri): string {
129
-		$uri = explode('/', $principalUri);
130
-		return array_pop($uri);
131
-	}
32
+    /** @var IDBConnection */
33
+    private $connection;
34
+
35
+    public function __construct(IDBConnection $connection) {
36
+        $this->connection = $connection;
37
+    }
38
+
39
+    /**
40
+     * @inheritdoc
41
+     */
42
+    public function getName() {
43
+        return 'Remove activity entries of private events';
44
+    }
45
+
46
+    /**
47
+     * @inheritdoc
48
+     */
49
+    public function run(IOutput $output) {
50
+        if (!$this->connection->tableExists('activity')) {
51
+            return;
52
+        }
53
+
54
+        $deletedEvents = $this->removePrivateEventActivity();
55
+        $deletedEvents += $this->removeConfidentialUncensoredEventActivity();
56
+
57
+        $output->info("Removed $deletedEvents activity entries");
58
+    }
59
+
60
+    protected function removePrivateEventActivity(): int {
61
+        $deletedEvents = 0;
62
+
63
+        $delete = $this->connection->getQueryBuilder();
64
+        $delete->delete('activity')
65
+            ->where($delete->expr()->neq('affecteduser', $delete->createParameter('owner')))
66
+            ->andWhere($delete->expr()->eq('object_type', $delete->createParameter('type')))
67
+            ->andWhere($delete->expr()->eq('object_id', $delete->createParameter('calendar_id')))
68
+            ->andWhere($delete->expr()->like('subjectparams', $delete->createParameter('event_uid')));
69
+
70
+        $query = $this->connection->getQueryBuilder();
71
+        $query->select('c.principaluri', 'o.calendarid', 'o.uid')
72
+            ->from('calendarobjects', 'o')
73
+            ->leftJoin('o', 'calendars', 'c', $query->expr()->eq('c.id', 'o.calendarid'))
74
+            ->where($query->expr()->eq('o.classification', $query->createNamedParameter(CalDavBackend::CLASSIFICATION_PRIVATE)));
75
+        $result = $query->execute();
76
+
77
+        while ($row = $result->fetch()) {
78
+            if ($row['principaluri'] === null) {
79
+                continue;
80
+            }
81
+
82
+            $delete->setParameter('owner', $this->getPrincipal($row['principaluri']))
83
+                ->setParameter('type', 'calendar')
84
+                ->setParameter('calendar_id', $row['calendarid'])
85
+                ->setParameter('event_uid', '%' . $this->connection->escapeLikeParameter('{"id":"' . $row['uid'] . '"') . '%');
86
+            $deletedEvents += $delete->execute();
87
+        }
88
+        $result->closeCursor();
89
+
90
+        return $deletedEvents;
91
+    }
92
+
93
+    protected function removeConfidentialUncensoredEventActivity(): int {
94
+        $deletedEvents = 0;
95
+
96
+        $delete = $this->connection->getQueryBuilder();
97
+        $delete->delete('activity')
98
+            ->where($delete->expr()->neq('affecteduser', $delete->createParameter('owner')))
99
+            ->andWhere($delete->expr()->eq('object_type', $delete->createParameter('type')))
100
+            ->andWhere($delete->expr()->eq('object_id', $delete->createParameter('calendar_id')))
101
+            ->andWhere($delete->expr()->like('subjectparams', $delete->createParameter('event_uid')))
102
+            ->andWhere($delete->expr()->notLike('subjectparams', $delete->createParameter('filtered_name')));
103
+
104
+        $query = $this->connection->getQueryBuilder();
105
+        $query->select('c.principaluri', 'o.calendarid', 'o.uid')
106
+            ->from('calendarobjects', 'o')
107
+            ->leftJoin('o', 'calendars', 'c', $query->expr()->eq('c.id', 'o.calendarid'))
108
+            ->where($query->expr()->eq('o.classification', $query->createNamedParameter(CalDavBackend::CLASSIFICATION_CONFIDENTIAL)));
109
+        $result = $query->execute();
110
+
111
+        while ($row = $result->fetch()) {
112
+            if ($row['principaluri'] === null) {
113
+                continue;
114
+            }
115
+
116
+            $delete->setParameter('owner', $this->getPrincipal($row['principaluri']))
117
+                ->setParameter('type', 'calendar')
118
+                ->setParameter('calendar_id', $row['calendarid'])
119
+                ->setParameter('event_uid', '%' . $this->connection->escapeLikeParameter('{"id":"' . $row['uid'] . '"') . '%')
120
+                ->setParameter('filtered_name', '%' . $this->connection->escapeLikeParameter('{"id":"' . $row['uid'] . '","name":"Busy"') . '%');
121
+            $deletedEvents += $delete->execute();
122
+        }
123
+        $result->closeCursor();
124
+
125
+        return $deletedEvents;
126
+    }
127
+
128
+    protected function getPrincipal(string $principalUri): string {
129
+        $uri = explode('/', $principalUri);
130
+        return array_pop($uri);
131
+    }
132 132
 }
Please login to merge, or discard this patch.
lib/public/Group/ISubAdmin.php 1 patch
Indentation   +58 added lines, -58 removed lines patch added patch discarded remove patch
@@ -32,68 +32,68 @@
 block discarded – undo
32 32
  */
33 33
 interface ISubAdmin {
34 34
 
35
-	/**
36
-	 * add a SubAdmin
37
-	 * @param IUser $user user to be SubAdmin
38
-	 * @param IGroup $group group $user becomes subadmin of
39
-	 *
40
-	 * @since 16.0.0
41
-	 */
42
-	public function createSubAdmin(IUser $user, IGroup $group): void;
35
+    /**
36
+     * add a SubAdmin
37
+     * @param IUser $user user to be SubAdmin
38
+     * @param IGroup $group group $user becomes subadmin of
39
+     *
40
+     * @since 16.0.0
41
+     */
42
+    public function createSubAdmin(IUser $user, IGroup $group): void;
43 43
 
44
-	/**
45
-	 * delete a SubAdmin
46
-	 * @param IUser $user the user that is the SubAdmin
47
-	 * @param IGroup $group the group
48
-	 *
49
-	 * @since 16.0.0
50
-	 */
51
-	public function deleteSubAdmin(IUser $user, IGroup $group): void;
44
+    /**
45
+     * delete a SubAdmin
46
+     * @param IUser $user the user that is the SubAdmin
47
+     * @param IGroup $group the group
48
+     *
49
+     * @since 16.0.0
50
+     */
51
+    public function deleteSubAdmin(IUser $user, IGroup $group): void;
52 52
 
53
-	/**
54
-	 * get groups of a SubAdmin
55
-	 * @param IUser $user the SubAdmin
56
-	 * @return IGroup[]
57
-	 *
58
-	 * @since 16.0.0
59
-	 */
60
-	public function getSubAdminsGroups(IUser $user): array;
53
+    /**
54
+     * get groups of a SubAdmin
55
+     * @param IUser $user the SubAdmin
56
+     * @return IGroup[]
57
+     *
58
+     * @since 16.0.0
59
+     */
60
+    public function getSubAdminsGroups(IUser $user): array;
61 61
 
62
-	/**
63
-	 * get SubAdmins of a group
64
-	 * @param IGroup $group the group
65
-	 * @return IUser[]
66
-	 *
67
-	 * @since 16.0.0
68
-	 */
69
-	public function getGroupsSubAdmins(IGroup $group): array;
62
+    /**
63
+     * get SubAdmins of a group
64
+     * @param IGroup $group the group
65
+     * @return IUser[]
66
+     *
67
+     * @since 16.0.0
68
+     */
69
+    public function getGroupsSubAdmins(IGroup $group): array;
70 70
 
71
-	/**
72
-	 * checks if a user is a SubAdmin of a group
73
-	 * @param IUser $user
74
-	 * @param IGroup $group
75
-	 * @return bool
76
-	 *
77
-	 * @since 16.0.0
78
-	 */
79
-	public function isSubAdminOfGroup(IUser $user, IGroup $group): bool;
71
+    /**
72
+     * checks if a user is a SubAdmin of a group
73
+     * @param IUser $user
74
+     * @param IGroup $group
75
+     * @return bool
76
+     *
77
+     * @since 16.0.0
78
+     */
79
+    public function isSubAdminOfGroup(IUser $user, IGroup $group): bool;
80 80
 
81
-	/**
82
-	 * checks if a user is a SubAdmin
83
-	 * @param IUser $user
84
-	 * @return bool
85
-	 *
86
-	 * @since 16.0.0
87
-	 */
88
-	public function isSubAdmin(IUser $user): bool;
81
+    /**
82
+     * checks if a user is a SubAdmin
83
+     * @param IUser $user
84
+     * @return bool
85
+     *
86
+     * @since 16.0.0
87
+     */
88
+    public function isSubAdmin(IUser $user): bool;
89 89
 
90
-	/**
91
-	 * checks if a user is a accessible by a subadmin
92
-	 * @param IUser $subadmin
93
-	 * @param IUser $user
94
-	 * @return bool
95
-	 *
96
-	 * @since 16.0.0
97
-	 */
98
-	public function isUserAccessible(IUser $subadmin, IUser $user): bool;
90
+    /**
91
+     * checks if a user is a accessible by a subadmin
92
+     * @param IUser $subadmin
93
+     * @param IUser $user
94
+     * @return bool
95
+     *
96
+     * @since 16.0.0
97
+     */
98
+    public function isUserAccessible(IUser $subadmin, IUser $user): bool;
99 99
 }
Please login to merge, or discard this patch.
apps/twofactor_backupcodes/lib/Settings/Personal.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -28,8 +28,8 @@
 block discarded – undo
28 28
 use OCP\Template;
29 29
 
30 30
 class Personal implements IPersonalProviderSettings {
31
-	public function getBody(): Template {
32
-		return new Template('twofactor_backupcodes', 'personal');
33
-	}
31
+    public function getBody(): Template {
32
+        return new Template('twofactor_backupcodes', 'personal');
33
+    }
34 34
 
35 35
 }
Please login to merge, or discard this patch.
lib/private/AppFramework/Middleware/Security/ReloadExecutionMiddleware.php 1 patch
Indentation   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -35,34 +35,34 @@
 block discarded – undo
35 35
  * a reload but if the session variable is set we properly redirect to the login page.
36 36
  */
37 37
 class ReloadExecutionMiddleware extends Middleware {
38
-	/** @var ISession */
39
-	private $session;
40
-	/** @var IURLGenerator */
41
-	private $urlGenerator;
38
+    /** @var ISession */
39
+    private $session;
40
+    /** @var IURLGenerator */
41
+    private $urlGenerator;
42 42
 
43
-	public function __construct(ISession $session, IURLGenerator $urlGenerator) {
44
-		$this->session = $session;
45
-		$this->urlGenerator = $urlGenerator;
46
-	}
43
+    public function __construct(ISession $session, IURLGenerator $urlGenerator) {
44
+        $this->session = $session;
45
+        $this->urlGenerator = $urlGenerator;
46
+    }
47 47
 
48
-	public function beforeController($controller, $methodName) {
49
-		if ($this->session->exists('clearingExecutionContexts')) {
50
-			throw new ReloadExecutionException();
51
-		}
52
-	}
48
+    public function beforeController($controller, $methodName) {
49
+        if ($this->session->exists('clearingExecutionContexts')) {
50
+            throw new ReloadExecutionException();
51
+        }
52
+    }
53 53
 
54
-	public function afterException($controller, $methodName, \Exception $exception) {
55
-		if ($exception instanceof ReloadExecutionException) {
56
-			$this->session->remove('clearingExecutionContexts');
54
+    public function afterException($controller, $methodName, \Exception $exception) {
55
+        if ($exception instanceof ReloadExecutionException) {
56
+            $this->session->remove('clearingExecutionContexts');
57 57
 
58
-			return new RedirectResponse($this->urlGenerator->linkToRouteAbsolute(
59
-				'core.login.showLoginForm',
60
-				['clear' => true] // this param the the code in login.js may be removed when the "Clear-Site-Data" is working in the browsers
61
-			));
62
-		}
58
+            return new RedirectResponse($this->urlGenerator->linkToRouteAbsolute(
59
+                'core.login.showLoginForm',
60
+                ['clear' => true] // this param the the code in login.js may be removed when the "Clear-Site-Data" is working in the browsers
61
+            ));
62
+        }
63 63
 
64
-		return parent::afterException($controller, $methodName, $exception);
65
-	}
64
+        return parent::afterException($controller, $methodName, $exception);
65
+    }
66 66
 
67 67
 
68 68
 }
Please login to merge, or discard this patch.
lib/public/Files/SimpleFS/InMemoryFile.php 1 patch
Indentation   +115 added lines, -115 removed lines patch added patch discarded remove patch
@@ -32,119 +32,119 @@
 block discarded – undo
32 32
  * @since 16.0.0
33 33
  */
34 34
 class InMemoryFile implements ISimpleFile {
35
-	/**
36
-	 * Holds the file name.
37
-	 *
38
-	 * @var string
39
-	 */
40
-	private $name;
41
-
42
-	/**
43
-	 * Holds the file contents.
44
-	 *
45
-	 * @var string
46
-	 */
47
-	private $contents;
48
-
49
-	/**
50
-	 * InMemoryFile constructor.
51
-	 *
52
-	 * @param string $name The file name
53
-	 * @param string $contents The file contents
54
-	 * @since 16.0.0
55
-	 */
56
-	public function __construct(string $name, string $contents) {
57
-		$this->name = $name;
58
-		$this->contents = $contents;
59
-	}
60
-
61
-	/**
62
-	 * @inheritdoc
63
-	 * @since 16.0.0
64
-	 */
65
-	public function getName() {
66
-		return $this->name;
67
-	}
68
-
69
-	/**
70
-	 * @inheritdoc
71
-	 * @since 16.0.0
72
-	 */
73
-	public function getSize() {
74
-		return strlen($this->contents);
75
-	}
76
-
77
-	/**
78
-	 * @inheritdoc
79
-	 * @since 16.0.0
80
-	 */
81
-	public function getETag() {
82
-		return '';
83
-	}
84
-
85
-	/**
86
-	 * @inheritdoc
87
-	 * @since 16.0.0
88
-	 */
89
-	public function getMTime() {
90
-		return time();
91
-	}
92
-
93
-	/**
94
-	 * @inheritdoc
95
-	 * @since 16.0.0
96
-	 */
97
-	public function getContent() {
98
-		return $this->contents;
99
-	}
100
-
101
-	/**
102
-	 * @inheritdoc
103
-	 * @since 16.0.0
104
-	 */
105
-	public function putContent($data) {
106
-		$this->contents = $data;
107
-	}
108
-
109
-	/**
110
-	 * In memory files can't be deleted.
111
-	 *
112
-	 * @since 16.0.0
113
-	 */
114
-	public function delete() {
115
-		// unimplemented for in memory files
116
-	}
117
-
118
-	/**
119
-	 * @inheritdoc
120
-	 * @since 16.0.0
121
-	 */
122
-	public function getMimeType() {
123
-		$fileInfo = new \finfo(FILEINFO_MIME_TYPE);
124
-		return $fileInfo->buffer($this->contents);
125
-	}
126
-
127
-	/**
128
-	 * Stream reading is unsupported for in memory files.
129
-	 *
130
-	 * @throws NotPermittedException
131
-	 * @since 16.0.0
132
-	 */
133
-	public function read() {
134
-		throw new NotPermittedException(
135
-			'Stream reading is unsupported for in memory files'
136
-		);
137
-	}
138
-
139
-	/**
140
-	 * Stream writing isn't available for in memory files.
141
-	 *
142
-	 * @throws NotPermittedException
143
-	 * @since 16.0.0
144
-	 */
145
-	public function write() {
146
-		throw new NotPermittedException(
147
-			'Stream writing is unsupported for in memory files'
148
-		);
149
-	}
35
+    /**
36
+     * Holds the file name.
37
+     *
38
+     * @var string
39
+     */
40
+    private $name;
41
+
42
+    /**
43
+     * Holds the file contents.
44
+     *
45
+     * @var string
46
+     */
47
+    private $contents;
48
+
49
+    /**
50
+     * InMemoryFile constructor.
51
+     *
52
+     * @param string $name The file name
53
+     * @param string $contents The file contents
54
+     * @since 16.0.0
55
+     */
56
+    public function __construct(string $name, string $contents) {
57
+        $this->name = $name;
58
+        $this->contents = $contents;
59
+    }
60
+
61
+    /**
62
+     * @inheritdoc
63
+     * @since 16.0.0
64
+     */
65
+    public function getName() {
66
+        return $this->name;
67
+    }
68
+
69
+    /**
70
+     * @inheritdoc
71
+     * @since 16.0.0
72
+     */
73
+    public function getSize() {
74
+        return strlen($this->contents);
75
+    }
76
+
77
+    /**
78
+     * @inheritdoc
79
+     * @since 16.0.0
80
+     */
81
+    public function getETag() {
82
+        return '';
83
+    }
84
+
85
+    /**
86
+     * @inheritdoc
87
+     * @since 16.0.0
88
+     */
89
+    public function getMTime() {
90
+        return time();
91
+    }
92
+
93
+    /**
94
+     * @inheritdoc
95
+     * @since 16.0.0
96
+     */
97
+    public function getContent() {
98
+        return $this->contents;
99
+    }
100
+
101
+    /**
102
+     * @inheritdoc
103
+     * @since 16.0.0
104
+     */
105
+    public function putContent($data) {
106
+        $this->contents = $data;
107
+    }
108
+
109
+    /**
110
+     * In memory files can't be deleted.
111
+     *
112
+     * @since 16.0.0
113
+     */
114
+    public function delete() {
115
+        // unimplemented for in memory files
116
+    }
117
+
118
+    /**
119
+     * @inheritdoc
120
+     * @since 16.0.0
121
+     */
122
+    public function getMimeType() {
123
+        $fileInfo = new \finfo(FILEINFO_MIME_TYPE);
124
+        return $fileInfo->buffer($this->contents);
125
+    }
126
+
127
+    /**
128
+     * Stream reading is unsupported for in memory files.
129
+     *
130
+     * @throws NotPermittedException
131
+     * @since 16.0.0
132
+     */
133
+    public function read() {
134
+        throw new NotPermittedException(
135
+            'Stream reading is unsupported for in memory files'
136
+        );
137
+    }
138
+
139
+    /**
140
+     * Stream writing isn't available for in memory files.
141
+     *
142
+     * @throws NotPermittedException
143
+     * @since 16.0.0
144
+     */
145
+    public function write() {
146
+        throw new NotPermittedException(
147
+            'Stream writing is unsupported for in memory files'
148
+        );
149
+    }
150 150
 }
Please login to merge, or discard this patch.
lib/public/IAvatarManager.php 1 patch
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -34,24 +34,24 @@
 block discarded – undo
34 34
 
35 35
 interface IAvatarManager {
36 36
 
37
-	/**
38
-	 * return a user specific instance of \OCP\IAvatar
39
-	 * @see IAvatar
40
-	 * @param string $user the ownCloud user id
41
-	 * @return IAvatar
42
-	 * @throws \Exception In case the username is potentially dangerous
43
-	 * @throws \OCP\Files\NotFoundException In case there is no user folder yet
44
-	 * @since 6.0.0
45
-	 */
46
-	public function getAvatar(string $user) : IAvatar;
37
+    /**
38
+     * return a user specific instance of \OCP\IAvatar
39
+     * @see IAvatar
40
+     * @param string $user the ownCloud user id
41
+     * @return IAvatar
42
+     * @throws \Exception In case the username is potentially dangerous
43
+     * @throws \OCP\Files\NotFoundException In case there is no user folder yet
44
+     * @since 6.0.0
45
+     */
46
+    public function getAvatar(string $user) : IAvatar;
47 47
 
48
-	/**
49
-	 * Returns a guest user avatar instance.
50
-	 *
51
-	 * @param string $name The guest name, e.g. "Albert".
52
-	 * @return IAvatar
53
-	 * @since 16.0.0
54
-	 */
55
-	public function getGuestAvatar(string $name): IAvatar;
48
+    /**
49
+     * Returns a guest user avatar instance.
50
+     *
51
+     * @param string $name The guest name, e.g. "Albert".
52
+     * @return IAvatar
53
+     * @since 16.0.0
54
+     */
55
+    public function getGuestAvatar(string $name): IAvatar;
56 56
 
57 57
 }
Please login to merge, or discard this patch.
lib/private/Avatar/GuestAvatar.php 1 patch
Indentation   +78 added lines, -78 removed lines patch added patch discarded remove patch
@@ -30,90 +30,90 @@
 block discarded – undo
30 30
  * This class represents a guest user's avatar.
31 31
  */
32 32
 class GuestAvatar extends Avatar {
33
-	/**
34
-	 * Holds the guest user display name.
35
-	 *
36
-	 * @var string
37
-	 */
38
-	private $userDisplayName;
33
+    /**
34
+     * Holds the guest user display name.
35
+     *
36
+     * @var string
37
+     */
38
+    private $userDisplayName;
39 39
 
40
-	/**
41
-	 * GuestAvatar constructor.
42
-	 *
43
-	 * @param string $userDisplayName The guest user display name
44
-	 * @param ILogger $logger The logger
45
-	 */
46
-	public function __construct(string $userDisplayName, ILogger $logger) {
47
-		parent::__construct($logger);
48
-		$this->userDisplayName = $userDisplayName;
49
-	}
40
+    /**
41
+     * GuestAvatar constructor.
42
+     *
43
+     * @param string $userDisplayName The guest user display name
44
+     * @param ILogger $logger The logger
45
+     */
46
+    public function __construct(string $userDisplayName, ILogger $logger) {
47
+        parent::__construct($logger);
48
+        $this->userDisplayName = $userDisplayName;
49
+    }
50 50
 
51
-	/**
52
-	 * Tests if the user has an avatar.
53
-	 *
54
-	 * @return true Guests always have an avatar.
55
-	 */
56
-	public function exists() {
57
-		return true;
58
-	}
51
+    /**
52
+     * Tests if the user has an avatar.
53
+     *
54
+     * @return true Guests always have an avatar.
55
+     */
56
+    public function exists() {
57
+        return true;
58
+    }
59 59
 
60
-	/**
61
-	 * Returns the guest user display name.
62
-	 *
63
-	 * @return string
64
-	 */
65
-	public function getDisplayName(): string {
66
-		return $this->userDisplayName;
67
-	}
60
+    /**
61
+     * Returns the guest user display name.
62
+     *
63
+     * @return string
64
+     */
65
+    public function getDisplayName(): string {
66
+        return $this->userDisplayName;
67
+    }
68 68
 
69
-	/**
70
-	 * Setting avatars isn't implemented for guests.
71
-	 *
72
-	 * @param \OCP\IImage|resource|string $data
73
-	 * @return void
74
-	 */
75
-	public function set($data) {
76
-		// unimplemented for guest user avatars
77
-	}
69
+    /**
70
+     * Setting avatars isn't implemented for guests.
71
+     *
72
+     * @param \OCP\IImage|resource|string $data
73
+     * @return void
74
+     */
75
+    public function set($data) {
76
+        // unimplemented for guest user avatars
77
+    }
78 78
 
79
-	/**
80
-	 * Removing avatars isn't implemented for guests.
81
-	 */
82
-	public function remove() {
83
-		// unimplemented for guest user avatars
84
-	}
79
+    /**
80
+     * Removing avatars isn't implemented for guests.
81
+     */
82
+    public function remove() {
83
+        // unimplemented for guest user avatars
84
+    }
85 85
 
86
-	/**
87
-	 * Generates an avatar for the guest.
88
-	 *
89
-	 * @param int $size The desired image size.
90
-	 * @return InMemoryFile
91
-	 */
92
-	public function getFile($size) {
93
-		$avatar = $this->generateAvatar($this->userDisplayName, $size);
94
-		return new InMemoryFile('avatar.png', $avatar);
95
-	}
86
+    /**
87
+     * Generates an avatar for the guest.
88
+     *
89
+     * @param int $size The desired image size.
90
+     * @return InMemoryFile
91
+     */
92
+    public function getFile($size) {
93
+        $avatar = $this->generateAvatar($this->userDisplayName, $size);
94
+        return new InMemoryFile('avatar.png', $avatar);
95
+    }
96 96
 
97
-	/**
98
-	 * Updates the display name if changed.
99
-	 *
100
-	 * @param string $feature The changed feature
101
-	 * @param mixed $oldValue The previous value
102
-	 * @param mixed $newValue The new value
103
-	 * @return void
104
-	 */
105
-	public function userChanged($feature, $oldValue, $newValue) {
106
-		if ($feature === 'displayName') {
107
-			$this->userDisplayName = $newValue;
108
-		}
109
-	}
97
+    /**
98
+     * Updates the display name if changed.
99
+     *
100
+     * @param string $feature The changed feature
101
+     * @param mixed $oldValue The previous value
102
+     * @param mixed $newValue The new value
103
+     * @return void
104
+     */
105
+    public function userChanged($feature, $oldValue, $newValue) {
106
+        if ($feature === 'displayName') {
107
+            $this->userDisplayName = $newValue;
108
+        }
109
+    }
110 110
 
111
-	/**
112
-	 * Guests don't have custom avatars.
113
-	 *
114
-	 * @return bool
115
-	 */
116
-	public function isCustomAvatar(): bool {
117
-		return false;
118
-	}
111
+    /**
112
+     * Guests don't have custom avatars.
113
+     *
114
+     * @return bool
115
+     */
116
+    public function isCustomAvatar(): bool {
117
+        return false;
118
+    }
119 119
 }
Please login to merge, or discard this patch.
core/Controller/GuestAvatarController.php 1 patch
Indentation   +64 added lines, -64 removed lines patch added patch discarded remove patch
@@ -33,75 +33,75 @@
 block discarded – undo
33 33
  */
34 34
 class GuestAvatarController extends Controller {
35 35
 
36
-	/**
37
-	 * @var ILogger
38
-	 */
39
-	private $logger;
36
+    /**
37
+     * @var ILogger
38
+     */
39
+    private $logger;
40 40
 
41
-	/**
42
-	 * @var IAvatarManager
43
-	 */
44
-	private $avatarManager;
41
+    /**
42
+     * @var IAvatarManager
43
+     */
44
+    private $avatarManager;
45 45
 
46
-	/**
47
-	 * GuestAvatarController constructor.
48
-	 *
49
-	 * @param $appName
50
-	 * @param IRequest $request
51
-	 * @param IAvatarManager $avatarManager
52
-	 * @param ILogger $logger
53
-	 */
54
-	public function __construct(
55
-		$appName,
56
-		IRequest $request,
57
-		IAvatarManager $avatarManager,
58
-		ILogger $logger
59
-	) {
60
-		parent::__construct($appName, $request);
61
-		$this->avatarManager = $avatarManager;
62
-		$this->logger = $logger;
63
-	}
46
+    /**
47
+     * GuestAvatarController constructor.
48
+     *
49
+     * @param $appName
50
+     * @param IRequest $request
51
+     * @param IAvatarManager $avatarManager
52
+     * @param ILogger $logger
53
+     */
54
+    public function __construct(
55
+        $appName,
56
+        IRequest $request,
57
+        IAvatarManager $avatarManager,
58
+        ILogger $logger
59
+    ) {
60
+        parent::__construct($appName, $request);
61
+        $this->avatarManager = $avatarManager;
62
+        $this->logger = $logger;
63
+    }
64 64
 
65
-	/**
66
-	 * Returns a guest avatar image response.
67
-	 *
68
-	 * @PublicPage
69
-	 * @NoCSRFRequired
70
-	 *
71
-	 * @param string $guestName The guest name, e.g. "Albert"
72
-	 * @param string $size The desired avatar size, e.g. 64 for 64x64px
73
-	 * @return FileDisplayResponse|Http\Response
74
-	 */
75
-	public function getAvatar($guestName, $size) {
76
-		$size = (int) $size;
65
+    /**
66
+     * Returns a guest avatar image response.
67
+     *
68
+     * @PublicPage
69
+     * @NoCSRFRequired
70
+     *
71
+     * @param string $guestName The guest name, e.g. "Albert"
72
+     * @param string $size The desired avatar size, e.g. 64 for 64x64px
73
+     * @return FileDisplayResponse|Http\Response
74
+     */
75
+    public function getAvatar($guestName, $size) {
76
+        $size = (int) $size;
77 77
 
78
-		// min/max size
79
-		if ($size > 2048) {
80
-			$size = 2048;
81
-		} elseif ($size <= 0) {
82
-			$size = 64;
83
-		}
78
+        // min/max size
79
+        if ($size > 2048) {
80
+            $size = 2048;
81
+        } elseif ($size <= 0) {
82
+            $size = 64;
83
+        }
84 84
 
85
-		try {
86
-			$avatar = $this->avatarManager->getGuestAvatar($guestName);
87
-			$avatarFile = $avatar->getFile($size);
85
+        try {
86
+            $avatar = $this->avatarManager->getGuestAvatar($guestName);
87
+            $avatarFile = $avatar->getFile($size);
88 88
 
89
-			$resp = new FileDisplayResponse(
90
-				$avatarFile,
91
-				$avatar->isCustomAvatar() ? Http::STATUS_OK : Http::STATUS_CREATED,
92
-				['Content-Type' => $avatarFile->getMimeType()]
93
-			);
94
-		} catch (\Exception $e) {
95
-			$this->logger->error('error while creating guest avatar', [
96
-				'err' => $e,
97
-			]);
98
-			$resp = new Http\Response();
99
-			$resp->setStatus(Http::STATUS_INTERNAL_SERVER_ERROR);
100
-			return $resp;
101
-		}
89
+            $resp = new FileDisplayResponse(
90
+                $avatarFile,
91
+                $avatar->isCustomAvatar() ? Http::STATUS_OK : Http::STATUS_CREATED,
92
+                ['Content-Type' => $avatarFile->getMimeType()]
93
+            );
94
+        } catch (\Exception $e) {
95
+            $this->logger->error('error while creating guest avatar', [
96
+                'err' => $e,
97
+            ]);
98
+            $resp = new Http\Response();
99
+            $resp->setStatus(Http::STATUS_INTERNAL_SERVER_ERROR);
100
+            return $resp;
101
+        }
102 102
 
103
-		// Cache for 30 minutes
104
-		$resp->cacheFor(1800);
105
-		return $resp;
106
-	}
103
+        // Cache for 30 minutes
104
+        $resp->cacheFor(1800);
105
+        return $resp;
106
+    }
107 107
 }
Please login to merge, or discard this patch.
apps/files_external/lib/Config/IConfigHandler.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -30,10 +30,10 @@
 block discarded – undo
30 30
  * @since 16.0.0
31 31
  */
32 32
 interface IConfigHandler {
33
-	/**
34
-	 * @param mixed $optionValue
35
-	 * @return mixed the same type as $optionValue
36
-	 * @since 16.0.0
37
-	 */
38
-	public function handle($optionValue);
33
+    /**
34
+     * @param mixed $optionValue
35
+     * @return mixed the same type as $optionValue
36
+     * @since 16.0.0
37
+     */
38
+    public function handle($optionValue);
39 39
 }
Please login to merge, or discard this patch.