Same name and namespace in other branches
  1. 8.9.x core/lib/Drupal/Component/Serialization/Json.php \Drupal\Component\Serialization\Json::decode()
  2. 9 core/lib/Drupal/Component/Serialization/Json.php \Drupal\Component\Serialization\Json::decode()

Decodes data from the serialization format.

Parameters

string $raw: The raw data string to decode.

Return value

mixed The decoded data.

Throws

\Drupal\Component\Serialization\Exception\InvalidDataTypeException

Overrides SerializationInterface::decode

93 calls to Json::decode()
AssertContentTrait::setRawContent in core/tests/Drupal/KernelTests/AssertContentTrait.php
Sets the raw content (e.g. HTML).
AttachedAssetsTest::testSettings in core/tests/Drupal/KernelTests/Core/Asset/AttachedAssetsTest.php
Tests JavaScript settings.
BasicTest::testViewsWizardAndListing in core/modules/views/tests/src/Functional/Wizard/BasicTest.php
BrowserTestBaseTest::testForm in core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php
Tests basic form functionality.
CommentNewIndicatorTest::testCommentNewCommentsIndicator in core/modules/comment/tests/src/Functional/CommentNewIndicatorTest.php
Tests new comment marker.

... See full list

File

core/lib/Drupal/Component/Serialization/Json.php, line 25

Class

Json
Default serialization for JSON.

Namespace

Drupal\Component\Serialization

Code

public static function decode($string) {
  return json_decode($string, TRUE);
}