Skip to content
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_trashbin/lib/Trash/TrashItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public function getPath() {
return $this->fileInfo->getPath();
}

public function getMimetype() {
public function getMimetype(): string {
return $this->fileInfo->getMimetype();
}

Expand Down
4 changes: 2 additions & 2 deletions lib/private/Files/Cache/CacheEntry.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ public function getName() {
}


public function getMimeType() {
return $this->data['mimetype'];
public function getMimeType(): string {
return $this->data['mimetype'] ?? 'application/octet-stream';
}


Expand Down
7 changes: 2 additions & 5 deletions lib/private/Files/FileInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,8 @@ public function getId() {
return isset($this->data['fileid']) ? (int)$this->data['fileid'] : null;
}

/**
* @return string
*/
public function getMimetype() {
return $this->data['mimetype'];
public function getMimetype(): string {
return $this->data['mimetype'] ?? 'application/octet-stream';
}

/**
Expand Down
5 changes: 1 addition & 4 deletions lib/private/Files/Node/LazyFolder.php
Original file line number Diff line number Diff line change
Expand Up @@ -314,10 +314,7 @@ public function getUserFolder($userId) {
return $this->__call(__FUNCTION__, func_get_args());
}

/**
* @inheritDoc
*/
public function getMimetype() {
public function getMimetype(): string {
if (isset($this->data['mimetype'])) {
return $this->data['mimetype'];
}
Expand Down
2 changes: 1 addition & 1 deletion lib/private/Files/Node/Node.php
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ public function isShared() {
return $this->getFileInfo(false)->isShared();
}

public function getMimeType() {
public function getMimeType(): string {
return $this->getFileInfo(false)->getMimetype();
}

Expand Down
2 changes: 1 addition & 1 deletion lib/private/Files/Node/NonExistingFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public function putContent($data) {
throw new NotFoundException();
}

public function getMimeType() {
public function getMimeType(): string {
if ($this->fileInfo) {
return parent::getMimeType();
} else {
Expand Down
3 changes: 1 addition & 2 deletions lib/public/Files/Cache/ICacheEntry.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,9 @@ public function getName();
/**
* Get the full mimetype
*
* @return string
* @since 9.0.0
*/
public function getMimeType();
public function getMimeType(): string;

/**
* Get the first part of the mimetype
Expand Down
3 changes: 1 addition & 2 deletions lib/public/Files/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,9 @@ public function putContent($data);
/**
* Get the mimetype of the file
*
* @return string
* @since 6.0.0
*/
public function getMimeType();
public function getMimeType(): string;

/**
* Open the file as stream, resulting resource can be operated as stream like the result from php's own fopen
Expand Down
3 changes: 1 addition & 2 deletions lib/public/Files/FileInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,9 @@ public function getPath();
/**
* Get the full mimetype of the file or folder i.e. 'image/png'
*
* @return string
* @since 7.0.0
*/
public function getMimetype();
public function getMimetype(): string;

/**
* Get the first part of the mimetype of the file or folder i.e. 'image'
Expand Down
Loading