Skip to content

Commit e9bba6a

Browse files
Merge pull request #58286 from nextcloud/fix/groupfolders-phpstan
Fix a bunch of typing issues to make PHPStan level 10 happy on groupfolders
2 parents b0e99d0 + 4eada2d commit e9bba6a

36 files changed

+400
-406
lines changed

apps/dav/lib/Connector/Sabre/File.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,13 @@ public function put($data) {
236236
// because we have no clue about the cause we can only throw back a 500/Internal Server Error
237237
throw new Exception($this->l10n->t('Could not write file contents'));
238238
}
239-
[$count, $result] = Files::streamCopy($data, $target, true);
239+
$count = stream_copy_to_stream($data, $target);
240+
if ($count === false) {
241+
$result = false;
242+
$count = 0;
243+
} else {
244+
$result = true;
245+
}
240246
fclose($target);
241247
}
242248
if ($result === false && $expected !== null) {

apps/dav/lib/Connector/Sabre/FilesPlugin.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -166,11 +166,6 @@ public function checkCopy($source, $target): void {
166166
return;
167167
}
168168

169-
// Ensure source exists
170-
$sourceNodeFileInfo = $sourceNode->getFileInfo();
171-
if ($sourceNodeFileInfo === null) {
172-
throw new NotFound($source . ' does not exist');
173-
}
174169
// Ensure the target name is valid
175170
try {
176171
[$targetPath, $targetName] = \Sabre\Uri\split($target);

0 commit comments

Comments
 (0)