You are here

public function DefaultExceptionSubscriber::__construct in Drupal 8

Same name and namespace in other branches
  1. 9 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;
}