<commit_before><?php

/*
 * This file is part of the symfony package.
 * (c) <NAME> <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

/**
 * sfFormatter provides methods to format text to be displayed on a console.
 *
 * @package    symfony
 * @subpackage command
 * @author     <NAME> <<EMAIL>>
 * @version    SVN: $Id$
 */
class sfFormatter
{
  protected
    $size = null;

  function __construct($maxLineSize = null)
  {
    if (null === $maxLineSize)
    {
      // this is tricky because "tput cols 2>&1" is not accurate
      $maxLineSize = ctype_digit(trim(shell_exec('tput cols 2>&1'))) ? (integer) shell_exec('tput cols') : 78;
    }

    $this->size = $maxLineSize;
  }

  /**
   * Sets a new style.
   *
   * @param string $name    The style name
   * @param array  $options An array of options
   */
  public function setStyle($name, $options = array())
  {
  }

  /**
   * Formats a text according to the given parameters.
   *
   * @param  string $text         The test to style
   * @param  mixed  $parameters   An array of parameters
   *
   * @return string The formatted text
   */
  public function format($text = '', $parameters = array())
  {
    return $text;
  }
<commit_msg>[1.3, 1.4] fixed usage of shell_exec when the function is disabled (closes #8758)<commit_after><?php

/*
 * This file is part of the symfony package.
 * (c) <NAME> <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

/**
 * sfFormatter provides methods to format text to be displayed on a console.
 *
 * @package    symfony
 * @subpackage command
 * @author     <NAME> <<EMAIL>>
 * @version    SVN: $Id$
 */
class sfFormatter
{
  protected
    $size = null;

  function __construct($maxLineSize = null)
  {
    if (null === $maxLineSize)
    {
      if (function_exists('shell_exec'))
      {
        // this is tricky because "tput cols 2>&1" is not accurate
        $maxLineSize = ctype_digit(trim(shell_exec('tput cols 2>&1'))) ? (integer) shell_exec('tput cols') : 78;
      }
      else
      {
        $maxLineSize = 78;
      }
    }

    $this->size = $maxLineSize;
  }

  /**
   * Sets a new style.
   *
   * @param string $name    The style name
   * @param array  $options An array of options
   */
  public function setStyle($name, $options = array())
  {
  }

  /**
   * Formats a text according to the given parameters.
   *
   * @param  string $text         The test to style
   * @param  mixed  $parameters   An array of parameters
   *
   * @return string The formatted text
   */
  public function format($text = '', $parameters = array())
  {
    return $text;
  }

{'fraction_non_alphanumeric': 0.12098230408089564, 'fraction_numerical': 0.007945106536655833, 'mean_word_length': 2.602080624187256, 'pattern_counts': {'":': 0, '<': 17, '<?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': '2116112', 'n_tokens_mistral': 892, 'n_tokens_neox': 864, 'n_words': 297}