autowire by Attribute

This commit is contained in:
2024-09-13 02:18:06 +02:00
parent dfe0bcfcc1
commit b1452c4011

View File

@@ -6,6 +6,7 @@ use Redmine\Client\Psr18Client;
use GuzzleHttp\Client as GuzzleClient; use GuzzleHttp\Client as GuzzleClient;
use GuzzleHttp\Psr7\HttpFactory as GuzzleHttpFactory; use GuzzleHttp\Psr7\HttpFactory as GuzzleHttpFactory;
use Symfony\Contracts\Cache\TagAwareCacheInterface; use Symfony\Contracts\Cache\TagAwareCacheInterface;
use Symfony\Component\DependencyInjection\Attribute\Autowire;
final class RedmineClient final class RedmineClient
{ {
@@ -14,6 +15,7 @@ final class RedmineClient
private ?string $apiKey = null; private ?string $apiKey = null;
public function __construct( public function __construct(
#[Autowire(service: 'redmine_api_cache_pool')]
private TagAwareCacheInterface $redmineApiCachePool private TagAwareCacheInterface $redmineApiCachePool
) {} ) {}