From de39f3e019f51b6ae93e2f37a92358a8dff87230 Mon Sep 17 00:00:00 2001 From: umherirrender Date: Thu, 3 Jul 2014 21:20:35 +0200 Subject: [PATCH] Use some callable hints on @param docs Callbacks can be given as a string or array, so the hint 'callable' is used. Change-Id: I3842606f74c8c3705dffc70bf13e31f44a37fa65 --- includes/Hooks.php | 2 +- includes/cache/CacheDependency.php | 2 +- includes/db/LBFactorySingle.php | 2 +- includes/filebackend/FSFileBackend.php | 2 +- includes/filerepo/FileRepo.php | 4 ++-- includes/filerepo/ForeignAPIRepo.php | 2 +- includes/installer/Installer.php | 6 +++--- includes/parser/Parser.php | 10 +++++----- 8 files changed, 15 insertions(+), 15 deletions(-) diff --git a/includes/Hooks.php b/includes/Hooks.php index 89457e8436..77486b208c 100644 --- a/includes/Hooks.php +++ b/includes/Hooks.php @@ -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 */ diff --git a/includes/cache/CacheDependency.php b/includes/cache/CacheDependency.php index 7b83990fed..15d7c8939d 100644 --- a/includes/cache/CacheDependency.php +++ b/includes/cache/CacheDependency.php @@ -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 diff --git a/includes/db/LBFactorySingle.php b/includes/db/LBFactorySingle.php index 62195736d0..3a4d829b3e 100644 --- a/includes/db/LBFactorySingle.php +++ b/includes/db/LBFactorySingle.php @@ -71,7 +71,7 @@ class LBFactorySingle extends LBFactory { } /** - * @param string|array $callback + * @param string|callable $callback * @param array $params */ function forEachLB( $callback, $params = array() ) { diff --git a/includes/filebackend/FSFileBackend.php b/includes/filebackend/FSFileBackend.php index 3f81a944b3..e7c1f6f81f 100644 --- a/includes/filebackend/FSFileBackend.php +++ b/includes/filebackend/FSFileBackend.php @@ -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 */ diff --git a/includes/filerepo/FileRepo.php b/includes/filerepo/FileRepo.php index 4c250baf9d..8598005041 100644 --- a/includes/filerepo/FileRepo.php +++ b/includes/filerepo/FileRepo.php @@ -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 ) { diff --git a/includes/filerepo/ForeignAPIRepo.php b/includes/filerepo/ForeignAPIRepo.php index 7f25a00e77..6924f0a6bb 100644 --- a/includes/filerepo/ForeignAPIRepo.php +++ b/includes/filerepo/ForeignAPIRepo.php @@ -575,7 +575,7 @@ class ForeignAPIRepo extends FileRepo { } /** - * @param array|string $callback + * @param callable $callback * @throws MWException */ function enumFiles( $callback ) { diff --git a/includes/installer/Installer.php b/includes/installer/Installer.php index 88478f4037..540b647dac 100644 --- a/includes/installer/Installer.php +++ b/includes/installer/Installer.php @@ -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 */ diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index 89ed60d234..e5917b8f83 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -5013,9 +5013,9 @@ class Parser { * private variables.** * * @param string $tag The tag to use, e.g. 'hook' for "" - * @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 "" - * @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:...}} * -- 2.20.1