function YamlPecl::errorHandler

Same name in other branches
  1. 8.9.x core/lib/Drupal/Component/Serialization/YamlPecl.php \Drupal\Component\Serialization\YamlPecl::errorHandler()
  2. 10 core/lib/Drupal/Component/Serialization/YamlPecl.php \Drupal\Component\Serialization\YamlPecl::errorHandler()
  3. 11.x 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);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.