Skip to content

Commit 0e403e6

Browse files
Merge pull request #55569 from nextcloud/backport/55564/stable31
2 parents a0fd631 + f5e3e97 commit 0e403e6

File tree

9 files changed

+11
-20
lines changed

9 files changed

+11
-20
lines changed

apps/files_trashbin/lib/Trash/TrashItem.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public function getPath() {
6969
return $this->fileInfo->getPath();
7070
}
7171

72-
public function getMimetype() {
72+
public function getMimetype(): string {
7373
return $this->fileInfo->getMimetype();
7474
}
7575

lib/private/Files/Cache/CacheEntry.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ public function getName() {
6565
}
6666

6767

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

7272

lib/private/Files/FileInfo.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -133,11 +133,8 @@ public function getId() {
133133
return isset($this->data['fileid']) ? (int)$this->data['fileid'] : null;
134134
}
135135

136-
/**
137-
* @return string
138-
*/
139-
public function getMimetype() {
140-
return $this->data['mimetype'];
136+
public function getMimetype(): string {
137+
return $this->data['mimetype'] ?? 'application/octet-stream';
141138
}
142139

143140
/**

lib/private/Files/Node/LazyFolder.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -314,10 +314,7 @@ public function getUserFolder($userId) {
314314
return $this->__call(__FUNCTION__, func_get_args());
315315
}
316316

317-
/**
318-
* @inheritDoc
319-
*/
320-
public function getMimetype() {
317+
public function getMimetype(): string {
321318
if (isset($this->data['mimetype'])) {
322319
return $this->data['mimetype'];
323320
}

lib/private/Files/Node/Node.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ public function isShared() {
339339
return $this->getFileInfo(false)->isShared();
340340
}
341341

342-
public function getMimeType() {
342+
public function getMimeType(): string {
343343
return $this->getFileInfo(false)->getMimetype();
344344
}
345345

lib/private/Files/Node/NonExistingFile.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ public function putContent($data) {
122122
throw new NotFoundException();
123123
}
124124

125-
public function getMimeType() {
125+
public function getMimeType(): string {
126126
if ($this->fileInfo) {
127127
return parent::getMimeType();
128128
} else {

lib/public/Files/Cache/ICacheEntry.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,9 @@ public function getName();
6060
/**
6161
* Get the full mimetype
6262
*
63-
* @return string
6463
* @since 9.0.0
6564
*/
66-
public function getMimeType();
65+
public function getMimeType(): string;
6766

6867
/**
6968
* Get the first part of the mimetype

lib/public/Files/File.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,9 @@ public function putContent($data);
4343
/**
4444
* Get the mimetype of the file
4545
*
46-
* @return string
4746
* @since 6.0.0
4847
*/
49-
public function getMimeType();
48+
public function getMimeType(): string;
5049

5150
/**
5251
* Open the file as stream, resulting resource can be operated as stream like the result from php's own fopen

lib/public/Files/FileInfo.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,9 @@ public function getPath();
103103
/**
104104
* Get the full mimetype of the file or folder i.e. 'image/png'
105105
*
106-
* @return string
107106
* @since 7.0.0
108107
*/
109-
public function getMimetype();
108+
public function getMimetype(): string;
110109

111110
/**
112111
* Get the first part of the mimetype of the file or folder i.e. 'image'

0 commit comments

Comments
 (0)