Use some callable hints on @param docs
authorumherirrender <umherirrender_de.wp@web.de>
Thu, 3 Jul 2014 19:20:35 +0000 (21:20 +0200)
committerumherirrender <umherirrender_de.wp@web.de>
Thu, 3 Jul 2014 19:20:35 +0000 (21:20 +0200)
Callbacks can be given as a string or array, so the hint 'callable' is
used.

Change-Id: I3842606f74c8c3705dffc70bf13e31f44a37fa65

includes/Hooks.php
includes/cache/CacheDependency.php
includes/db/LBFactorySingle.php
includes/filebackend/FSFileBackend.php
includes/filerepo/FileRepo.php
includes/filerepo/ForeignAPIRepo.php
includes/installer/Installer.php
includes/parser/Parser.php

index 89457e8..77486b2 100644 (file)
@@ -48,7 +48,7 @@ class Hooks {
         * Attach an event handler to a given hook.
         *
         * @param string $name Name of hook
-        * @param mixed $callback Callback function to attach
+        * @param callable $callback Callback function to attach
         *
         * @since 1.18
         */
index 7b83990..15d7c89 100644 (file)
@@ -101,7 +101,7 @@ class DependencyWrapper {
         * @param BagOStuff $cache A cache object such as $wgMemc
         * @param string $key The cache key
         * @param int $expiry The expiry timestamp or interval in seconds
-        * @param bool|array $callback The callback for generating the value, or false
+        * @param bool|callable $callback The callback for generating the value, or false
         * @param array $callbackParams The function parameters for the callback
         * @param array $deps The dependencies to store on a cache miss. Note: these
         *    are not the dependencies used on a cache hit! Cache hits use the stored
index 6219573..3a4d829 100644 (file)
@@ -71,7 +71,7 @@ class LBFactorySingle extends LBFactory {
        }
 
        /**
-        * @param string|array $callback
+        * @param string|callable $callback
         * @param array $params
         */
        function forEachLB( $callback, $params = array() ) {
index 3f81a94..e7c1f6f 100644 (file)
@@ -792,7 +792,7 @@ class FSFileOpHandle extends FileBackendStoreOpHandle {
        /**
         * @param FSFileBackend $backend
         * @param array $params
-        * @param callback $call
+        * @param callable $call
         * @param string $cmd
         * @param int|null $chmodPath
         */
index 4c250ba..8598005 100644 (file)
@@ -1583,7 +1583,7 @@ class FileRepo {
         * This only acts on the current version of files, not any old versions.
         * May use either the database or the filesystem.
         *
-        * @param array|string $callback
+        * @param callable $callback
         * @return void
         */
        public function enumFiles( $callback ) {
@@ -1594,7 +1594,7 @@ class FileRepo {
         * Call a callback function for every public file in the repository.
         * May use either the database or the filesystem.
         *
-        * @param array|string $callback
+        * @param callable $callback
         * @return void
         */
        protected function enumFilesInStorage( $callback ) {
index 7f25a00..6924f0a 100644 (file)
@@ -575,7 +575,7 @@ class ForeignAPIRepo extends FileRepo {
        }
 
        /**
-        * @param array|string $callback
+        * @param callable $callback
         * @throws MWException
         */
        function enumFiles( $callback ) {
index 88478f4..540b647 100644 (file)
@@ -1531,8 +1531,8 @@ abstract class Installer {
        /**
         * Actually perform the installation.
         *
-        * @param array $startCB A callback array for the beginning of each step
-        * @param array $endCB A callback array for the end of each step
+        * @param callable $startCB A callback array for the beginning of each step
+        * @param callable $endCB A callback array for the end of each step
         *
         * @return array Array of Status objects
         */
@@ -1747,7 +1747,7 @@ abstract class Installer {
        /**
         * Add an installation step following the given step.
         *
-        * @param array $callback A valid installation callback array, in this form:
+        * @param callable $callback A valid installation callback array, in this form:
         *    array( 'name' => 'some-unique-name', 'callback' => array( $obj, 'function' ) );
         * @param string $findStep The step to find. Omit to put the step at the beginning
         */
index 89ed60d..e5917b8 100644 (file)
@@ -5013,9 +5013,9 @@ class Parser {
         * private variables.**
         *
         * @param string $tag The tag to use, e.g. 'hook' for "<hook>"
-        * @param mixed $callback The callback function (and object) to use for the tag
+        * @param callable $callback The callback function (and object) to use for the tag
         * @throws MWException
-        * @return mixed|null The old value of the mTagHooks array associated with the hook
+        * @return callable|null The old value of the mTagHooks array associated with the hook
         */
        public function setHook( $tag, $callback ) {
                $tag = strtolower( $tag );
@@ -5044,9 +5044,9 @@ class Parser {
         * @todo better document or deprecate this
         *
         * @param string $tag The tag to use, e.g. 'hook' for "<hook>"
-        * @param mixed $callback The callback function (and object) to use for the tag
+        * @param callable $callback The callback function (and object) to use for the tag
         * @throws MWException
-        * @return mixed|null The old value of the mTagHooks array associated with the hook
+        * @return callable|null The old value of the mTagHooks array associated with the hook
         */
        function setTransparentTagHook( $tag, $callback ) {
                $tag = strtolower( $tag );
@@ -5085,7 +5085,7 @@ class Parser {
         *   isHTML                    The returned text is HTML, armour it against wikitext transformation
         *
         * @param string $id The magic word ID
-        * @param mixed $callback The callback function (and object) to use
+        * @param callable $callback The callback function (and object) to use
         * @param int $flags A combination of the following flags:
         *     SFH_NO_HASH   No leading hash, i.e. {{plural:...}} instead of {{#if:...}}
         *