Skip to content

Commit

Permalink
Merge pull request #26494 from rigrig/fix-php8-deprecations
Browse files Browse the repository at this point in the history
Fix some php 8 warnings
  • Loading branch information
MorrisJobke authored Jun 7, 2021
2 parents ae4907b + 7990f95 commit 2ae60b4
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion apps/files/lib/Helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ public static function getFiles($dir, $sortAttribute = 'name', $sortDescending =
* @param ITagManager $tagManager
* @return array file list populated with tags
*/
public static function populateTags(array $fileList, $fileIdentifier = 'fileid', ITagManager $tagManager) {
public static function populateTags(array $fileList, $fileIdentifier, ITagManager $tagManager) {
$ids = [];
foreach ($fileList as $fileData) {
$ids[] = $fileData[$fileIdentifier];
Expand Down
4 changes: 2 additions & 2 deletions core/Controller/PreviewController.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,8 @@ private function fetchPreview(
Node $node,
int $x,
int $y,
bool $a = false,
bool $forceIcon = true,
bool $a,
bool $forceIcon,
string $mode) : Http\Response {
if (!($node instanceof File) || (!$forceIcon && !$this->preview->isAvailable($node))) {
return new DataResponse([], Http::STATUS_NOT_FOUND);
Expand Down
2 changes: 1 addition & 1 deletion lib/private/Files/Config/CachedMountFileInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class CachedMountFileInfo extends CachedMountInfo implements ICachedMountFileInf
/** @var string */
private $internalPath;

public function __construct(IUser $user, $storageId, $rootId, $mountPoint, $mountId = null, $rootInternalPath = '', $internalPath) {
public function __construct(IUser $user, $storageId, $rootId, $mountPoint, $mountId, $rootInternalPath, $internalPath) {
parent::__construct($user, $storageId, $rootId, $mountPoint, $mountId, $rootInternalPath);
$this->internalPath = $internalPath;
}
Expand Down
8 changes: 6 additions & 2 deletions lib/private/Files/View.php
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,9 @@ public function filesize($path) {
*/
public function readfile($path) {
$this->assertPathLength($path);
@ob_end_clean();
if (ob_get_level()) {
ob_end_clean();
}
$handle = $this->fopen($path, 'rb');
if ($handle) {
$chunkSize = 524288; // 512 kB chunks
Expand All @@ -445,7 +447,9 @@ public function readfile($path) {
*/
public function readfilePart($path, $from, $to) {
$this->assertPathLength($path);
@ob_end_clean();
if (ob_get_level()) {
ob_end_clean();
}
$handle = $this->fopen($path, 'rb');
if ($handle) {
$chunkSize = 524288; // 512 kB chunks
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public function setHeaderActions(array $actions) {
$this->headerActions[] = $action;
}
usort($this->headerActions, function (IMenuAction $a, IMenuAction $b) {
return $a->getPriority() > $b->getPriority();
return $a->getPriority() <=> $b->getPriority();
});
}

Expand Down

0 comments on commit 2ae60b4

Please sign in to comment.