Completed
Push — master ( 738385...cbc573 )
by Blizzz
33:01 queued 15s
created
core/Command/Group/Info.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -67,7 +67,7 @@
 block discarded – undo
67 67
 		$gid = $input->getArgument('groupid');
68 68
 		$group = $this->groupManager->get($gid);
69 69
 		if (!$group instanceof IGroup) {
70
-			$output->writeln('<error>Group "' . $gid . '" does not exist.</error>');
70
+			$output->writeln('<error>Group "'.$gid.'" does not exist.</error>');
71 71
 			return 1;
72 72
 		} else {
73 73
 			$groupOutput = [
Please login to merge, or discard this patch.
Indentation   +48 added lines, -48 removed lines patch added patch discarded remove patch
@@ -35,56 +35,56 @@
 block discarded – undo
35 35
 use Symfony\Component\Console\Output\OutputInterface;
36 36
 
37 37
 class Info extends Base {
38
-	public function __construct(
39
-		protected IGroupManager $groupManager,
40
-	) {
41
-		parent::__construct();
42
-	}
38
+    public function __construct(
39
+        protected IGroupManager $groupManager,
40
+    ) {
41
+        parent::__construct();
42
+    }
43 43
 
44
-	protected function configure() {
45
-		$this
46
-			->setName('group:info')
47
-			->setDescription('Show information about a group')
48
-			->addArgument(
49
-				'groupid',
50
-				InputArgument::REQUIRED,
51
-				'Group id'
52
-			)->addOption(
53
-				'output',
54
-				null,
55
-				InputOption::VALUE_OPTIONAL,
56
-				'Output format (plain, json or json_pretty, default is plain)',
57
-				$this->defaultOutputFormat
58
-			);
59
-	}
44
+    protected function configure() {
45
+        $this
46
+            ->setName('group:info')
47
+            ->setDescription('Show information about a group')
48
+            ->addArgument(
49
+                'groupid',
50
+                InputArgument::REQUIRED,
51
+                'Group id'
52
+            )->addOption(
53
+                'output',
54
+                null,
55
+                InputOption::VALUE_OPTIONAL,
56
+                'Output format (plain, json or json_pretty, default is plain)',
57
+                $this->defaultOutputFormat
58
+            );
59
+    }
60 60
 
61
-	protected function execute(InputInterface $input, OutputInterface $output): int {
62
-		$gid = $input->getArgument('groupid');
63
-		$group = $this->groupManager->get($gid);
64
-		if (!$group instanceof IGroup) {
65
-			$output->writeln('<error>Group "' . $gid . '" does not exist.</error>');
66
-			return 1;
67
-		} else {
68
-			$groupOutput = [
69
-				'groupID' => $gid,
70
-				'displayName' => $group->getDisplayName(),
71
-				'backends' => $group->getBackendNames(),
72
-			];
61
+    protected function execute(InputInterface $input, OutputInterface $output): int {
62
+        $gid = $input->getArgument('groupid');
63
+        $group = $this->groupManager->get($gid);
64
+        if (!$group instanceof IGroup) {
65
+            $output->writeln('<error>Group "' . $gid . '" does not exist.</error>');
66
+            return 1;
67
+        } else {
68
+            $groupOutput = [
69
+                'groupID' => $gid,
70
+                'displayName' => $group->getDisplayName(),
71
+                'backends' => $group->getBackendNames(),
72
+            ];
73 73
 
74
-			$this->writeArrayInOutputFormat($input, $output, $groupOutput);
75
-			return 0;
76
-		}
77
-	}
74
+            $this->writeArrayInOutputFormat($input, $output, $groupOutput);
75
+            return 0;
76
+        }
77
+    }
78 78
 
79
-	/**
80
-	 * @param string $argumentName
81
-	 * @param CompletionContext $context
82
-	 * @return string[]
83
-	 */
84
-	public function completeArgumentValues($argumentName, CompletionContext $context) {
85
-		if ($argumentName === 'groupid') {
86
-			return array_map(static fn (IGroup $group) => $group->getGID(), $this->groupManager->search($context->getCurrentWord()));
87
-		}
88
-		return [];
89
-	}
79
+    /**
80
+     * @param string $argumentName
81
+     * @param CompletionContext $context
82
+     * @return string[]
83
+     */
84
+    public function completeArgumentValues($argumentName, CompletionContext $context) {
85
+        if ($argumentName === 'groupid') {
86
+            return array_map(static fn (IGroup $group) => $group->getGID(), $this->groupManager->search($context->getCurrentWord()));
87
+        }
88
+        return [];
89
+    }
90 90
 }
Please login to merge, or discard this patch.
lib/private/Contacts/ContactsMenu/Entry.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
 	 * sort the actions by priority and name
118 118
 	 */
119 119
 	private function sortActions(): void {
120
-		usort($this->actions, function (IAction $action1, IAction $action2) {
120
+		usort($this->actions, function(IAction $action1, IAction $action2) {
121 121
 			$prio1 = $action1->getPriority();
122 122
 			$prio2 = $action2->getPriority();
123 123
 
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
 	 */
155 155
 	public function jsonSerialize(): array {
156 156
 		$topAction = !empty($this->actions) ? $this->actions[0]->jsonSerialize() : null;
157
-		$otherActions = array_map(function (IAction $action) {
157
+		$otherActions = array_map(function(IAction $action) {
158 158
 			return $action->jsonSerialize();
159 159
 		}, array_slice($this->actions, 1));
160 160
 
Please login to merge, or discard this patch.
Indentation   +166 added lines, -166 removed lines patch added patch discarded remove patch
@@ -14,170 +14,170 @@
 block discarded – undo
14 14
 use function array_merge;
15 15
 
16 16
 class Entry implements IEntry {
17
-	public const PROPERTY_STATUS_MESSAGE_TIMESTAMP = 'statusMessageTimestamp';
18
-
19
-	/** @var string|int|null */
20
-	private $id = null;
21
-
22
-	private string $fullName = '';
23
-
24
-	/** @var string[] */
25
-	private array $emailAddresses = [];
26
-
27
-	private ?string $avatar = null;
28
-
29
-	private ?string $profileTitle = null;
30
-
31
-	private ?string $profileUrl = null;
32
-
33
-	/** @var IAction[] */
34
-	private array $actions = [];
35
-
36
-	private array $properties = [];
37
-
38
-	private ?string $status = null;
39
-	private ?string $statusMessage = null;
40
-	private ?int $statusMessageTimestamp = null;
41
-	private ?string $statusIcon = null;
42
-
43
-	public function setId(string $id): void {
44
-		$this->id = $id;
45
-	}
46
-
47
-	public function setFullName(string $displayName): void {
48
-		$this->fullName = $displayName;
49
-	}
50
-
51
-	public function getFullName(): string {
52
-		return $this->fullName;
53
-	}
54
-
55
-	public function addEMailAddress(string $address): void {
56
-		$this->emailAddresses[] = $address;
57
-	}
58
-
59
-	/**
60
-	 * @return string[]
61
-	 */
62
-	public function getEMailAddresses(): array {
63
-		return $this->emailAddresses;
64
-	}
65
-
66
-	public function setAvatar(string $avatar): void {
67
-		$this->avatar = $avatar;
68
-	}
69
-
70
-	public function getAvatar(): ?string {
71
-		return $this->avatar;
72
-	}
73
-
74
-	public function setProfileTitle(string $profileTitle): void {
75
-		$this->profileTitle = $profileTitle;
76
-	}
77
-
78
-	public function getProfileTitle(): ?string {
79
-		return $this->profileTitle;
80
-	}
81
-
82
-	public function setProfileUrl(string $profileUrl): void {
83
-		$this->profileUrl = $profileUrl;
84
-	}
85
-
86
-	public function getProfileUrl(): ?string {
87
-		return $this->profileUrl;
88
-	}
89
-
90
-	public function addAction(IAction $action): void {
91
-		$this->actions[] = $action;
92
-		$this->sortActions();
93
-	}
94
-
95
-	public function setStatus(string $status,
96
-		?string $statusMessage = null,
97
-		?int $statusMessageTimestamp = null,
98
-		?string $icon = null): void {
99
-		$this->status = $status;
100
-		$this->statusMessage = $statusMessage;
101
-		$this->statusMessageTimestamp = $statusMessageTimestamp;
102
-		$this->statusIcon = $icon;
103
-	}
104
-
105
-	/**
106
-	 * @return IAction[]
107
-	 */
108
-	public function getActions(): array {
109
-		return $this->actions;
110
-	}
111
-
112
-	/**
113
-	 * sort the actions by priority and name
114
-	 */
115
-	private function sortActions(): void {
116
-		usort($this->actions, function (IAction $action1, IAction $action2) {
117
-			$prio1 = $action1->getPriority();
118
-			$prio2 = $action2->getPriority();
119
-
120
-			if ($prio1 === $prio2) {
121
-				// Ascending order for same priority
122
-				return strcasecmp($action1->getName(), $action2->getName());
123
-			}
124
-
125
-			// Descending order when priority differs
126
-			return $prio2 - $prio1;
127
-		});
128
-	}
129
-
130
-	public function setProperty(string $propertyName, mixed $value) {
131
-		$this->properties[$propertyName] = $value;
132
-	}
133
-
134
-	/**
135
-	 * @param array $properties key-value array containing additional properties
136
-	 */
137
-	public function setProperties(array $properties): void {
138
-		$this->properties = array_merge($this->properties, $properties);
139
-	}
140
-
141
-	public function getProperty(string $key): mixed {
142
-		if (!isset($this->properties[$key])) {
143
-			return null;
144
-		}
145
-		return $this->properties[$key];
146
-	}
147
-
148
-	/**
149
-	 * @return array{id: int|string|null, fullName: string, avatar: string|null, topAction: mixed, actions: array, lastMessage: '', emailAddresses: string[], profileTitle: string|null, profileUrl: string|null, status: string|null, statusMessage: null|string, statusMessageTimestamp: null|int, statusIcon: null|string, isUser: bool, uid: mixed}
150
-	 */
151
-	public function jsonSerialize(): array {
152
-		$topAction = !empty($this->actions) ? $this->actions[0]->jsonSerialize() : null;
153
-		$otherActions = array_map(function (IAction $action) {
154
-			return $action->jsonSerialize();
155
-		}, array_slice($this->actions, 1));
156
-
157
-		return [
158
-			'id' => $this->id,
159
-			'fullName' => $this->fullName,
160
-			'avatar' => $this->getAvatar(),
161
-			'topAction' => $topAction,
162
-			'actions' => $otherActions,
163
-			'lastMessage' => '',
164
-			'emailAddresses' => $this->getEMailAddresses(),
165
-			'profileTitle' => $this->profileTitle,
166
-			'profileUrl' => $this->profileUrl,
167
-			'status' => $this->status,
168
-			'statusMessage' => $this->statusMessage,
169
-			'statusMessageTimestamp' => $this->statusMessageTimestamp,
170
-			'statusIcon' => $this->statusIcon,
171
-			'isUser' => $this->getProperty('isUser') === true,
172
-			'uid' => $this->getProperty('UID'),
173
-		];
174
-	}
175
-
176
-	public function getStatusMessage(): ?string {
177
-		return $this->statusMessage;
178
-	}
179
-
180
-	public function getStatusMessageTimestamp(): ?int {
181
-		return $this->statusMessageTimestamp;
182
-	}
17
+    public const PROPERTY_STATUS_MESSAGE_TIMESTAMP = 'statusMessageTimestamp';
18
+
19
+    /** @var string|int|null */
20
+    private $id = null;
21
+
22
+    private string $fullName = '';
23
+
24
+    /** @var string[] */
25
+    private array $emailAddresses = [];
26
+
27
+    private ?string $avatar = null;
28
+
29
+    private ?string $profileTitle = null;
30
+
31
+    private ?string $profileUrl = null;
32
+
33
+    /** @var IAction[] */
34
+    private array $actions = [];
35
+
36
+    private array $properties = [];
37
+
38
+    private ?string $status = null;
39
+    private ?string $statusMessage = null;
40
+    private ?int $statusMessageTimestamp = null;
41
+    private ?string $statusIcon = null;
42
+
43
+    public function setId(string $id): void {
44
+        $this->id = $id;
45
+    }
46
+
47
+    public function setFullName(string $displayName): void {
48
+        $this->fullName = $displayName;
49
+    }
50
+
51
+    public function getFullName(): string {
52
+        return $this->fullName;
53
+    }
54
+
55
+    public function addEMailAddress(string $address): void {
56
+        $this->emailAddresses[] = $address;
57
+    }
58
+
59
+    /**
60
+     * @return string[]
61
+     */
62
+    public function getEMailAddresses(): array {
63
+        return $this->emailAddresses;
64
+    }
65
+
66
+    public function setAvatar(string $avatar): void {
67
+        $this->avatar = $avatar;
68
+    }
69
+
70
+    public function getAvatar(): ?string {
71
+        return $this->avatar;
72
+    }
73
+
74
+    public function setProfileTitle(string $profileTitle): void {
75
+        $this->profileTitle = $profileTitle;
76
+    }
77
+
78
+    public function getProfileTitle(): ?string {
79
+        return $this->profileTitle;
80
+    }
81
+
82
+    public function setProfileUrl(string $profileUrl): void {
83
+        $this->profileUrl = $profileUrl;
84
+    }
85
+
86
+    public function getProfileUrl(): ?string {
87
+        return $this->profileUrl;
88
+    }
89
+
90
+    public function addAction(IAction $action): void {
91
+        $this->actions[] = $action;
92
+        $this->sortActions();
93
+    }
94
+
95
+    public function setStatus(string $status,
96
+        ?string $statusMessage = null,
97
+        ?int $statusMessageTimestamp = null,
98
+        ?string $icon = null): void {
99
+        $this->status = $status;
100
+        $this->statusMessage = $statusMessage;
101
+        $this->statusMessageTimestamp = $statusMessageTimestamp;
102
+        $this->statusIcon = $icon;
103
+    }
104
+
105
+    /**
106
+     * @return IAction[]
107
+     */
108
+    public function getActions(): array {
109
+        return $this->actions;
110
+    }
111
+
112
+    /**
113
+     * sort the actions by priority and name
114
+     */
115
+    private function sortActions(): void {
116
+        usort($this->actions, function (IAction $action1, IAction $action2) {
117
+            $prio1 = $action1->getPriority();
118
+            $prio2 = $action2->getPriority();
119
+
120
+            if ($prio1 === $prio2) {
121
+                // Ascending order for same priority
122
+                return strcasecmp($action1->getName(), $action2->getName());
123
+            }
124
+
125
+            // Descending order when priority differs
126
+            return $prio2 - $prio1;
127
+        });
128
+    }
129
+
130
+    public function setProperty(string $propertyName, mixed $value) {
131
+        $this->properties[$propertyName] = $value;
132
+    }
133
+
134
+    /**
135
+     * @param array $properties key-value array containing additional properties
136
+     */
137
+    public function setProperties(array $properties): void {
138
+        $this->properties = array_merge($this->properties, $properties);
139
+    }
140
+
141
+    public function getProperty(string $key): mixed {
142
+        if (!isset($this->properties[$key])) {
143
+            return null;
144
+        }
145
+        return $this->properties[$key];
146
+    }
147
+
148
+    /**
149
+     * @return array{id: int|string|null, fullName: string, avatar: string|null, topAction: mixed, actions: array, lastMessage: '', emailAddresses: string[], profileTitle: string|null, profileUrl: string|null, status: string|null, statusMessage: null|string, statusMessageTimestamp: null|int, statusIcon: null|string, isUser: bool, uid: mixed}
150
+     */
151
+    public function jsonSerialize(): array {
152
+        $topAction = !empty($this->actions) ? $this->actions[0]->jsonSerialize() : null;
153
+        $otherActions = array_map(function (IAction $action) {
154
+            return $action->jsonSerialize();
155
+        }, array_slice($this->actions, 1));
156
+
157
+        return [
158
+            'id' => $this->id,
159
+            'fullName' => $this->fullName,
160
+            'avatar' => $this->getAvatar(),
161
+            'topAction' => $topAction,
162
+            'actions' => $otherActions,
163
+            'lastMessage' => '',
164
+            'emailAddresses' => $this->getEMailAddresses(),
165
+            'profileTitle' => $this->profileTitle,
166
+            'profileUrl' => $this->profileUrl,
167
+            'status' => $this->status,
168
+            'statusMessage' => $this->statusMessage,
169
+            'statusMessageTimestamp' => $this->statusMessageTimestamp,
170
+            'statusIcon' => $this->statusIcon,
171
+            'isUser' => $this->getProperty('isUser') === true,
172
+            'uid' => $this->getProperty('UID'),
173
+        ];
174
+    }
175
+
176
+    public function getStatusMessage(): ?string {
177
+        return $this->statusMessage;
178
+    }
179
+
180
+    public function getStatusMessageTimestamp(): ?int {
181
+        return $this->statusMessageTimestamp;
182
+    }
183 183
 }
Please login to merge, or discard this patch.
apps/admin_audit/lib/Actions/Trashbin.php 1 patch
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -29,15 +29,15 @@
 block discarded – undo
29 29
 namespace OCA\AdminAudit\Actions;
30 30
 
31 31
 class Trashbin extends Action {
32
-	public function delete(array $params): void {
33
-		$this->log('File "%s" deleted from trash bin.',
34
-			['path' => $params['path']], ['path']
35
-		);
36
-	}
32
+    public function delete(array $params): void {
33
+        $this->log('File "%s" deleted from trash bin.',
34
+            ['path' => $params['path']], ['path']
35
+        );
36
+    }
37 37
 
38
-	public function restore(array $params): void {
39
-		$this->log('File "%s" restored from trash bin.',
40
-			['path' => $params['filePath']], ['path']
41
-		);
42
-	}
38
+    public function restore(array $params): void {
39
+        $this->log('File "%s" restored from trash bin.',
40
+            ['path' => $params['filePath']], ['path']
41
+        );
42
+    }
43 43
 }
Please login to merge, or discard this patch.
lib/public/Share/Exceptions/AlreadySharedException.php 1 patch
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -29,22 +29,22 @@
 block discarded – undo
29 29
  * @since 22.0.0
30 30
  */
31 31
 class AlreadySharedException extends GenericShareException {
32
-	/** @var IShare */
33
-	private $existingShare;
32
+    /** @var IShare */
33
+    private $existingShare;
34 34
 
35
-	/**
36
-	 * @since 22.0.0
37
-	 */
38
-	public function __construct(string $message, IShare $existingShare) {
39
-		parent::__construct($message);
35
+    /**
36
+     * @since 22.0.0
37
+     */
38
+    public function __construct(string $message, IShare $existingShare) {
39
+        parent::__construct($message);
40 40
 
41
-		$this->existingShare = $existingShare;
42
-	}
41
+        $this->existingShare = $existingShare;
42
+    }
43 43
 
44
-	/**
45
-	 * @since 22.0.0
46
-	 */
47
-	public function getExistingShare(): IShare {
48
-		return $this->existingShare;
49
-	}
44
+    /**
45
+     * @since 22.0.0
46
+     */
47
+    public function getExistingShare(): IShare {
48
+        return $this->existingShare;
49
+    }
50 50
 }
Please login to merge, or discard this patch.
apps/provisioning_api/lib/AppInfo/Application.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 	public function register(IRegistrationContext $context): void {
61 61
 		$context->registerEventListener(UserDeletedEvent::class, UserDeletedListener::class);
62 62
 
63
-		$context->registerService(NewUserMailHelper::class, function (ContainerInterface $c) {
63
+		$context->registerService(NewUserMailHelper::class, function(ContainerInterface $c) {
64 64
 			return new NewUserMailHelper(
65 65
 				$c->get(Defaults::class),
66 66
 				$c->get(IURLGenerator::class),
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 				Util::getDefaultEmailAddress('no-reply')
74 74
 			);
75 75
 		});
76
-		$context->registerService(ProvisioningApiMiddleware::class, function (ContainerInterface $c) {
76
+		$context->registerService(ProvisioningApiMiddleware::class, function(ContainerInterface $c) {
77 77
 			$user = $c->get(IUserManager::class)->get($c->get('UserId'));
78 78
 			$isAdmin = false;
79 79
 			$isSubAdmin = false;
Please login to merge, or discard this patch.
Indentation   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -54,48 +54,48 @@
 block discarded – undo
54 54
 use Psr\Container\ContainerInterface;
55 55
 
56 56
 class Application extends App implements IBootstrap {
57
-	public function __construct(array $urlParams = []) {
58
-		parent::__construct('provisioning_api', $urlParams);
59
-	}
57
+    public function __construct(array $urlParams = []) {
58
+        parent::__construct('provisioning_api', $urlParams);
59
+    }
60 60
 
61
-	public function register(IRegistrationContext $context): void {
62
-		$context->registerEventListener(UserDeletedEvent::class, UserDeletedListener::class);
61
+    public function register(IRegistrationContext $context): void {
62
+        $context->registerEventListener(UserDeletedEvent::class, UserDeletedListener::class);
63 63
 
64
-		$context->registerService(NewUserMailHelper::class, function (ContainerInterface $c) {
65
-			return new NewUserMailHelper(
66
-				$c->get(Defaults::class),
67
-				$c->get(IURLGenerator::class),
68
-				$c->get(IFactory::class),
69
-				$c->get(IMailer::class),
70
-				$c->get(ISecureRandom::class),
71
-				$c->get(ITimeFactory::class),
72
-				$c->get(IConfig::class),
73
-				$c->get(ICrypto::class),
74
-				Util::getDefaultEmailAddress('no-reply')
75
-			);
76
-		});
77
-		$context->registerService(ProvisioningApiMiddleware::class, function (ContainerInterface $c) {
78
-			$user = $c->get(IUserManager::class)->get($c->get('UserId'));
79
-			$isAdmin = false;
80
-			$isSubAdmin = false;
64
+        $context->registerService(NewUserMailHelper::class, function (ContainerInterface $c) {
65
+            return new NewUserMailHelper(
66
+                $c->get(Defaults::class),
67
+                $c->get(IURLGenerator::class),
68
+                $c->get(IFactory::class),
69
+                $c->get(IMailer::class),
70
+                $c->get(ISecureRandom::class),
71
+                $c->get(ITimeFactory::class),
72
+                $c->get(IConfig::class),
73
+                $c->get(ICrypto::class),
74
+                Util::getDefaultEmailAddress('no-reply')
75
+            );
76
+        });
77
+        $context->registerService(ProvisioningApiMiddleware::class, function (ContainerInterface $c) {
78
+            $user = $c->get(IUserManager::class)->get($c->get('UserId'));
79
+            $isAdmin = false;
80
+            $isSubAdmin = false;
81 81
 
82
-			if ($user instanceof IUser) {
83
-				$groupManager = $c->get(IGroupManager::class);
84
-				assert($groupManager instanceof GroupManager);
85
-				$isAdmin = $groupManager->isAdmin($user->getUID());
86
-				$isSubAdmin = $groupManager->getSubAdmin()->isSubAdmin($user);
87
-			}
82
+            if ($user instanceof IUser) {
83
+                $groupManager = $c->get(IGroupManager::class);
84
+                assert($groupManager instanceof GroupManager);
85
+                $isAdmin = $groupManager->isAdmin($user->getUID());
86
+                $isSubAdmin = $groupManager->getSubAdmin()->isSubAdmin($user);
87
+            }
88 88
 
89
-			return new ProvisioningApiMiddleware(
90
-				$c->get(IControllerMethodReflector::class),
91
-				$isAdmin,
92
-				$isSubAdmin
93
-			);
94
-		});
95
-		$context->registerMiddleware(ProvisioningApiMiddleware::class);
96
-		$context->registerCapability(Capabilities::class);
97
-	}
89
+            return new ProvisioningApiMiddleware(
90
+                $c->get(IControllerMethodReflector::class),
91
+                $isAdmin,
92
+                $isSubAdmin
93
+            );
94
+        });
95
+        $context->registerMiddleware(ProvisioningApiMiddleware::class);
96
+        $context->registerCapability(Capabilities::class);
97
+    }
98 98
 
99
-	public function boot(IBootContext $context): void {
100
-	}
99
+    public function boot(IBootContext $context): void {
100
+    }
101 101
 }
Please login to merge, or discard this patch.
lib/private/Files/Cache/MoveFromCacheTrait.php 1 patch
Indentation   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -30,31 +30,31 @@
 block discarded – undo
30 30
  * Fallback implementation for moveFromCache
31 31
  */
32 32
 trait MoveFromCacheTrait {
33
-	/**
34
-	 * store meta data for a file or folder
35
-	 *
36
-	 * @param string $file
37
-	 * @param array $data
38
-	 *
39
-	 * @return int file id
40
-	 * @throws \RuntimeException
41
-	 */
42
-	abstract public function put($file, array $data);
33
+    /**
34
+     * store meta data for a file or folder
35
+     *
36
+     * @param string $file
37
+     * @param array $data
38
+     *
39
+     * @return int file id
40
+     * @throws \RuntimeException
41
+     */
42
+    abstract public function put($file, array $data);
43 43
 
44
-	abstract public function copyFromCache(ICache $sourceCache, ICacheEntry $sourceEntry, string $targetPath): int;
44
+    abstract public function copyFromCache(ICache $sourceCache, ICacheEntry $sourceEntry, string $targetPath): int;
45 45
 
46
-	/**
47
-	 * Move a file or folder in the cache
48
-	 *
49
-	 * @param \OCP\Files\Cache\ICache $sourceCache
50
-	 * @param string $sourcePath
51
-	 * @param string $targetPath
52
-	 */
53
-	public function moveFromCache(ICache $sourceCache, $sourcePath, $targetPath) {
54
-		$sourceEntry = $sourceCache->get($sourcePath);
46
+    /**
47
+     * Move a file or folder in the cache
48
+     *
49
+     * @param \OCP\Files\Cache\ICache $sourceCache
50
+     * @param string $sourcePath
51
+     * @param string $targetPath
52
+     */
53
+    public function moveFromCache(ICache $sourceCache, $sourcePath, $targetPath) {
54
+        $sourceEntry = $sourceCache->get($sourcePath);
55 55
 
56
-		$this->copyFromCache($sourceCache, $sourceEntry, $targetPath);
56
+        $this->copyFromCache($sourceCache, $sourceEntry, $targetPath);
57 57
 
58
-		$sourceCache->remove($sourcePath);
59
-	}
58
+        $sourceCache->remove($sourcePath);
59
+    }
60 60
 }
Please login to merge, or discard this patch.
core/Migrations/Version21000Date20210309185127.php 1 patch
Indentation   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -31,22 +31,22 @@
 block discarded – undo
31 31
 use OCP\Migration\SimpleMigrationStep;
32 32
 
33 33
 class Version21000Date20210309185127 extends SimpleMigrationStep {
34
-	/**
35
-	 * @param IOutput $output
36
-	 * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
37
-	 * @param array $options
38
-	 * @return null|ISchemaWrapper
39
-	 */
40
-	public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
41
-		/** @var ISchemaWrapper $schema */
42
-		$schema = $schemaClosure();
34
+    /**
35
+     * @param IOutput $output
36
+     * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
37
+     * @param array $options
38
+     * @return null|ISchemaWrapper
39
+     */
40
+    public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
41
+        /** @var ISchemaWrapper $schema */
42
+        $schema = $schemaClosure();
43 43
 
44
-		$table = $schema->getTable('known_users');
45
-		if (!$table->hasIndex('ku_known_user')) {
46
-			$table->addIndex(['known_user'], 'ku_known_user');
47
-			return $schema;
48
-		}
44
+        $table = $schema->getTable('known_users');
45
+        if (!$table->hasIndex('ku_known_user')) {
46
+            $table->addIndex(['known_user'], 'ku_known_user');
47
+            return $schema;
48
+        }
49 49
 
50
-		return null;
51
-	}
50
+        return null;
51
+    }
52 52
 }
Please login to merge, or discard this patch.
core/Command/Preview/ResetRenderedTexts.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 		$avatarsToDeleteCount = 0;
96 96
 
97 97
 		foreach ($this->getAvatarsToDelete() as [$userId, $avatar]) {
98
-			$output->writeln('Deleting avatar for ' . $userId, OutputInterface::VERBOSITY_VERBOSE);
98
+			$output->writeln('Deleting avatar for '.$userId, OutputInterface::VERBOSITY_VERBOSE);
99 99
 
100 100
 			$avatarsToDeleteCount++;
101 101
 
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
 			}
113 113
 		}
114 114
 
115
-		$output->writeln('Deleted ' . $avatarsToDeleteCount . ' avatars');
115
+		$output->writeln('Deleted '.$avatarsToDeleteCount.' avatars');
116 116
 		$output->writeln('');
117 117
 	}
118 118
 
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
 		$previewsToDeleteCount = 0;
131 131
 
132 132
 		foreach ($this->getPreviewsToDelete() as ['name' => $previewFileId, 'path' => $filePath]) {
133
-			$output->writeln('Deleting previews for ' . $filePath, OutputInterface::VERBOSITY_VERBOSE);
133
+			$output->writeln('Deleting previews for '.$filePath, OutputInterface::VERBOSITY_VERBOSE);
134 134
 
135 135
 			$previewsToDeleteCount++;
136 136
 
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
 			}
140 140
 
141 141
 			try {
142
-				$preview = $this->previewFolder->getFolder((string)$previewFileId);
142
+				$preview = $this->previewFolder->getFolder((string) $previewFileId);
143 143
 				$preview->delete();
144 144
 			} catch (NotFoundException $e) {
145 145
 				// continue
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
 			}
149 149
 		}
150 150
 
151
-		$output->writeln('Deleted ' . $previewsToDeleteCount . ' previews');
151
+		$output->writeln('Deleted '.$previewsToDeleteCount.' previews');
152 152
 	}
153 153
 
154 154
 	// Copy pasted and adjusted from
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
 		 * We take the md5 of the name (fileid) and split the first 7 chars. That way
172 172
 		 * there are not a gazillion files in the root of the preview appdata.
173 173
 		 */
174
-		$like = $this->connection->escapeLikeParameter($data['path']) . '/_/_/_/_/_/_/_/%';
174
+		$like = $this->connection->escapeLikeParameter($data['path']).'/_/_/_/_/_/_/_/%';
175 175
 
176 176
 		$qb = $this->connection->getQueryBuilder();
177 177
 		$qb->select('a.name', 'b.path')
Please login to merge, or discard this patch.
Indentation   +135 added lines, -135 removed lines patch added patch discarded remove patch
@@ -22,143 +22,143 @@
 block discarded – undo
22 22
 use Symfony\Component\Console\Output\OutputInterface;
23 23
 
24 24
 class ResetRenderedTexts extends Command {
25
-	public function __construct(
26
-		protected IDBConnection $connection,
27
-		protected IUserManager $userManager,
28
-		protected IAvatarManager $avatarManager,
29
-		private Root $previewFolder,
30
-		private IMimeTypeLoader $mimeTypeLoader,
31
-	) {
32
-		parent::__construct();
33
-	}
34
-
35
-	protected function configure() {
36
-		$this
37
-			->setName('preview:reset-rendered-texts')
38
-			->setDescription('Deletes all generated avatars and previews of text and md files')
39
-			->addOption('dry', 'd', InputOption::VALUE_NONE, 'Dry mode - will not delete any files - in combination with the verbose mode one could check the operations.');
40
-	}
41
-
42
-	protected function execute(InputInterface $input, OutputInterface $output): int {
43
-		$dryMode = $input->getOption('dry');
44
-
45
-		if ($dryMode) {
46
-			$output->writeln('INFO: The command is run in dry mode and will not modify anything.');
47
-			$output->writeln('');
48
-		}
49
-
50
-		$this->deleteAvatars($output, $dryMode);
51
-		$this->deletePreviews($output, $dryMode);
52
-
53
-		return 0;
54
-	}
55
-
56
-	private function deleteAvatars(OutputInterface $output, bool $dryMode): void {
57
-		$avatarsToDeleteCount = 0;
58
-
59
-		foreach ($this->getAvatarsToDelete() as [$userId, $avatar]) {
60
-			$output->writeln('Deleting avatar for ' . $userId, OutputInterface::VERBOSITY_VERBOSE);
61
-
62
-			$avatarsToDeleteCount++;
63
-
64
-			if ($dryMode) {
65
-				continue;
66
-			}
67
-
68
-			try {
69
-				$avatar->remove();
70
-			} catch (NotFoundException $e) {
71
-				// continue
72
-			} catch (NotPermittedException $e) {
73
-				// continue
74
-			}
75
-		}
76
-
77
-		$output->writeln('Deleted ' . $avatarsToDeleteCount . ' avatars');
78
-		$output->writeln('');
79
-	}
80
-
81
-	private function getAvatarsToDelete(): \Iterator {
82
-		foreach ($this->userManager->search('') as $user) {
83
-			$avatar = $this->avatarManager->getAvatar($user->getUID());
84
-
85
-			if (!$avatar->isCustomAvatar()) {
86
-				yield [$user->getUID(), $avatar];
87
-			}
88
-		}
89
-	}
90
-
91
-	private function deletePreviews(OutputInterface $output, bool $dryMode): void {
92
-		$previewsToDeleteCount = 0;
93
-
94
-		foreach ($this->getPreviewsToDelete() as ['name' => $previewFileId, 'path' => $filePath]) {
95
-			$output->writeln('Deleting previews for ' . $filePath, OutputInterface::VERBOSITY_VERBOSE);
96
-
97
-			$previewsToDeleteCount++;
98
-
99
-			if ($dryMode) {
100
-				continue;
101
-			}
102
-
103
-			try {
104
-				$preview = $this->previewFolder->getFolder((string)$previewFileId);
105
-				$preview->delete();
106
-			} catch (NotFoundException $e) {
107
-				// continue
108
-			} catch (NotPermittedException $e) {
109
-				// continue
110
-			}
111
-		}
112
-
113
-		$output->writeln('Deleted ' . $previewsToDeleteCount . ' previews');
114
-	}
115
-
116
-	// Copy pasted and adjusted from
117
-	// "lib/private/Preview/BackgroundCleanupJob.php".
118
-	private function getPreviewsToDelete(): \Iterator {
119
-		$qb = $this->connection->getQueryBuilder();
120
-		$qb->select('path', 'mimetype')
121
-			->from('filecache')
122
-			->where($qb->expr()->eq('fileid', $qb->createNamedParameter($this->previewFolder->getId())));
123
-		$cursor = $qb->executeQuery();
124
-		$data = $cursor->fetch();
125
-		$cursor->closeCursor();
126
-
127
-		if ($data === null) {
128
-			return [];
129
-		}
130
-
131
-		/*
25
+    public function __construct(
26
+        protected IDBConnection $connection,
27
+        protected IUserManager $userManager,
28
+        protected IAvatarManager $avatarManager,
29
+        private Root $previewFolder,
30
+        private IMimeTypeLoader $mimeTypeLoader,
31
+    ) {
32
+        parent::__construct();
33
+    }
34
+
35
+    protected function configure() {
36
+        $this
37
+            ->setName('preview:reset-rendered-texts')
38
+            ->setDescription('Deletes all generated avatars and previews of text and md files')
39
+            ->addOption('dry', 'd', InputOption::VALUE_NONE, 'Dry mode - will not delete any files - in combination with the verbose mode one could check the operations.');
40
+    }
41
+
42
+    protected function execute(InputInterface $input, OutputInterface $output): int {
43
+        $dryMode = $input->getOption('dry');
44
+
45
+        if ($dryMode) {
46
+            $output->writeln('INFO: The command is run in dry mode and will not modify anything.');
47
+            $output->writeln('');
48
+        }
49
+
50
+        $this->deleteAvatars($output, $dryMode);
51
+        $this->deletePreviews($output, $dryMode);
52
+
53
+        return 0;
54
+    }
55
+
56
+    private function deleteAvatars(OutputInterface $output, bool $dryMode): void {
57
+        $avatarsToDeleteCount = 0;
58
+
59
+        foreach ($this->getAvatarsToDelete() as [$userId, $avatar]) {
60
+            $output->writeln('Deleting avatar for ' . $userId, OutputInterface::VERBOSITY_VERBOSE);
61
+
62
+            $avatarsToDeleteCount++;
63
+
64
+            if ($dryMode) {
65
+                continue;
66
+            }
67
+
68
+            try {
69
+                $avatar->remove();
70
+            } catch (NotFoundException $e) {
71
+                // continue
72
+            } catch (NotPermittedException $e) {
73
+                // continue
74
+            }
75
+        }
76
+
77
+        $output->writeln('Deleted ' . $avatarsToDeleteCount . ' avatars');
78
+        $output->writeln('');
79
+    }
80
+
81
+    private function getAvatarsToDelete(): \Iterator {
82
+        foreach ($this->userManager->search('') as $user) {
83
+            $avatar = $this->avatarManager->getAvatar($user->getUID());
84
+
85
+            if (!$avatar->isCustomAvatar()) {
86
+                yield [$user->getUID(), $avatar];
87
+            }
88
+        }
89
+    }
90
+
91
+    private function deletePreviews(OutputInterface $output, bool $dryMode): void {
92
+        $previewsToDeleteCount = 0;
93
+
94
+        foreach ($this->getPreviewsToDelete() as ['name' => $previewFileId, 'path' => $filePath]) {
95
+            $output->writeln('Deleting previews for ' . $filePath, OutputInterface::VERBOSITY_VERBOSE);
96
+
97
+            $previewsToDeleteCount++;
98
+
99
+            if ($dryMode) {
100
+                continue;
101
+            }
102
+
103
+            try {
104
+                $preview = $this->previewFolder->getFolder((string)$previewFileId);
105
+                $preview->delete();
106
+            } catch (NotFoundException $e) {
107
+                // continue
108
+            } catch (NotPermittedException $e) {
109
+                // continue
110
+            }
111
+        }
112
+
113
+        $output->writeln('Deleted ' . $previewsToDeleteCount . ' previews');
114
+    }
115
+
116
+    // Copy pasted and adjusted from
117
+    // "lib/private/Preview/BackgroundCleanupJob.php".
118
+    private function getPreviewsToDelete(): \Iterator {
119
+        $qb = $this->connection->getQueryBuilder();
120
+        $qb->select('path', 'mimetype')
121
+            ->from('filecache')
122
+            ->where($qb->expr()->eq('fileid', $qb->createNamedParameter($this->previewFolder->getId())));
123
+        $cursor = $qb->executeQuery();
124
+        $data = $cursor->fetch();
125
+        $cursor->closeCursor();
126
+
127
+        if ($data === null) {
128
+            return [];
129
+        }
130
+
131
+        /*
132 132
 		 * This lovely like is the result of the way the new previews are stored
133 133
 		 * We take the md5 of the name (fileid) and split the first 7 chars. That way
134 134
 		 * there are not a gazillion files in the root of the preview appdata.
135 135
 		 */
136
-		$like = $this->connection->escapeLikeParameter($data['path']) . '/_/_/_/_/_/_/_/%';
137
-
138
-		$qb = $this->connection->getQueryBuilder();
139
-		$qb->select('a.name', 'b.path')
140
-			->from('filecache', 'a')
141
-			->leftJoin('a', 'filecache', 'b', $qb->expr()->eq(
142
-				$qb->expr()->castColumn('a.name', IQueryBuilder::PARAM_INT), 'b.fileid'
143
-			))
144
-			->where(
145
-				$qb->expr()->andX(
146
-					$qb->expr()->like('a.path', $qb->createNamedParameter($like)),
147
-					$qb->expr()->eq('a.mimetype', $qb->createNamedParameter($this->mimeTypeLoader->getId('httpd/unix-directory'))),
148
-					$qb->expr()->orX(
149
-						$qb->expr()->eq('b.mimetype', $qb->createNamedParameter($this->mimeTypeLoader->getId('text/plain'))),
150
-						$qb->expr()->eq('b.mimetype', $qb->createNamedParameter($this->mimeTypeLoader->getId('text/markdown'))),
151
-						$qb->expr()->eq('b.mimetype', $qb->createNamedParameter($this->mimeTypeLoader->getId('text/x-markdown')))
152
-					)
153
-				)
154
-			);
155
-
156
-		$cursor = $qb->executeQuery();
157
-
158
-		while ($row = $cursor->fetch()) {
159
-			yield $row;
160
-		}
161
-
162
-		$cursor->closeCursor();
163
-	}
136
+        $like = $this->connection->escapeLikeParameter($data['path']) . '/_/_/_/_/_/_/_/%';
137
+
138
+        $qb = $this->connection->getQueryBuilder();
139
+        $qb->select('a.name', 'b.path')
140
+            ->from('filecache', 'a')
141
+            ->leftJoin('a', 'filecache', 'b', $qb->expr()->eq(
142
+                $qb->expr()->castColumn('a.name', IQueryBuilder::PARAM_INT), 'b.fileid'
143
+            ))
144
+            ->where(
145
+                $qb->expr()->andX(
146
+                    $qb->expr()->like('a.path', $qb->createNamedParameter($like)),
147
+                    $qb->expr()->eq('a.mimetype', $qb->createNamedParameter($this->mimeTypeLoader->getId('httpd/unix-directory'))),
148
+                    $qb->expr()->orX(
149
+                        $qb->expr()->eq('b.mimetype', $qb->createNamedParameter($this->mimeTypeLoader->getId('text/plain'))),
150
+                        $qb->expr()->eq('b.mimetype', $qb->createNamedParameter($this->mimeTypeLoader->getId('text/markdown'))),
151
+                        $qb->expr()->eq('b.mimetype', $qb->createNamedParameter($this->mimeTypeLoader->getId('text/x-markdown')))
152
+                    )
153
+                )
154
+            );
155
+
156
+        $cursor = $qb->executeQuery();
157
+
158
+        while ($row = $cursor->fetch()) {
159
+            yield $row;
160
+        }
161
+
162
+        $cursor->closeCursor();
163
+    }
164 164
 }
Please login to merge, or discard this patch.
apps/comments/lib/MaxAutoCompleteResultsInitialState.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -43,6 +43,6 @@
 block discarded – undo
43 43
 	}
44 44
 
45 45
 	public function getData(): int {
46
-		return (int)$this->config->getAppValue('comments', 'maxAutoCompleteResults', '10');
46
+		return (int) $this->config->getAppValue('comments', 'maxAutoCompleteResults', '10');
47 47
 	}
48 48
 }
Please login to merge, or discard this patch.
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -12,16 +12,16 @@
 block discarded – undo
12 12
 use OCP\IConfig;
13 13
 
14 14
 class MaxAutoCompleteResultsInitialState extends InitialStateProvider {
15
-	public function __construct(
16
-		private IConfig $config,
17
-	) {
18
-	}
15
+    public function __construct(
16
+        private IConfig $config,
17
+    ) {
18
+    }
19 19
 
20
-	public function getKey(): string {
21
-		return 'maxAutoCompleteResults';
22
-	}
20
+    public function getKey(): string {
21
+        return 'maxAutoCompleteResults';
22
+    }
23 23
 
24
-	public function getData(): int {
25
-		return (int)$this->config->getAppValue('comments', 'maxAutoCompleteResults', '10');
26
-	}
24
+    public function getData(): int {
25
+        return (int)$this->config->getAppValue('comments', 'maxAutoCompleteResults', '10');
26
+    }
27 27
 }
Please login to merge, or discard this patch.