You are here

protected function DefaultExceptionSubscriber::getHandledFormats in JSON:API 8

Same name and namespace in other branches
  1. 8.2 src/EventSubscriber/DefaultExceptionSubscriber.php \Drupal\jsonapi\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 DefaultExceptionSubscriber::getHandledFormats

See also

\Symfony\Component\HttpFoundation\Request

File

src/EventSubscriber/DefaultExceptionSubscriber.php, line 28

Class

DefaultExceptionSubscriber
Serializes exceptions in compliance with the JSON API specification.

Namespace

Drupal\jsonapi\EventSubscriber

Code

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