diff --git a/core/lib/Drupal/Component/Utility/Json.php b/core/lib/Drupal/Component/Utility/Json.php index 54614b5..0715e13 100644 --- a/core/lib/Drupal/Component/Utility/Json.php +++ b/core/lib/Drupal/Component/Utility/Json.php @@ -39,9 +39,6 @@ public static function encode($variable) { * * @return mixed * Returns the decoded string. - * - * @see drupal_json_encode() - * @ingroup php_wrappers */ public static function decode($string) { return json_decode($string, TRUE); diff --git a/core/lib/Drupal/Core/Asset/JsCollectionRenderer.php b/core/lib/Drupal/Core/Asset/JsCollectionRenderer.php index 1173012..cdaf1d8 100644 --- a/core/lib/Drupal/Core/Asset/JsCollectionRenderer.php +++ b/core/lib/Drupal/Core/Asset/JsCollectionRenderer.php @@ -7,6 +7,7 @@ namespace Drupal\Core\Asset; use Drupal\Core\KeyValueStore\StateInterface; +use Drupal\Component\Utility\Json; /** * Renders JavaScript assets. diff --git a/core/modules/ckeditor/lib/Drupal/ckeditor/Plugin/Editor/CKEditor.php b/core/modules/ckeditor/lib/Drupal/ckeditor/Plugin/Editor/CKEditor.php index 11e7e22..03f37e1 100644 --- a/core/modules/ckeditor/lib/Drupal/ckeditor/Plugin/Editor/CKEditor.php +++ b/core/modules/ckeditor/lib/Drupal/ckeditor/Plugin/Editor/CKEditor.php @@ -16,7 +16,6 @@ use Drupal\Core\Plugin\ContainerFactoryPluginInterface; use Drupal\editor\Entity\Editor as EditorEntity; use Symfony\Component\DependencyInjection\ContainerInterface; -use Drupal\Component\Utility\Json; /** * Defines a CKEditor-based text editor for Drupal. diff --git a/core/modules/ckeditor/lib/Drupal/ckeditor/Tests/CKEditorAdminTest.php b/core/modules/ckeditor/lib/Drupal/ckeditor/Tests/CKEditorAdminTest.php index 7663d27..f984160 100644 --- a/core/modules/ckeditor/lib/Drupal/ckeditor/Tests/CKEditorAdminTest.php +++ b/core/modules/ckeditor/lib/Drupal/ckeditor/Tests/CKEditorAdminTest.php @@ -9,7 +9,6 @@ use Drupal\editor\Entity\Editor; use Drupal\simpletest\WebTestBase; -use Drupal\Component\Utility\Json; /** * Tests administration of CKEditor. @@ -154,7 +153,7 @@ function testAdmin() { array('JustifyCenter') ); $edit = array( - 'editor[settings][toolbar][buttons]' => Json::encode($expected_settings['toolbar']['buttons']), + 'editor[settings][toolbar][button_groups]' => json_encode($expected_settings['toolbar']['rows']), ); $this->drupalPostForm(NULL, $edit, t('Save configuration')); $editor = entity_load('editor', 'filtered_html'); diff --git a/core/modules/config/lib/Drupal/config/Form/ConfigSync.php b/core/modules/config/lib/Drupal/config/Form/ConfigSync.php index 45c6973..8e95d7e 100644 --- a/core/modules/config/lib/Drupal/config/Form/ConfigSync.php +++ b/core/modules/config/lib/Drupal/config/Form/ConfigSync.php @@ -20,7 +20,6 @@ use Drupal\Core\Routing\UrlGeneratorInterface; use Symfony\Component\EventDispatcher\EventDispatcherInterface; use Symfony\Component\DependencyInjection\ContainerInterface; -use Drupal\Component\Utility\Json; /** * Construct the storage changes in a configuration synchronization form. @@ -210,7 +209,7 @@ public function buildForm(array $form, array &$form_state) { 'attributes' => array( 'class' => array('use-ajax'), 'data-accepts' => 'application/vnd.drupal-modal', - 'data-dialog-options' => Json::encode(array( + 'data-dialog-options' => json_encode(array( 'width' => 700 )), ), diff --git a/core/modules/rest/lib/Drupal/rest/Tests/Views/StyleSerializerTest.php b/core/modules/rest/lib/Drupal/rest/Tests/Views/StyleSerializerTest.php index 20499a3..5903780 100644 --- a/core/modules/rest/lib/Drupal/rest/Tests/Views/StyleSerializerTest.php +++ b/core/modules/rest/lib/Drupal/rest/Tests/Views/StyleSerializerTest.php @@ -9,7 +9,6 @@ use Drupal\views\Tests\Plugin\PluginTestBase; use Drupal\views\Tests\ViewTestData; -use Drupal\Component\Utility\Json; /** * Tests the serializer style plugin. @@ -88,7 +87,7 @@ public function testSerializerResponses() { $expected[] = $expected_row; } - $this->assertIdentical($actual_json, Json::encode($expected), 'The expected JSON output was found.'); + $this->assertIdentical($actual_json, json_encode($expected), 'The expected JSON output was found.'); // Test that the rendered output and the preview output are the same. diff --git a/core/modules/serialization/lib/Drupal/serialization/Tests/EntitySerializationTest.php b/core/modules/serialization/lib/Drupal/serialization/Tests/EntitySerializationTest.php index 1cc96cc..262d0a6 100644 --- a/core/modules/serialization/lib/Drupal/serialization/Tests/EntitySerializationTest.php +++ b/core/modules/serialization/lib/Drupal/serialization/Tests/EntitySerializationTest.php @@ -13,7 +13,6 @@ use Drupal\serialization\Normalizer\TypedDataNormalizer; use Drupal\simpletest\DrupalUnitTestBase; use Symfony\Component\Serializer\Serializer; -use Drupal\Component\Utility\Json; /** * Tests entity normalization and serialization of supported core formats. @@ -122,7 +121,7 @@ public function testSerialize() { // JsonEncoder. The output of ComplexDataNormalizer::normalize() is tested // elsewhere, so we can just assume that it works properly here. $normalized = $this->serializer->normalize($this->entity, 'json'); - $expected = Json::encode($normalized); + $expected = json_encode($normalized); // Test 'json'. $actual = $this->serializer->serialize($this->entity, 'json'); $this->assertIdentical($actual, $expected, 'Entity serializes to JSON when "json" is requested.'); diff --git a/core/modules/system/tests/modules/ajax_test/ajax_test.module b/core/modules/system/tests/modules/ajax_test/ajax_test.module index b7ab7a1..2ea9eb9 100644 --- a/core/modules/system/tests/modules/ajax_test/ajax_test.module +++ b/core/modules/system/tests/modules/ajax_test/ajax_test.module @@ -5,7 +5,6 @@ * Helper module for Ajax framework tests. */ -use Drupal\Component\Utility\Json; use Drupal\Core\Ajax\AjaxResponse; use Drupal\Core\Ajax\AlertCommand; use Drupal\Core\Ajax\OpenDialogCommand; @@ -131,7 +130,7 @@ function ajax_test_dialog() { 'attributes' => array( 'class' => array('use-ajax'), 'data-accepts' => 'application/vnd.drupal-modal', - 'data-dialog-options' => Json::encode(array( + 'data-dialog-options' => json_encode(array( 'width' => 400, )) ), @@ -142,7 +141,7 @@ function ajax_test_dialog() { 'attributes' => array( 'class' => array('use-ajax'), 'data-accepts' => 'application/vnd.drupal-dialog', - 'data-dialog-options' => Json::encode(array( + 'data-dialog-options' => json_encode(array( 'target' => 'ajax-test-dialog-wrapper-1', 'width' => 800, )) @@ -169,7 +168,7 @@ function ajax_test_dialog() { 'attributes' => array( 'class' => array('use-ajax'), 'data-accepts' => 'application/vnd.drupal-modal', - 'data-dialog-options' => Json::encode(array( + 'data-dialog-options' => json_encode(array( 'width' => 800, 'height' => 500, )) @@ -181,7 +180,7 @@ function ajax_test_dialog() { 'attributes' => array( 'class' => array('use-ajax'), 'data-accepts' => 'application/vnd.drupal-dialog', - 'data-dialog-options' => Json::encode(array( + 'data-dialog-options' => json_encode(array( 'width' => 800, )) ),