<commit_before><?php
/**
 * The fwLessphpPluginConfiguration Class represent the configuration of fwLessphpPlugin
 *
 * @author <NAME> <<EMAIL>>
 */
 
class fwLessphpPluginConfiguration extends sfPluginConfiguration
{
  protected
    $fwLessphp,
    $webDebug;

  public function configure()
  {
    $this->dispatcher->connect('context.load_factories', array($this, 'listenToContextLoadFactoriesEvent'));
    $this->dispatcher->connect('response.method_not_found', array($this, 'listenToResponseMethodNotFoundEvent'));
    $this->dispatcher->connect('debug.web.load_panels', array($this, 'listenToDebugWebLoadPanelsEvent'));
  }

  public function listenToContextLoadFactoriesEvent(sfEvent $event)
  {
    include $event->getSubject()->getConfigCache()->checkConfig('config/fw_lessphp.yml');
    if (sfConfig::get('fw_lessphp_enabled', false))
    {
      $this->fwLessphp = new fwLessphp($event->getSubject()->getResponse(), $this->dispatcher);
    }
  }

  public function listenToResponseMethodNotFoundEvent(sfEvent $event)
  {
    if (sfConfig::get('fw_lessphp_enabled', false))
    {
      if ($event['method'] === 'getLesscssParsedStylesheets')
      {
        $event->setReturnValue(<commit_msg>Added ability to use dafault configuration<commit_after><?php
/**
 * The fwLessphpPluginConfiguration Class represent the configuration of fwLessphpPlugin
 *
 * @author <NAME> <<EMAIL>>
 */
 
class fwLessphpPluginConfiguration extends sfPluginConfiguration
{
  protected
    $fwLessphp,
    $webDebug;

  public function configure()
  {
    $this->dispatcher->connect('context.load_factories', array($this, 'listenToContextLoadFactoriesEvent'));
    $this->dispatcher->connect('response.method_not_found', array($this, 'listenToResponseMethodNotFoundEvent'));
    $this->dispatcher->connect('debug.web.load_panels', array($this, 'listenToDebugWebLoadPanelsEvent'));
  }

  public function listenToContextLoadFactoriesEvent(sfEvent $event)
  {
    if ($file = $event->getSubject()->getConfigCache()->checkConfig('config/fw_lessphp.yml', true))
    {
      include $file;
    }
    if (sfConfig::get('fw_lessphp_enabled', false))
    {
      $this->fwLessphp = new fwLessphp($event->getSubject()->getResponse(), $this->dispatcher);
    }
  }

  public function listenToResponseMethodNotFoundEvent(sfEvent $event)
  {
    if (sfConfig::get('fw_lessphp_enabled', false))
    {
      if ($event['method'] === 'getLesscssParsedStylesheets')
      {
        $event->setReturnValue(
{'fraction_non_alphanumeric': 0.13974151857835218, 'fraction_numerical': 0.0, 'mean_word_length': 5.085995085995086, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 37, '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': '2392688', 'n_tokens_mistral': 741, 'n_tokens_neox': 731, 'n_words': 118}