<?php declare(strict_types=1);

namespace Newland\Toubiz\Sync\Neos\ViewHelpers;

use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;

class PrettyJsonViewHelper extends AbstractViewHelper
{
    /**
     * @param mixed $value
     */
    public function render($value = null): string
    {
        return \Safe\json_encode($value ?? $this->renderChildren(), JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES);
    }
}
