docs: closure -> Closure; callback -> callable
authorumherirrender <umherirrender_de.wp@web.de>
Sat, 19 Apr 2014 06:43:31 +0000 (08:43 +0200)
committerumherirrender <umherirrender_de.wp@web.de>
Sat, 19 Apr 2014 06:43:31 +0000 (08:43 +0200)
Changed closure to capital word Closure in doc and type hint,
also changed callback in docs to callable

Change-Id: I52c8e8f13d38a837052101c38b9986be780ca057

includes/Import.php
includes/deferred/CallableUpdate.php
includes/filebackend/FileBackendStore.php
includes/objectcache/APCBagOStuff.php
includes/objectcache/BagOStuff.php
includes/objectcache/EmptyBagOStuff.php
includes/objectcache/MultiWriteBagOStuff.php
includes/objectcache/SqlBagOStuff.php
includes/objectcache/XCacheBagOStuff.php
includes/parser/Parser.php
tests/phpunit/includes/libs/GenericArrayObjectTest.php

index b18e257..6150ae1 100644 (file)
@@ -105,8 +105,8 @@ class WikiImporter {
        /**
         * Set a callback that displays notice messages
         *
-        * @param $callback callback
-        * @return callback
+        * @param callable $callback
+        * @return callable
         */
        public function setNoticeCallback( $callback ) {
                return wfSetVar( $this->mNoticeCallback, $callback );
@@ -114,8 +114,8 @@ class WikiImporter {
 
        /**
         * Sets the action to perform as each new page in the stream is reached.
-        * @param $callback callback
-        * @return callback
+        * @param callable $callback
+        * @return callable
         */
        public function setPageCallback( $callback ) {
                $previous = $this->mPageCallback;
@@ -129,8 +129,8 @@ class WikiImporter {
         * with the original title form (in case it's been overridden into a
         * local namespace), and a count of revisions.
         *
-        * @param $callback callback
-        * @return callback
+        * @param callable $callback
+        * @return callable
         */
        public function setPageOutCallback( $callback ) {
                $previous = $this->mPageOutCallback;
@@ -140,8 +140,8 @@ class WikiImporter {
 
        /**
         * Sets the action to perform as each page revision is reached.
-        * @param $callback callback
-        * @return callback
+        * @param callable $callback
+        * @return callable
         */
        public function setRevisionCallback( $callback ) {
                $previous = $this->mRevisionCallback;
@@ -151,8 +151,8 @@ class WikiImporter {
 
        /**
         * Sets the action to perform as each file upload version is reached.
-        * @param $callback callback
-        * @return callback
+        * @param callable $callback
+        * @return callable
         */
        public function setUploadCallback( $callback ) {
                $previous = $this->mUploadCallback;
@@ -162,8 +162,8 @@ class WikiImporter {
 
        /**
         * Sets the action to perform as each log item reached.
-        * @param $callback callback
-        * @return callback
+        * @param callable $callback
+        * @return callable
         */
        public function setLogItemCallback( $callback ) {
                $previous = $this->mLogItemCallback;
@@ -173,8 +173,8 @@ class WikiImporter {
 
        /**
         * Sets the action to perform when site info is encountered
-        * @param $callback callback
-        * @return callback
+        * @param callable $callback
+        * @return callable
         */
        public function setSiteInfoCallback( $callback ) {
                $previous = $this->mSiteInfoCallback;
index f0569dd..808626d 100644 (file)
@@ -5,7 +5,7 @@
  */
 class MWCallableUpdate implements DeferrableUpdate {
        /**
-        * @var closure/callback
+        * @var Closure|callable
         */
        private $callback;
 
index 2fd1bf6..368bf16 100644 (file)
@@ -46,7 +46,7 @@ abstract class FileBackendStore extends FileBackend {
        /** @var array Map of container names to sharding config */
        protected $shardViaHashLevels = array();
 
-       /** @var callback Method to get the MIME type of files */
+       /** @var callable Method to get the MIME type of files */
        protected $mimeCallback;
 
        protected $maxFileSize = 4294967296; // integer bytes (4GiB)
index f8741cf..4cbb32d 100644 (file)
@@ -89,12 +89,12 @@ class APCBagOStuff extends BagOStuff {
 
        /**
         * @param string $key
-        * @param closure $callback Callback method to be executed
+        * @param Closure $callback Callback method to be executed
         * @param int $exptime Either an interval in seconds or a unix timestamp for expiry
         * @param int $attempts The amount of times to attempt a merge in case of failure
         * @return bool Success
         */
-       public function merge( $key, closure $callback, $exptime = 0, $attempts = 10 ) {
+       public function merge( $key, Closure $callback, $exptime = 0, $attempts = 10 ) {
                return $this->mergeViaLock( $key, $callback, $exptime, $attempts );
        }
 
index 05d897f..99f73aa 100644 (file)
@@ -102,12 +102,12 @@ abstract class BagOStuff {
         * and takes the arguments: (this BagOStuff object, cache key, current value).
         *
         * @param string $key
-        * @param closure $callback Callback method to be executed
+        * @param Closure $callback Callback method to be executed
         * @param int $exptime Either an interval in seconds or a unix timestamp for expiry
         * @param int $attempts The amount of times to attempt a merge in case of failure
         * @return bool Success
         */
-       public function merge( $key, closure $callback, $exptime = 0, $attempts = 10 ) {
+       public function merge( $key, Closure $callback, $exptime = 0, $attempts = 10 ) {
                return $this->mergeViaCas( $key, $callback, $exptime, $attempts );
        }
 
@@ -115,12 +115,12 @@ abstract class BagOStuff {
         * @see BagOStuff::merge()
         *
         * @param string $key
-        * @param closure $callback Callback method to be executed
+        * @param Closure $callback Callback method to be executed
         * @param int $exptime Either an interval in seconds or a unix timestamp for expiry
         * @param int $attempts The amount of times to attempt a merge in case of failure
         * @return bool Success
         */
-       protected function mergeViaCas( $key, closure $callback, $exptime = 0, $attempts = 10 ) {
+       protected function mergeViaCas( $key, Closure $callback, $exptime = 0, $attempts = 10 ) {
                do {
                        $casToken = null; // passed by reference
                        $currentValue = $this->get( $key, $casToken ); // get the old value
@@ -144,12 +144,12 @@ abstract class BagOStuff {
         * @see BagOStuff::merge()
         *
         * @param string $key
-        * @param closure $callback Callback method to be executed
+        * @param Closure $callback Callback method to be executed
         * @param int $exptime Either an interval in seconds or a unix timestamp for expiry
         * @param int $attempts The amount of times to attempt a merge in case of failure
         * @return bool Success
         */
-       protected function mergeViaLock( $key, closure $callback, $exptime = 0, $attempts = 10 ) {
+       protected function mergeViaLock( $key, Closure $callback, $exptime = 0, $attempts = 10 ) {
                if ( !$this->lock( $key, 6 ) ) {
                        return false;
                }
@@ -218,7 +218,7 @@ abstract class BagOStuff {
        /**
         * Delete all objects expiring before a certain date.
         * @param string $date The reference date in MW format
-        * @param callback|bool $progressCallback Optional, a function which will be called
+        * @param callable|bool $progressCallback Optional, a function which will be called
         *     regularly during long-running operations with the percentage progress
         *     as the first parameter.
         *
index 3f6f6c7..9595b83 100644 (file)
@@ -69,12 +69,12 @@ class EmptyBagOStuff extends BagOStuff {
 
        /**
         * @param string $key
-        * @param closure $callback Callback method to be executed
+        * @param Closure $callback Callback method to be executed
         * @param int $exptime Either an interval in seconds or a unix timestamp for expiry
         * @param int $attempts The amount of times to attempt a merge in case of failure
         * @return bool Success
         */
-       public function merge( $key, closure $callback, $exptime = 0, $attempts = 10 ) {
+       public function merge( $key, Closure $callback, $exptime = 0, $attempts = 10 ) {
                return true;
        }
 }
index a1290f8..c656bdd 100644 (file)
@@ -170,12 +170,12 @@ class MultiWriteBagOStuff extends BagOStuff {
 
        /**
         * @param string $key
-        * @param closure $callback Callback method to be executed
+        * @param Closure $callback Callback method to be executed
         * @param int $exptime Either an interval in seconds or a unix timestamp for expiry
         * @param int $attempts The amount of times to attempt a merge in case of failure
         * @return bool Success
         */
-       public function merge( $key, closure $callback, $exptime = 0, $attempts = 10 ) {
+       public function merge( $key, Closure $callback, $exptime = 0, $attempts = 10 ) {
                return $this->doWrite( 'merge', $key, $callback, $exptime );
        }
 
@@ -211,7 +211,7 @@ class MultiWriteBagOStuff extends BagOStuff {
         *
         * Succeed if any of the child caches succeed.
         * @param string $date
-        * @param bool|callback $progressCallback
+        * @param bool|callable $progressCallback
         * @return bool
         */
        public function deleteObjectsExpiringBefore( $date, $progressCallback = false ) {
index 4a1e2c9..8bf0c81 100644 (file)
@@ -487,7 +487,7 @@ class SqlBagOStuff extends BagOStuff {
        /**
         * Delete objects from the database which expire before a certain date.
         * @param string $timestamp
-        * @param bool|callback $progressCallback
+        * @param bool|callable $progressCallback
         * @return bool
         */
        public function deleteObjectsExpiringBefore( $timestamp, $progressCallback = false ) {
index 078f6d4..b12a40c 100644 (file)
@@ -98,12 +98,12 @@ class XCacheBagOStuff extends BagOStuff {
         * provide a way to perform CAS-like functionality.
         *
         * @param string $key
-        * @param closure $callback Callback method to be executed
+        * @param Closure $callback Callback method to be executed
         * @param int $exptime Either an interval in seconds or a unix timestamp for expiry
         * @param int $attempts The amount of times to attempt a merge in case of failure
         * @return bool Cuccess
         */
-       public function merge( $key, closure $callback, $exptime = 0, $attempts = 10 ) {
+       public function merge( $key, Closure $callback, $exptime = 0, $attempts = 10 ) {
                return $this->mergeViaLock( $key, $callback, $exptime, $attempts );
        }
 
index 1a1ef38..6818884 100644 (file)
@@ -4973,7 +4973,7 @@ class Parser {
         *     about the methods available in PPFrame and PPNode.
         *
         * @throws MWException
-        * @return string|callback The old callback function for this name, if any
+        * @return string|callable The old callback function for this name, if any
         */
        public function setFunctionHook( $id, $callback, $flags = 0 ) {
                global $wgContLang;
index e2ec474..806f5bf 100644 (file)
@@ -170,7 +170,7 @@ abstract class GenericArrayObjectTest extends MediaWikiTestCase {
        /**
         * @since 1.20
         *
-        * @param callback $function
+        * @param callable $function
         *
         * @covers GenericArrayObject::getObjectType
         */