Merge "output: Narrow Title type hint to LinkTarget"
[lhc/web/wiklou.git] / includes / filerepo / file / File.php
index d14e0de..60d4e29 100644 (file)
@@ -1172,6 +1172,7 @@ abstract class File implements IDBAccessObject {
                        $thumb = false;
                } elseif ( $thumb->isError() ) { // transform error
                        /** @var MediaTransformError $thumb */
+                       '@phan-var MediaTransformError $thumb';
                        $this->lastError = $thumb->toText();
                        // Ignore errors if requested
                        if ( $wgIgnoreImageErrors && !( $flags & self::RENDER_NOW ) ) {
@@ -1466,13 +1467,15 @@ abstract class File implements IDBAccessObject {
                // Delete thumbnails and refresh file metadata cache
                $this->purgeCache();
                $this->purgeDescription();
-
                // Purge cache of all pages using this file
                $title = $this->getTitle();
                if ( $title ) {
-                       DeferredUpdates::addUpdate(
-                               new HTMLCacheUpdate( $title, 'imagelinks', 'file-purge' )
+                       $job = HTMLCacheUpdateJob::newForBacklinks(
+                               $title,
+                               'imagelinks',
+                               [ 'causeAction' => 'file-purge' ]
                        );
+                       JobQueueGroup::singleton()->lazyPush( $job );
                }
        }