Use the same declaration for *Processor::call methods

This commit is contained in:
Dmitriy Simushev 2014-01-29 13:23:18 +00:00
parent 7bb7a388b8
commit cab8caac90
2 changed files with 28 additions and 11 deletions

View File

@ -30,13 +30,27 @@ abstract class ClientSideProcessor extends AbstractProcessor
/**
* Call function at client side
*
* WARNING: This processor does not support synchronous requests.
*
* @param array $functions Array of functions to call. See Mibew API for
* details.
* @param boolean $async True for asynchronous requests and false for
* synchronous request
* @param array|null $callback callback array for synchronous requests.
* @return mixed request result or boolean false on failure.
* @see \Mibew\RequestProcessor\AbstractProcessor
*/
public function call($functions, $callback = null)
public function call($functions, $async, $callback = null)
{
if (!$async) {
trigger_error(
'Synchronous requests are not supported.',
E_USER_WARNING
);
return false;
}
return parent::call($functions, true, $callback);
}

View File

@ -1139,18 +1139,21 @@ class Thread
protected function setupAvatar($link)
{
$processor = ThreadProcessor::getInstance();
$processor->call(array(
$processor->call(
array(
'function' => 'setupAvatar',
'arguments' => array(
'threadId' => $this->id,
'token' => $this->lastToken,
'return' => array(),
'references' => array(),
'recipient' => 'user',
'imageLink' => $link,
array(
'function' => 'setupAvatar',
'arguments' => array(
'threadId' => $this->id,
'token' => $this->lastToken,
'return' => array(),
'references' => array(),
'recipient' => 'user',
'imageLink' => $link,
),
),
),
));
true
);
}
}