You are here

public static function YamlPecl::errorHandler in Drupal 9

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Component/Serialization/YamlPecl.php \Drupal\Component\Serialization\YamlPecl::errorHandler()

Handles errors for \Drupal\Component\Serialization\YamlPecl::decode().

Parameters

int $severity: The severity level of the error.

string $message: The error message to display.

See also

\Drupal\Component\Serialization\YamlPecl::decode()

File

core/lib/Drupal/Component/Serialization/YamlPecl.php, line 70

Class

YamlPecl
Provides default serialization for YAML using the PECL extension.

Namespace

Drupal\Component\Serialization

Code

public static function errorHandler($severity, $message) {
  restore_error_handler();
  throw new InvalidDataTypeException($message, $severity);
}