File tree Expand file tree Collapse file tree 9 files changed +17
-20
lines changed
apps/files_trashbin/lib/Trash Expand file tree Collapse file tree 9 files changed +17
-20
lines changed Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ public function getPath() {
7070 return $ this ->fileInfo ->getPath ();
7171 }
7272
73- public function getMimetype () {
73+ public function getMimetype (): string {
7474 return $ this ->fileInfo ->getMimetype ();
7575 }
7676
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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 /**
Original file line number Diff line number Diff 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 }
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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 {
Original file line number Diff line number Diff line change 88namespace OCP \Files \Cache ;
99
1010use ArrayAccess ;
11+ use OCP \AppFramework \Attribute \Consumable ;
1112
1213/**
1314 * meta data for a file or folder
1920 * implemented it in the private implementation. Hence php would allow using the
2021 * object as array, while strictly speaking it didn't support this.
2122 */
23+ #[Consumable(since: '9.0.0 ' )]
2224interface ICacheEntry extends ArrayAccess {
2325 /**
2426 * @since 9.0.0
@@ -60,10 +62,9 @@ public function getName();
6062 /**
6163 * Get the full mimetype
6264 *
63- * @return string
6465 * @since 9.0.0
6566 */
66- public function getMimeType ();
67+ public function getMimeType (): string ;
6768
6869 /**
6970 * Get the first part of the mimetype
Original file line number Diff line number Diff line change 1010
1111namespace OCP \Files ;
1212
13+ use OCP \AppFramework \Attribute \Consumable ;
1314use OCP \Lock \LockedException ;
1415
1516/**
1617 * Interface File
1718 *
1819 * @since 6.0.0
1920 */
21+ #[Consumable(since: '6.0.0 ' )]
2022interface File extends Node {
2123 /**
2224 * Get the content of the file as string
@@ -43,10 +45,9 @@ public function putContent($data);
4345 /**
4446 * Get the mimetype of the file
4547 *
46- * @return string
4748 * @since 6.0.0
4849 */
49- public function getMimeType ();
50+ public function getMimeType (): string ;
5051
5152 /**
5253 * Open the file as stream, resulting resource can be operated as stream like the result from php's own fopen
Original file line number Diff line number Diff line change 77 */
88namespace OCP \Files ;
99
10+ use OCP \AppFramework \Attribute \Consumable ;
1011use OCP \Files \Storage \IStorage ;
1112
1213/**
1314 * Interface FileInfo
1415 *
1516 * @since 7.0.0
1617 */
18+ #[Consumable(since: '7.0.0 ' )]
1719interface FileInfo {
1820 /**
1921 * @since 7.0.0
@@ -103,10 +105,9 @@ public function getPath();
103105 /**
104106 * Get the full mimetype of the file or folder i.e. 'image/png'
105107 *
106- * @return string
107108 * @since 7.0.0
108109 */
109- public function getMimetype ();
110+ public function getMimetype (): string ;
110111
111112 /**
112113 * Get the first part of the mimetype of the file or folder i.e. 'image'
You can’t perform that action at this time.
0 commit comments