Skip to content

Commit fac3016

Browse files
committed
refactor: Apply rector changes
Signed-off-by: provokateurin <kate@provokateurin.de>
1 parent f5c50ce commit fac3016

File tree

6 files changed

+16
-21
lines changed

6 files changed

+16
-21
lines changed

β€Žlib/ACL/ACLManager.phpβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ public function getPermissionsForPathFromRules(int $folderId, string $path, arra
164164
}
165165
}
166166

167-
uksort($filteredRules, static fn (string $a, string $b) => strlen($a) <=> strlen($b));
167+
uksort($filteredRules, static fn (string $a, string $b): int => strlen($a) <=> strlen($b));
168168

169169
return $this->calculatePermissionsForPath($folderId, $filteredRules);
170170
}

β€Žlib/ACL/RuleManager.phpβ€Ž

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ private function createRule(array $data): ?Rule {
3636
if ($mapping) {
3737
return new Rule(
3838
$mapping,
39-
(int)$data['fileid'],
40-
(int)$data['mask'],
41-
(int)$data['permissions']
39+
$data['fileid'],
40+
$data['mask'],
41+
$data['permissions']
4242
);
4343
}
4444

β€Žlib/Command/ExpireGroup/ExpireGroupBase.phpβ€Ž

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,6 @@
1616
* Base class for the group folder expiration commands.
1717
*/
1818
class ExpireGroupBase extends Base {
19-
public function __construct() {
20-
parent::__construct();
21-
}
22-
2319
#[\Override]
2420
protected function configure(): void {
2521
$this

β€Žlib/Command/ListCommand.phpβ€Ž

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ protected function execute(InputInterface $input, OutputInterface $output): int
8888
$folder['size'] = $folder['root_cache_entry']->getSize();
8989
unset($folder['root_cache_entry']);
9090
$folder['groups_list'] = array_map(fn (array $group): int => $group['permissions'], $folder['groups']);
91-
$folder['options'] = $folder['options'];
9291
$folder['mountPoint'] = $folder['mount_point'];
9392
unset($folder['mount_point']);
9493
$folder['rootId'] = $folder['root_id'];

β€Žlib/Folder/FolderManager.phpβ€Ž

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ public function getAllFoldersWithSize(int $offset = 0, ?int $limit = null, strin
159159
/** @var list<array{folder_id: int, mount_point: string, quota: int, acl: bool, acl_default_no_permission: bool, storage_id: int, root_id: int, options: string}> $rows */
160160
$rows = $query->executeQuery()->fetchAll();
161161

162-
$folderIds = array_map(static fn (array $row): int => (int)$row['folder_id'], $rows);
162+
$folderIds = array_map(static fn (array $row): int => $row['folder_id'], $rows);
163163
$applicableMap = $this->getAllApplicable($folderIds);
164164
$folderMappings = $this->getAllFolderMappings($folderIds);
165165

@@ -200,7 +200,7 @@ public function getAllFoldersForUserWithSize(IUser $user): array {
200200
/** @var list<array{folder_id: int, mount_point: string, quota: int, acl: bool, acl_default_no_permission: bool, storage_id: int, root_id: int, options: string}> $rows */
201201
$rows = $query->executeQuery()->fetchAll();
202202

203-
$folderIds = array_map(static fn (array $row): int => (int)$row['folder_id'], $rows);
203+
$folderIds = array_map(static fn (array $row): int => $row['folder_id'], $rows);
204204
$applicableMap = $this->getAllApplicable($folderIds);
205205
$folderMappings = $this->getAllFolderMappings($folderIds);
206206

@@ -544,7 +544,7 @@ public function searchGroups(int $id, string $search = ''): array {
544544
return $groups;
545545
}
546546

547-
return array_values(array_filter($groups, fn (array $group): bool => (stripos($group['gid'], $search) !== false) || (stripos($group['displayname'], $search) !== false)));
547+
return array_values(array_filter($groups, fn (array $group): bool => (stripos((string)$group['gid'], $search) !== false) || (stripos((string)$group['displayname'], $search) !== false)));
548548
}
549549

550550
/**
@@ -557,7 +557,7 @@ public function searchCircles(int $id, string $search = ''): array {
557557
return $circles;
558558
}
559559

560-
return array_values(array_filter($circles, fn (array $circle): bool => (stripos($circle['displayname'], $search) !== false)));
560+
return array_values(array_filter($circles, fn (array $circle): bool => (stripos((string)$circle['displayname'], $search) !== false)));
561561
}
562562

563563
/**
@@ -700,7 +700,7 @@ public function getFoldersForGroups(array $groupIds, ?int $folderId = null, ?arr
700700
return FolderDefinitionWithPermissions::fromFolder(
701701
$folder,
702702
Cache::cacheEntryFromData($row, $this->mimeTypeLoader),
703-
(int)$row['group_permissions']
703+
$row['group_permissions']
704704
);
705705
}, $result);
706706
}

β€Žlib/Trash/TrashManager.phpβ€Ž

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ public function listTrashForFolders(array $folderIds): array {
3333
$rows = $query->executeQuery()->fetchAll();
3434

3535
return array_map(fn (array $row): array => [
36-
'trash_id' => (int)$row['trash_id'],
37-
'name' => (string)$row['name'],
38-
'deleted_time' => (int)$row['deleted_time'],
39-
'original_location' => (string)$row['original_location'],
40-
'folder_id' => (int)$row['folder_id'],
41-
'file_id' => $row['file_id'] !== null ? (int)$row['file_id'] : null,
42-
'deleted_by' => $row['deleted_by'] !== null ? (string)$row['deleted_by'] : null,
36+
'trash_id' => $row['trash_id'],
37+
'name' => $row['name'],
38+
'deleted_time' => $row['deleted_time'],
39+
'original_location' => $row['original_location'],
40+
'folder_id' => $row['folder_id'],
41+
'file_id' => $row['file_id'] ?? null,
42+
'deleted_by' => $row['deleted_by'] ?? null,
4343
], $rows);
4444
}
4545

0 commit comments

Comments
Β (0)