You've already forked redmine-bundle
throw arguments into closure
This commit is contained in:
@@ -22,12 +22,11 @@ final class RedmineClient
|
|||||||
{
|
{
|
||||||
$cacheKey = sprintf('%s_%s_%s', $api, $method, sha1(serialize($arguments)));
|
$cacheKey = sprintf('%s_%s_%s', $api, $method, sha1(serialize($arguments)));
|
||||||
|
|
||||||
return $this->cache->get($cacheKey, function (ItemInterface $item) use ($api, $method): array {
|
return $this->cache->get($cacheKey, function (ItemInterface $item) use ($api, $method, $arguments): array {
|
||||||
$item->expiresAfter(3600);
|
$item->expiresAfter(3600);
|
||||||
$item->tag([$api, $method]);
|
$item->tag([$api, $method]);
|
||||||
|
|
||||||
$client = $this->getClient()->getApi($api);
|
$client = $this->getClient()->getApi($api);
|
||||||
$arguments = is_array($arguments) ? $arguments : [];
|
|
||||||
$value = \call_user_func_array([$client, $method], $arguments);
|
$value = \call_user_func_array([$client, $method], $arguments);
|
||||||
|
|
||||||
return $value;
|
return $value;
|
||||||
|
|||||||
Reference in New Issue
Block a user