Skip to content

Commit 2994e18

Browse files
Merge pull request #3352 from nextcloud/chore/deps/update-nextcloud-ocp-master
2 parents d5e5ee3 + 8b8a18b commit 2994e18

24 files changed

+506
-545
lines changed

composer.lock

+14-14
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/ACL/ACLStorageWrapper.php

+29-29
Original file line numberDiff line numberDiff line change
@@ -43,33 +43,33 @@ private function checkPermissions(string $path, int $permissions): bool {
4343
return ($this->getACLPermissionsForPath($path) & $permissions) === $permissions;
4444
}
4545

46-
public function isReadable($path): bool {
46+
public function isReadable(string $path): bool {
4747
return $this->checkPermissions($path, Constants::PERMISSION_READ) && parent::isReadable($path);
4848
}
4949

50-
public function isUpdatable($path): bool {
50+
public function isUpdatable(string $path): bool {
5151
return $this->checkPermissions($path, Constants::PERMISSION_UPDATE) && parent::isUpdatable($path);
5252
}
5353

54-
public function isCreatable($path): bool {
54+
public function isCreatable(string $path): bool {
5555
return $this->checkPermissions($path, Constants::PERMISSION_CREATE) && parent::isCreatable($path);
5656
}
5757

58-
public function isDeletable($path): bool {
58+
public function isDeletable(string $path): bool {
5959
return $this->checkPermissions($path, Constants::PERMISSION_DELETE)
6060
&& $this->canDeleteTree($path)
6161
&& parent::isDeletable($path);
6262
}
6363

64-
public function isSharable($path): bool {
64+
public function isSharable(string $path): bool {
6565
return $this->checkPermissions($path, Constants::PERMISSION_SHARE) && parent::isSharable($path);
6666
}
6767

68-
public function getPermissions($path): int {
68+
public function getPermissions(string $path): int {
6969
return $this->storage->getPermissions($path) & $this->getACLPermissionsForPath($path);
7070
}
7171

72-
public function rename($source, $target): bool {
72+
public function rename(string $source, string $target): bool {
7373
if (str_starts_with($source, $target)) {
7474
$part = substr($source, strlen($target));
7575
//This is a rename of the transfer file to the original file
@@ -96,7 +96,7 @@ public function rename($source, $target): bool {
9696
parent::rename($source, $target);
9797
}
9898

99-
public function opendir($path) {
99+
public function opendir(string $path) {
100100
if (!$this->checkPermissions($path, Constants::PERMISSION_READ)) {
101101
return false;
102102
}
@@ -118,29 +118,29 @@ public function opendir($path) {
118118
return IteratorDirectory::wrap($items);
119119
}
120120

121-
public function copy($source, $target): bool {
121+
public function copy(string $source, string $target): bool {
122122
$permissions = $this->file_exists($target) ? Constants::PERMISSION_UPDATE : Constants::PERMISSION_CREATE;
123123
return $this->checkPermissions($target, $permissions) &&
124124
$this->checkPermissions($source, Constants::PERMISSION_READ) &&
125125
parent::copy($source, $target);
126126
}
127127

128-
public function touch($path, $mtime = null): bool {
128+
public function touch(string $path, ?int $mtime = null): bool {
129129
$permissions = $this->file_exists($path) ? Constants::PERMISSION_UPDATE : Constants::PERMISSION_CREATE;
130130
return $this->checkPermissions($path, $permissions) && parent::touch($path, $mtime);
131131
}
132132

133-
public function mkdir($path): bool {
133+
public function mkdir(string $path): bool {
134134
return $this->checkPermissions($path, Constants::PERMISSION_CREATE) && parent::mkdir($path);
135135
}
136136

137-
public function rmdir($path): bool {
137+
public function rmdir(string $path): bool {
138138
return $this->checkPermissions($path, Constants::PERMISSION_DELETE)
139139
&& $this->canDeleteTree($path)
140140
&& parent::rmdir($path);
141141
}
142142

143-
public function unlink($path): bool {
143+
public function unlink(string $path): bool {
144144
return $this->checkPermissions($path, Constants::PERMISSION_DELETE)
145145
&& $this->canDeleteTree($path)
146146
&& parent::unlink($path);
@@ -154,12 +154,12 @@ private function canDeleteTree(string $path): int {
154154
return $this->aclManager->getPermissionsForTree($path) & Constants::PERMISSION_DELETE;
155155
}
156156

157-
public function file_put_contents($path, $data): int|float|false {
157+
public function file_put_contents(string $path, mixed $data): int|float|false {
158158
$permissions = $this->file_exists($path) ? Constants::PERMISSION_UPDATE : Constants::PERMISSION_CREATE;
159159
return $this->checkPermissions($path, $permissions) ? parent::file_put_contents($path, $data) : false;
160160
}
161161

162-
public function fopen($path, $mode) {
162+
public function fopen(string $path, string $mode) {
163163
if ($mode === 'r' or $mode === 'rb') {
164164
$permissions = Constants::PERMISSION_READ;
165165
} else {
@@ -189,7 +189,7 @@ public function getCache($path = '', $storage = null): ICache {
189189
return new ACLCacheWrapper($sourceCache, $this->aclManager, $this->inShare);
190190
}
191191

192-
public function getMetaData($path): ?array {
192+
public function getMetaData(string $path): ?array {
193193
$data = parent::getMetaData($path);
194194

195195
if ($data && isset($data['permissions'])) {
@@ -213,94 +213,94 @@ public function getScanner($path = '', $storage = null): IScanner {
213213
return parent::getScanner($path, $storage);
214214
}
215215

216-
public function is_dir($path): bool {
216+
public function is_dir(string $path): bool {
217217
return $this->checkPermissions($path, Constants::PERMISSION_READ) &&
218218
parent::is_dir($path);
219219
}
220220

221-
public function is_file($path): bool {
221+
public function is_file(string $path): bool {
222222
return $this->checkPermissions($path, Constants::PERMISSION_READ) &&
223223
parent::is_file($path);
224224
}
225225

226-
public function stat($path): array|false {
226+
public function stat(string $path): array|false {
227227
if (!$this->checkPermissions($path, Constants::PERMISSION_READ)) {
228228
return false;
229229
}
230230

231231
return parent::stat($path);
232232
}
233233

234-
public function filetype($path): string|false {
234+
public function filetype(string $path): string|false {
235235
if (!$this->checkPermissions($path, Constants::PERMISSION_READ)) {
236236
return false;
237237
}
238238

239239
return parent::filetype($path);
240240
}
241241

242-
public function filesize($path): false|int|float {
242+
public function filesize(string $path): false|int|float {
243243
if (!$this->checkPermissions($path, Constants::PERMISSION_READ)) {
244244
return false;
245245
}
246246

247247
return parent::filesize($path);
248248
}
249249

250-
public function file_exists($path): bool {
250+
public function file_exists(string $path): bool {
251251
return $this->checkPermissions($path, Constants::PERMISSION_READ) &&
252252
parent::file_exists($path);
253253
}
254254

255-
public function filemtime($path): int|false {
255+
public function filemtime(string $path): int|false {
256256
if (!$this->checkPermissions($path, Constants::PERMISSION_READ)) {
257257
return false;
258258
}
259259

260260
return parent::filemtime($path);
261261
}
262262

263-
public function file_get_contents($path): string|false {
263+
public function file_get_contents(string $path): string|false {
264264
if (!$this->checkPermissions($path, Constants::PERMISSION_READ)) {
265265
return false;
266266
}
267267

268268
return parent::file_get_contents($path);
269269
}
270270

271-
public function getMimeType($path): string|false {
271+
public function getMimeType(string $path): string|false {
272272
if (!$this->checkPermissions($path, Constants::PERMISSION_READ)) {
273273
return false;
274274
}
275275

276276
return parent::getMimeType($path);
277277
}
278278

279-
public function hash($type, $path, $raw = false): string|false {
279+
public function hash(string $type, string $path, bool $raw = false): string|false {
280280
if (!$this->checkPermissions($path, Constants::PERMISSION_READ)) {
281281
return false;
282282
}
283283

284284
return parent::hash($type, $path, $raw);
285285
}
286286

287-
public function getETag($path): string|false {
287+
public function getETag(string $path): string|false {
288288
if (!$this->checkPermissions($path, Constants::PERMISSION_READ)) {
289289
return false;
290290
}
291291

292292
return parent::getETag($path);
293293
}
294294

295-
public function getDirectDownload($path): array|false {
295+
public function getDirectDownload(string $path): array|false {
296296
if (!$this->checkPermissions($path, Constants::PERMISSION_READ)) {
297297
return false;
298298
}
299299

300300
return parent::getDirectDownload($path);
301301
}
302302

303-
public function getDirectoryContent($directory): \Traversable {
303+
public function getDirectoryContent(string $directory): \Traversable {
304304
$content = $this->getWrapperStorage()->getDirectoryContent($directory);
305305
foreach ($content as $data) {
306306
$data['scan_permissions'] ??= $data['permissions'];

lib/Command/Trashbin/Cleanup.php

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
use OCA\GroupFolders\Trash\TrashBackend;
1414
use OCP\App\IAppManager;
1515
use OCP\Server;
16+
use Symfony\Component\Console\Helper\QuestionHelper;
1617
use Symfony\Component\Console\Input\InputArgument;
1718
use Symfony\Component\Console\Input\InputInterface;
1819
use Symfony\Component\Console\Input\InputOption;
@@ -46,6 +47,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
4647
return -1;
4748
}
4849

50+
/** @var QuestionHelper $helper */
4951
$helper = $this->getHelper('question');
5052

5153
$folders = $this->folderManager->getAllFolders();

lib/Mount/GroupFolderStorage.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function getFolderId(): int {
3838
return $this->folderId;
3939
}
4040

41-
public function getOwner($path): string|false {
41+
public function getOwner(string $path): string|false {
4242
$user = $this->userSession->getUser();
4343
if ($user !== null) {
4444
return $user->getUID();

lib/Mount/RootPermissionsMask.php

+6-6
Original file line numberDiff line numberDiff line change
@@ -37,47 +37,47 @@ private function checkMask(int $permissions): bool {
3737
return ($this->mask & $permissions) === $permissions;
3838
}
3939

40-
public function isUpdatable($path): bool {
40+
public function isUpdatable(string $path): bool {
4141
if ($path === '') {
4242
return $this->checkMask(Constants::PERMISSION_UPDATE) and parent::isUpdatable($path);
4343
} else {
4444
return parent::isUpdatable($path);
4545
}
4646
}
4747

48-
public function isCreatable($path): bool {
48+
public function isCreatable(string $path): bool {
4949
if ($path === '') {
5050
return $this->checkMask(Constants::PERMISSION_CREATE) and parent::isCreatable($path);
5151
} else {
5252
return parent::isCreatable($path);
5353
}
5454
}
5555

56-
public function isDeletable($path): bool {
56+
public function isDeletable(string $path): bool {
5757
if ($path === '') {
5858
return $this->checkMask(Constants::PERMISSION_DELETE) and parent::isDeletable($path);
5959
} else {
6060
return parent::isDeletable($path);
6161
}
6262
}
6363

64-
public function isSharable($path): bool {
64+
public function isSharable(string $path): bool {
6565
if ($path === '') {
6666
return $this->checkMask(Constants::PERMISSION_SHARE) and parent::isSharable($path);
6767
} else {
6868
return parent::isSharable($path);
6969
}
7070
}
7171

72-
public function getPermissions($path): int {
72+
public function getPermissions(string $path): int {
7373
if ($path === '') {
7474
return $this->storage->getPermissions($path) & $this->mask;
7575
} else {
7676
return $this->storage->getPermissions($path);
7777
}
7878
}
7979

80-
public function getMetaData($path): ?array {
80+
public function getMetaData(string $path): ?array {
8181
$data = parent::getMetaData($path);
8282

8383
if ($data && $path === '' && isset($data['permissions'])) {

tests/stubs/doctrine_dbal_schema_abstractasset.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
* The abstract asset allows to reset the name of all assets without publishing this to the public userland.
2121
*
2222
* This encapsulation hack is necessary to keep a consistent state of the database schema. Say we have a list of tables
23-
* array($tableName => Table($tableName)); if you want to rename the table, you have to make sure
23+
* array($tableName => Table($tableName)); if you want to rename the table, you have to make sure this does not get
24+
* recreated during schema migration.
2425
*/
2526
abstract class AbstractAsset
2627
{

tests/stubs/oc_core_command_base.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public function cancelOperation(): void
6565
{
6666
}
6767

68-
public function run(InputInterface $input, OutputInterface $output)
68+
public function run(InputInterface $input, OutputInterface $output): int
6969
{
7070
}
7171

0 commit comments

Comments
 (0)