Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some php 8 warnings #26494

Merged
merged 3 commits into from
Jun 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/files/lib/Helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,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 @@ -156,8 +156,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 @@ -31,7 +31,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 @@ -422,7 +422,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 @@ -446,7 +448,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 @@ -97,7 +97,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