You are here

public static function WebformYaml::tidy in Webform 6.x

Same name and namespace in other branches
  1. 8.5 src/Utility/WebformYaml.php \Drupal\webform\Utility\WebformYaml::tidy()

Tidy export YAML includes tweaking array layout and multiline strings.

Parameters

string $yaml: The output generated from \Drupal\Core\Serialization\Yaml::encode.

Return value

string The encoded data.

4 calls to WebformYaml::tidy()
WebformCliService::drush_webform_tidy in src/Commands/WebformCliService.php
Implements drush_hook_COMMAND().
WebformTranslationConfigManager::alterTextareaElement in src/WebformTranslationConfigManager.php
Alter text area element and convert it to a Codemirror editor.
WebformYamlTest::testTidy in tests/src/Unit/Utility/WebformYamlTest.php
Tests WebformYaml tidy with WebformYaml::tidy().
_webform_form_config_single_export_form_update_export in modules/webform_devel/webform_devel.module
Handles switching the export textarea and tidies exported MSK configuration.

File

src/Utility/WebformYaml.php, line 95

Class

WebformYaml
Provides YAML tidy function.

Namespace

Drupal\webform\Utility

Code

public static function tidy($yaml) {
  return self::encode(self::decode($yaml));
}