You are here

protected function ExceptionJsonSubscriber::getHandledFormats in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/lib/Drupal/Core/EventSubscriber/ExceptionJsonSubscriber.php \Drupal\Core\EventSubscriber\ExceptionJsonSubscriber::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 ExceptionJsonSubscriber::getHandledFormats()
ExceptionHalJsonSubscriber::getHandledFormats in core/modules/hal/src/EventSubscriber/ExceptionHalJsonSubscriber.php
Specifies the request formats this subscriber will respond to.

File

core/lib/Drupal/Core/EventSubscriber/ExceptionJsonSubscriber.php, line 22
Contains \Drupal\Core\EventSubscriber\ExceptionJsonSubscriber.

Class

ExceptionJsonSubscriber
Default handling for JSON errors.

Namespace

Drupal\Core\EventSubscriber

Code

protected function getHandledFormats() {
  return [
    'json',
  ];
}