From: Aaron Schulz Date: Wed, 15 Jul 2015 01:01:11 +0000 (-0700) Subject: Ignore some ScopedCallback IDE warnings X-Git-Tag: 1.31.0-rc.0~10739^2 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dmes_infos.php?a=commitdiff_plain;h=84c4e7597ee204e043057703e2a3353b91035a10;p=lhc%2Fweb%2Fwiklou.git Ignore some ScopedCallback IDE warnings Change-Id: Iefe24ee5dae90d70c2acaaae9dc5d44c1758d53a --- diff --git a/includes/api/ApiStashEdit.php b/includes/api/ApiStashEdit.php index 177b54654e..a66b356f56 100644 --- a/includes/api/ApiStashEdit.php +++ b/includes/api/ApiStashEdit.php @@ -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 ); diff --git a/includes/db/LoadMonitorMySQL.php b/includes/db/LoadMonitorMySQL.php index 7c4a35c542..dc009c67eb 100644 --- a/includes/db/LoadMonitorMySQL.php +++ b/includes/db/LoadMonitorMySQL.php @@ -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 ); } ); diff --git a/includes/filebackend/FileBackend.php b/includes/filebackend/FileBackend.php index b87e26d3fe..fa1c462647 100644 --- a/includes/filebackend/FileBackend.php +++ b/includes/filebackend/FileBackend.php @@ -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 ); } diff --git a/includes/media/SVG.php b/includes/media/SVG.php index 4377f751f0..1118598f88 100644 --- a/includes/media/SVG.php +++ b/includes/media/SVG.php @@ -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 ); diff --git a/includes/media/XMP.php b/includes/media/XMP.php index a838355e33..12550a59ef 100644 --- a/includes/media/XMP.php +++ b/includes/media/XMP.php @@ -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 )