Ignore some ScopedCallback IDE warnings
authorAaron Schulz <aschulz@wikimedia.org>
Wed, 15 Jul 2015 01:01:11 +0000 (18:01 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Wed, 15 Jul 2015 21:13:42 +0000 (14:13 -0700)
Change-Id: Iefe24ee5dae90d70c2acaaae9dc5d44c1758d53a

includes/api/ApiStashEdit.php
includes/db/LoadMonitorMySQL.php
includes/filebackend/FileBackend.php
includes/media/SVG.php
includes/media/XMP.php

index 177b546..a66b356 100644 (file)
@@ -112,6 +112,7 @@ class ApiStashEdit extends ApiBase {
                if ( $user->pingLimiter( 'stashedit' ) ) {
                        $status = 'ratelimited';
                } elseif ( $wgMemc->lock( $key, 0, 30 ) ) {
+                       /** @noinspection PhpUnusedLocalVariableInspection */
                        $unlocker = new ScopedCallback( function() use ( $key ) {
                                global $wgMemc;
                                $wgMemc->unlock( $key );
index 7c4a35c..dc009c6 100644 (file)
@@ -79,6 +79,7 @@ class LoadMonitorMySQL implements LoadMonitor {
                if ( $this->mainCache->lock( $key, 0, 10 ) ) {
                        # Let this process alone update the cache value
                        $cache = $this->mainCache;
+                       /** @noinspection PhpUnusedLocalVariableInspection */
                        $unlocker = new ScopedCallback( function () use ( $cache, $key ) {
                                $cache->unlock( $key );
                        } );
index b87e26d..fa1c462 100644 (file)
@@ -380,6 +380,7 @@ abstract class FileBackend {
                                $op['headers']['Content-Disposition'] = $op['disposition'];
                        }
                }
+               /** @noinspection PhpUnusedLocalVariableInspection */
                $scope = $this->getScopedPHPBehaviorForOps(); // try to ignore client aborts
                return $this->doOperationsInternal( $ops, $opts );
        }
@@ -612,6 +613,7 @@ abstract class FileBackend {
                                $op['headers']['Content-Disposition'] = $op['disposition'];
                        }
                }
+               /** @noinspection PhpUnusedLocalVariableInspection */
                $scope = $this->getScopedPHPBehaviorForOps(); // try to ignore client aborts
                return $this->doQuickOperationsInternal( $ops );
        }
@@ -756,6 +758,7 @@ abstract class FileBackend {
                if ( empty( $params['bypassReadOnly'] ) && $this->isReadOnly() ) {
                        return Status::newFatal( 'backend-fail-readonly', $this->name, $this->readOnly );
                }
+               /** @noinspection PhpUnusedLocalVariableInspection */
                $scope = $this->getScopedPHPBehaviorForOps(); // try to ignore client aborts
                return $this->doPrepare( $params );
        }
@@ -785,6 +788,7 @@ abstract class FileBackend {
                if ( empty( $params['bypassReadOnly'] ) && $this->isReadOnly() ) {
                        return Status::newFatal( 'backend-fail-readonly', $this->name, $this->readOnly );
                }
+               /** @noinspection PhpUnusedLocalVariableInspection */
                $scope = $this->getScopedPHPBehaviorForOps(); // try to ignore client aborts
                return $this->doSecure( $params );
        }
@@ -816,6 +820,7 @@ abstract class FileBackend {
                if ( empty( $params['bypassReadOnly'] ) && $this->isReadOnly() ) {
                        return Status::newFatal( 'backend-fail-readonly', $this->name, $this->readOnly );
                }
+               /** @noinspection PhpUnusedLocalVariableInspection */
                $scope = $this->getScopedPHPBehaviorForOps(); // try to ignore client aborts
                return $this->doPublish( $params );
        }
@@ -840,6 +845,7 @@ abstract class FileBackend {
                if ( empty( $params['bypassReadOnly'] ) && $this->isReadOnly() ) {
                        return Status::newFatal( 'backend-fail-readonly', $this->name, $this->readOnly );
                }
+               /** @noinspection PhpUnusedLocalVariableInspection */
                $scope = $this->getScopedPHPBehaviorForOps(); // try to ignore client aborts
                return $this->doClean( $params );
        }
index 4377f75..1118598 100644 (file)
@@ -205,6 +205,7 @@ class SvgHandler extends ImageHandler {
                $tmpDir = wfTempDir() . '/svg_' . wfRandomString( 24 );
                $lnPath = "$tmpDir/" . basename( $srcPath );
                $ok = mkdir( $tmpDir, 0771 ) && symlink( $srcPath, $lnPath );
+               /** @noinspection PhpUnusedLocalVariableInspection */
                $cleaner = new ScopedCallback( function () use ( $tmpDir, $lnPath ) {
                        MediaWiki\suppressWarnings();
                        unlink( $lnPath );
index a838355..12550a5 100644 (file)
@@ -525,6 +525,7 @@ class XMPReader implements LoggerAwareInterface {
                );
 
                $oldDisable = libxml_disable_entity_loader( true );
+               /** @noinspection PhpUnusedLocalVariableInspection */
                $reset = new ScopedCallback(
                        'libxml_disable_entity_loader',
                        array( $oldDisable )