You've already forked redmine-bundle
added missing arguments
This commit is contained in:
@@ -11,23 +11,13 @@ use Symfony\Contracts\Cache\TagAwareCacheInterface;
|
|||||||
final class RedmineClient
|
final class RedmineClient
|
||||||
{
|
{
|
||||||
private ?Psr18Client $client = null;
|
private ?Psr18Client $client = null;
|
||||||
private ?string $url = null;
|
|
||||||
private ?string $apiKey = null;
|
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private TagAwareCacheInterface $cache
|
private TagAwareCacheInterface $cache,
|
||||||
|
private string $url,
|
||||||
|
private string $apiKey
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
public function setUrl(string $url): self
|
|
||||||
{
|
|
||||||
$this->url = $url;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function setApiKey(string $apiKey): self
|
|
||||||
{
|
|
||||||
$this->apiKey = $apiKey;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function call(string $api, string $method, array $arguments = []): mixed
|
public function call(string $api, string $method, array $arguments = []): mixed
|
||||||
{
|
{
|
||||||
$cacheKey = sprintf('%s_%s_%s', $api, $method, sha1(serialize($arguments)));
|
$cacheKey = sprintf('%s_%s_%s', $api, $method, sha1(serialize($arguments)));
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
services:
|
services:
|
||||||
Magdev\RedmineBundle\Client\RedmineClient:
|
Magdev\RedmineBundle\Client\RedmineClient:
|
||||||
arguments: ['@redmine_api.cache']
|
arguments: ['@redmine_api.cache', '%env(REDMINE_URL)%', '%env(REDMINE_APIKEY)%']
|
||||||
|
|||||||
Reference in New Issue
Block a user