You are here

protected function DefaultExceptionSubscriber::getHandledFormats in Drupal 10

Same name in this branch
  1. 10 core/modules/jsonapi/src/EventSubscriber/DefaultExceptionSubscriber.php \Drupal\jsonapi\EventSubscriber\DefaultExceptionSubscriber::getHandledFormats()
  2. 10 core/modules/serialization/src/EventSubscriber/DefaultExceptionSubscriber.php \Drupal\serialization\EventSubscriber\DefaultExceptionSubscriber::getHandledFormats()
Same name and namespace in other branches
  1. 8 core/modules/serialization/src/EventSubscriber/DefaultExceptionSubscriber.php \Drupal\serialization\EventSubscriber\DefaultExceptionSubscriber::getHandledFormats()
  2. 9 core/modules/serialization/src/EventSubscriber/DefaultExceptionSubscriber.php \Drupal\serialization\EventSubscriber\DefaultExceptionSubscriber::getHandledFormats()

Specifies the request formats this subscriber will respond to.

Return value

array An indexed array of the format machine names that this subscriber will attempt to process, such as "html" or "json". Returning an empty array will apply to all formats.

Overrides HttpExceptionSubscriberBase::getHandledFormats

See also

\Symfony\Component\HttpFoundation\Request

1 method overrides DefaultExceptionSubscriber::getHandledFormats()
DefaultExceptionSubscriber::getHandledFormats in core/modules/jsonapi/src/EventSubscriber/DefaultExceptionSubscriber.php
Specifies the request formats this subscriber will respond to.

File

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

Class

DefaultExceptionSubscriber
Handles default error responses in serialization formats.

Namespace

Drupal\serialization\EventSubscriber

Code

protected function getHandledFormats() {
  return $this->serializerFormats;
}