You are here

public static function YamlParserProxy::encode in Drupal 10

Same name in this branch
  1. 10 core/tests/Drupal/Tests/Core/Serialization/YamlTest.php \Drupal\Tests\Core\Serialization\YamlParserProxy::encode()
  2. 10 core/tests/Drupal/Tests/Component/Serialization/YamlTest.php \Drupal\Tests\Component\Serialization\YamlParserProxy::encode()
Same name and namespace in other branches
  1. 8 core/tests/Drupal/Tests/Component/Serialization/YamlTest.php \Drupal\Tests\Component\Serialization\YamlParserProxy::encode()
  2. 9 core/tests/Drupal/Tests/Component/Serialization/YamlTest.php \Drupal\Tests\Component\Serialization\YamlParserProxy::encode()

Encodes data into the serialization format.

Parameters

mixed $data: The data to encode.

Return value

string The encoded data.

Throws

\Drupal\Component\Serialization\Exception\InvalidDataTypeException

Overrides SerializationInterface::encode

File

core/tests/Drupal/Tests/Component/Serialization/YamlTest.php, line 159

Class

YamlParserProxy

Namespace

Drupal\Tests\Component\Serialization

Code

public static function encode($data) {
  return static::$mock
    ->encode($data);
}