<commit_before><?php
namespace T3v\T3vCore\Utility;

use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface;
use TYPO3\CMS\Fluid\View\StandaloneView;

use T3v\T3vCore\Utility\AbstractHelper;

/**
 * Renderer Utility Class
 *
 * @package T3v\T3vCore\Utility
 */
class RendererUtility extends AbstractUtility {
  /**
   * The constructor function.
   */
  public function __construct() {
    parent::__construct();
  }

  /**
   * Gets a Fluid renderer for a template.
   *
   * @param string $template The template
   * @param string $format The optional format, `html` is used as default
   * @return object The renderer for the template
   */
  public function getFluidRendererForTemplate($template, $format = 'html') {
    $template = (string) $template;
    $format   = (string) $format;

    $configurationManager = $this->objectManager->get(ConfigurationManagerInterface::class);
    $configuration        = $configurationManager->getConfiguration(ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK);
    $layoutRootPath       = GeneralUtility::getFileAbsFileName($configuration['view']['layoutRootPath']);
    $templateRootPath     = GeneralUtility::getFileAbsFileName($configuration['view']['templateRootPath']);
    $partialRootPath      = GeneralUtility::getFileAbsFileName($configuration['view']['partialRootPath']);

    $renderer = $this->objectManager->get(StandaloneView::class);
    $renderer->setLayoutRootPath($layoutRootPath);
    $renderer->setPartialRootPath($partialRootPath);
    $renderer->setTemplatePathAndFilename($templateRootPath . $template);
    $renderer->setFormat($format);

    return $renderer;
  }
}<commit_msg>[➠] Improved compatibility for TYPO3 8.7 (`RendererUtility)`.<commit_after><?php
namespace T3v\T3vCore\Utility;

use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface;
use TYPO3\CMS\Fluid\View\StandaloneView;

use T3v\T3vCore\Utility\AbstractHelper;

/**
 * Renderer Utility Class
 *
 * @package T3v\T3vCore\Utility
 */
class RendererUtility extends AbstractUtility {
  /**
   * The constructor function.
   */
  public function __construct() {
    parent::__construct();
  }

  /**
   * Gets a Fluid renderer for a template.
   *
   * @param string $template The template
   * @param string $format The optional format, `html` is used as default
   * @return object The renderer for the template
   */
  public function getFluidRendererForTemplate($template, $format = 'html') {
    $template = (string) $template;
    $format   = (string) $format;

    $configurationManager = $this->objectManager->get(ConfigurationManagerInterface::class);
    $configuration        = $configurationManager->getConfiguration(ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK);
    $layoutRootPath       = GeneralUtility::getFileAbsFileName($configuration['view']['layoutRootPath']);
    $templateRootPath     = GeneralUtility::getFileAbsFileName($configuration['view']['templateRootPath']);
    $partialRootPath      = GeneralUtility::getFileAbsFileName($configuration['view']['partialRootPath']);

    $renderer = $this->objectManager->get(StandaloneView::class);
    $renderer->setLayoutRootPaths([$layoutRootPath]);
    $renderer->setPartialRootPaths([$partialRootPath]);
    $renderer->setTemplatePathAndFilename($templateRootPath . $template);
    $renderer->setFormat($format);

    return $renderer;
  }
}
{'fraction_non_alphanumeric': 0.12521588946459414, 'fraction_numerical': 0.006044905008635579, 'mean_word_length': 5.085814360770578, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '801948', 'n_tokens_mistral': 979, 'n_tokens_neox': 997, 'n_words': 180}