$name = $callbacks[$name]; } } if ( !isset( $this->doWork ) ) { throw new MWException( "No callback provided for 'doWork' function." ); } $this->cacheable = isset( $this->doCachedWork ); } public function doWork() { return call_user_func_array( $this->doWork, [] ); } public function getCachedWork() { if ( $this->doCachedWork ) { return call_user_func_array( $this->doCachedWork, [] ); } return false; } public function fallback() { if ( $this->fallback ) { return call_user_func_array( $this->fallback, [] ); } return false; } public function error( $status ) { if ( $this->error ) { return call_user_func_array( $this->error, [ $status ] ); } return false; } }