Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. SubscribedService.php

function SubscribedService::__construct

Parameters

string|null $key The key to use for the service:

class-string|null $type The service class:

bool $nullable Whether the service is optional:

object|object[] $attributes One or more dependency injection attributes to use:

File

vendor/symfony/service-contracts/Attribute/SubscribedService.php, line 39

Class

SubscribedService
For use as the return value for { @example new SubscribedService('http_client', HttpClientInterface::class, false, new Target('githubApi'))

Namespace

Symfony\Contracts\Service\Attribute

Code

public function __construct(?string $key = null, ?string $type = null, bool $nullable = false, array|object $attributes = []) {
    $this->attributes = \is_array($attributes) ? $attributes : [
        $attributes,
    ];
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal