Fix and improve PHPDoc type hints in FileBackend and FileRepo
[lhc/web/wiklou.git] / includes / filerepo / file / File.php
index d4605d3..cfd1cf2 100644 (file)
@@ -268,7 +268,7 @@ abstract class File implements IDBAccessObject {
         * a two-part name, set the minor type to 'unknown'.
         *
         * @param string $mime "text/html" etc
-        * @return array ("text", "html") etc
+        * @return string[] ("text", "html") etc
         */
        public static function splitMime( $mime ) {
                if ( strpos( $mime, '/' ) !== false ) {
@@ -569,7 +569,7 @@ abstract class File implements IDBAccessObject {
         * format does not support that sort of thing, returns
         * an empty array.
         *
-        * @return array
+        * @return string[]
         * @since 1.23
         */
        public function getAvailableLanguages() {
@@ -1423,7 +1423,7 @@ abstract class File implements IDBAccessObject {
         * Get all thumbnail names previously generated for this file
         * STUB
         * Overridden by LocalFile
-        * @return array
+        * @return string[]
         */
        function getThumbnails() {
                return [];
@@ -1474,9 +1474,9 @@ abstract class File implements IDBAccessObject {
         * Return a fragment of the history of file.
         *
         * STUB
-        * @param int $limit Limit of rows to return
-        * @param string $start Only revisions older than $start will be returned
-        * @param string $end Only revisions newer than $end will be returned
+        * @param int|null $limit Limit of rows to return
+        * @param string|int|null $start Only revisions older than $start will be returned
+        * @param string|int|null $end Only revisions newer than $end will be returned
         * @param bool $inc Include the endpoints of the time range
         *
         * @return File[]
@@ -2099,9 +2099,9 @@ abstract class File implements IDBAccessObject {
         *   File::FOR_PUBLIC       to be displayed to all users
         *   File::FOR_THIS_USER    to be displayed to the given user
         *   File::RAW              get the description regardless of permissions
-        * @param User $user User object to check for, only if FOR_THIS_USER is
+        * @param User|null $user User object to check for, only if FOR_THIS_USER is
         *   passed to the $audience parameter
-        * @return string
+        * @return null|string
         */
        function getDescription( $audience = self::FOR_PUBLIC, User $user = null ) {
                return null;
@@ -2161,7 +2161,7 @@ abstract class File implements IDBAccessObject {
         * field of this file, if it's marked as deleted.
         * STUB
         * @param int $field
-        * @param User $user User object to check, or null to use $wgUser
+        * @param User|null $user User object to check, or null to use $wgUser
         * @return bool
         */
        function userCan( $field, User $user = null ) {
@@ -2177,7 +2177,7 @@ abstract class File implements IDBAccessObject {
        }
 
        /**
-        * @return array HTTP header name/value map to use for HEAD/GET request responses
+        * @return string[] HTTP header name/value map to use for HEAD/GET request responses
         * @since 1.30
         */
        function getContentHeaders() {