Skip to content

Commit 2ae60b4

Browse files
authored
Merge pull request #26494 from rigrig/fix-php8-deprecations
Fix some php 8 warnings
2 parents ae4907b + 7990f95 commit 2ae60b4

File tree

5 files changed

+11
-7
lines changed

5 files changed

+11
-7
lines changed

apps/files/lib/Helper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ public static function getFiles($dir, $sortAttribute = 'name', $sortDescending =
216216
* @param ITagManager $tagManager
217217
* @return array file list populated with tags
218218
*/
219-
public static function populateTags(array $fileList, $fileIdentifier = 'fileid', ITagManager $tagManager) {
219+
public static function populateTags(array $fileList, $fileIdentifier, ITagManager $tagManager) {
220220
$ids = [];
221221
foreach ($fileList as $fileData) {
222222
$ids[] = $fileData[$fileIdentifier];

core/Controller/PreviewController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,8 @@ private function fetchPreview(
155155
Node $node,
156156
int $x,
157157
int $y,
158-
bool $a = false,
159-
bool $forceIcon = true,
158+
bool $a,
159+
bool $forceIcon,
160160
string $mode) : Http\Response {
161161
if (!($node instanceof File) || (!$forceIcon && !$this->preview->isAvailable($node))) {
162162
return new DataResponse([], Http::STATUS_NOT_FOUND);

lib/private/Files/Config/CachedMountFileInfo.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class CachedMountFileInfo extends CachedMountInfo implements ICachedMountFileInf
3030
/** @var string */
3131
private $internalPath;
3232

33-
public function __construct(IUser $user, $storageId, $rootId, $mountPoint, $mountId = null, $rootInternalPath = '', $internalPath) {
33+
public function __construct(IUser $user, $storageId, $rootId, $mountPoint, $mountId, $rootInternalPath, $internalPath) {
3434
parent::__construct($user, $storageId, $rootId, $mountPoint, $mountId, $rootInternalPath);
3535
$this->internalPath = $internalPath;
3636
}

lib/private/Files/View.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,9 @@ public function filesize($path) {
421421
*/
422422
public function readfile($path) {
423423
$this->assertPathLength($path);
424-
@ob_end_clean();
424+
if (ob_get_level()) {
425+
ob_end_clean();
426+
}
425427
$handle = $this->fopen($path, 'rb');
426428
if ($handle) {
427429
$chunkSize = 524288; // 512 kB chunks
@@ -445,7 +447,9 @@ public function readfile($path) {
445447
*/
446448
public function readfilePart($path, $from, $to) {
447449
$this->assertPathLength($path);
448-
@ob_end_clean();
450+
if (ob_get_level()) {
451+
ob_end_clean();
452+
}
449453
$handle = $this->fopen($path, 'rb');
450454
if ($handle) {
451455
$chunkSize = 524288; // 512 kB chunks

lib/public/AppFramework/Http/Template/PublicTemplateResponse.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public function setHeaderActions(array $actions) {
9696
$this->headerActions[] = $action;
9797
}
9898
usort($this->headerActions, function (IMenuAction $a, IMenuAction $b) {
99-
return $a->getPriority() > $b->getPriority();
99+
return $a->getPriority() <=> $b->getPriority();
100100
});
101101
}
102102

0 commit comments

Comments
 (0)