public function DefaultExceptionSubscriber::__construct in Drupal 10
Same name and namespace in other branches
- 8 core/modules/serialization/src/EventSubscriber/DefaultExceptionSubscriber.php \Drupal\serialization\EventSubscriber\DefaultExceptionSubscriber::__construct()
- 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\EventSubscriberCode
public function __construct(SerializerInterface $serializer, array $serializer_formats) {
$this->serializer = $serializer;
$this->serializerFormats = $serializer_formats;
}