added missing arguments

This commit is contained in:
2024-09-13 02:46:50 +02:00
parent 22df616637
commit 3dd751f9a5
2 changed files with 4 additions and 14 deletions

View File

@@ -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)));

View File

@@ -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)%']