
| Current Path : /var/www/html/sirius-pallets/vendor/drush/drush/src/Drupal/ |
Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 |
| Current File : /var/www/html/sirius-pallets/vendor/drush/drush/src/Drupal/DrupalUtil.php |
<?php
declare(strict_types=1);
namespace Drush\Drupal;
use Drupal\Core\Mail\MailFormatHelper;
use Drupal\Core\Render\Markup;
class DrupalUtil
{
/**
* Output a Drupal render array, object or string as plain text.
*
* @param string|array|Markup $data
* Data to render.
*
* The plain-text representation of the input.
*/
public static function drushRender($data): string
{
if (is_array($data)) {
$data = \Drupal::service('renderer')->renderRoot($data);
}
return MailFormatHelper::htmlToText((string) $data);
}
}