Skip to content

Instantly share code, notes, and snippets.

@kevinquillen
Created May 19, 2025 19:58
Show Gist options
  • Save kevinquillen/b3f3394f9fddff4f1201c894c806635d to your computer and use it in GitHub Desktop.
Save kevinquillen/b3f3394f9fddff4f1201c894c806635d to your computer and use it in GitHub Desktop.
Example class with Autowired services and PHP attribute
class ApiClientFactory {
/**
* {@inheritdoc}
*/
public function __construct(
private readonly ClientFactory $clientFactory,
#[Autowire(service: 'domain.negotiator')]
protected DomainNegotiator $domainNegotiator,
protected ConfigFactoryInterface $configFactory,
protected LoggerChannelFactoryInterface $loggerChannelFactory,
) {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment