Merge "Fix 'Tags' padding to keep it farther from the edge and document the source...
[lhc/web/wiklou.git] / includes / filerepo / file / LocalFile.php
index 1702264..e86f292 100644 (file)
@@ -583,9 +583,9 @@ class LocalFile extends File {
                        ->getComment( 'description', (object)$decoded )->text;
 
                $decoded['user'] = User::newFromAnyId(
-                       isset( $decoded['user'] ) ? $decoded['user'] : null,
-                       isset( $decoded['user_text'] ) ? $decoded['user_text'] : null,
-                       isset( $decoded['actor'] ) ? $decoded['actor'] : null
+                       $decoded['user'] ?? null,
+                       $decoded['user_text'] ?? null,
+                       $decoded['actor'] ?? null
                );
                unset( $decoded['user_text'], $decoded['actor'] );
 
@@ -772,9 +772,9 @@ class LocalFile extends File {
 
                if ( isset( $info['user'] ) || isset( $info['user_text'] ) || isset( $info['actor'] ) ) {
                        $this->user = User::newFromAnyId(
-                               isset( $info['user'] ) ? $info['user'] : null,
-                               isset( $info['user_text'] ) ? $info['user_text'] : null,
-                               isset( $info['actor'] ) ? $info['actor'] : null
+                               $info['user'] ?? null,
+                               $info['user_text'] ?? null,
+                               $info['actor'] ?? null
                        );
                }
 
@@ -2208,7 +2208,7 @@ class LocalFile extends File {
 
                // If extra data (metadata) was not loaded then it must have been large
                return $this->extraDataLoaded
-               && strlen( serialize( $this->metadata ) ) <= self::CACHE_FIELD_MAX_LEN;
+                       && strlen( serialize( $this->metadata ) ) <= self::CACHE_FIELD_MAX_LEN;
        }
 
        /**
@@ -2216,9 +2216,9 @@ class LocalFile extends File {
         * @since 1.28
         */
        public function acquireFileLock() {
-               return $this->getRepo()->getBackend()->lockFiles(
+               return Status::wrap( $this->getRepo()->getBackend()->lockFiles(
                        [ $this->getPath() ], LockManager::LOCK_EX, 10
-               );
+               ) );
        }
 
        /**
@@ -2226,9 +2226,9 @@ class LocalFile extends File {
         * @since 1.28
         */
        public function releaseFileLock() {
-               return $this->getRepo()->getBackend()->unlockFiles(
+               return Status::wrap( $this->getRepo()->getBackend()->unlockFiles(
                        [ $this->getPath() ], LockManager::LOCK_EX
-               );
+               ) );
        }
 
        /**