Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / drush / drush / src / Drupal / DrupalUtil.php
1 <?php
2 namespace Drush\Drupal;
3
4 class DrupalUtil
5 {
6
7     /**
8      * Output a Drupal render array, object or string as plain text.
9      *
10      * @param string $data
11      *   Data to render.
12      *
13      * @return string
14      *   The plain-text representation of the input.
15      */
16     public static function drushRender($data)
17     {
18         if (is_array($data)) {
19             $data = \Drupal::service('renderer')->renderRoot($data);
20         }
21
22         $data = \Drupal\Core\Mail\MailFormatHelper::htmlToText($data);
23         return $data;
24     }
25 }