function DefaultExceptionSubscriber::__construct

Same name in other branches
  1. 8.9.x core/modules/serialization/src/EventSubscriber/DefaultExceptionSubscriber.php \Drupal\serialization\EventSubscriber\DefaultExceptionSubscriber::__construct()
  2. 10 core/modules/serialization/src/EventSubscriber/DefaultExceptionSubscriber.php \Drupal\serialization\EventSubscriber\DefaultExceptionSubscriber::__construct()
  3. 11.x core/modules/serialization/src/EventSubscriber/DefaultExceptionSubscriber.php \Drupal\serialization\EventSubscriber\DefaultExceptionSubscriber::__construct()

DefaultExceptionSubscriber constructor.

Parameters

\Symfony\Component\Serializer\SerializerInterface $serializer: The serializer service.

array $serializer_formats: The available serialization formats.

File

core/modules/serialization/src/EventSubscriber/DefaultExceptionSubscriber.php, line 39

Class

DefaultExceptionSubscriber
Handles default error responses in serialization formats.

Namespace

Drupal\serialization\EventSubscriber

Code

public function __construct(SerializerInterface $serializer, array $serializer_formats) {
    $this->serializer = $serializer;
    $this->serializerFormats = $serializer_formats;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.