diff --git a/Views/ViewAbstract.php b/Views/ViewAbstract.php index 7aeecc0c6..e3fc345c7 100644 --- a/Views/ViewAbstract.php +++ b/Views/ViewAbstract.php @@ -114,6 +114,34 @@ abstract class ViewAbstract implements RenderableInterface return $text === null ? '' : \htmlspecialchars($text); } + /** + * Print cli output. + * + * @param ?string $text Text + * + * @return string + * + * @since 1.0.0 + */ + public function printCli(?string $text) : string + { + return $text === null ? '' : \escapeshellcmd($text); + } + + /** + * Print cli output. + * + * @param ?string $text Text + * + * @return string + * + * @since 1.0.0 + */ + public static function cli(?string $text) : string + { + return $text === null ? '' : \escapeshellcmd($text); + } + /** * Returns all views *