X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fpoolcounter%2FPoolCounterWorkViaCallback.php;h=aed52d195752f52f4cce01e11f30d9854923ff33;hb=78e381ac7dcf305bf235c52009be6e7d2a1a56f3;hp=af83d2e06931b67f2f2687a9046e7a84fa7463e8;hpb=48d433b102e636644d833e408ba028880f90f62a;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/poolcounter/PoolCounterWorkViaCallback.php b/includes/poolcounter/PoolCounterWorkViaCallback.php index af83d2e069..aed52d1957 100644 --- a/includes/poolcounter/PoolCounterWorkViaCallback.php +++ b/includes/poolcounter/PoolCounterWorkViaCallback.php @@ -44,14 +44,14 @@ class PoolCounterWorkViaCallback extends PoolCounterWork { * If a 'doCachedWork' callback is provided, then execute() may wait for any prior * process in the pool to finish and reuse its cached result. * - * @param string $type + * @param string $type The class of actions to limit concurrency for * @param string $key * @param array $callbacks Map of callbacks * @throws MWException */ public function __construct( $type, $key, array $callbacks ) { parent::__construct( $type, $key ); - foreach ( array( 'doWork', 'doCachedWork', 'fallback', 'error' ) as $name ) { + foreach ( [ 'doWork', 'doCachedWork', 'fallback', 'error' ] as $name ) { if ( isset( $callbacks[$name] ) ) { if ( !is_callable( $callbacks[$name] ) ) { throw new MWException( "Invalid callback provided for '$name' function." ); @@ -66,26 +66,26 @@ class PoolCounterWorkViaCallback extends PoolCounterWork { } public function doWork() { - return call_user_func_array( $this->doWork, array() ); + return ( $this->doWork )(); } public function getCachedWork() { if ( $this->doCachedWork ) { - return call_user_func_array( $this->doCachedWork, array() ); + return ( $this->doCachedWork )(); } return false; } public function fallback() { if ( $this->fallback ) { - return call_user_func_array( $this->fallback, array() ); + return ( $this->fallback )(); } return false; } public function error( $status ) { if ( $this->error ) { - return call_user_func_array( $this->error, array( $status ) ); + return ( $this->error )( $status ); } return false; }