<commit_before><?php

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

namespace Ekino\Bundle\NewRelicBundle\DependencyInjection\Compiler;

use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\Reference;
use Symfony\Component\DependencyInjection\ContainerInterface;

use Symfony\Component\Config\Definition\Exception\InvalidConfigurationException;

class NewRelicCompilerPass implements CompilerPassInterface
{
    /**
     * {@inheritDoc}
     */
    public function process(ContainerBuilder $container)
    {
        if (function_exists('newrelic_name_transaction')) {
            return;
        }

        $container->removeDefinition('ekino.new_relic.request_listener');
        $container->removeDefinition('ekino.new_relic.response_listener');
    }
}<commit_msg>Fixed removing exception listener if New Relic module isn't installed<commit_after><?php

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

namespace Ekino\Bundle\NewRelicBundle\DependencyInjection\Compiler;

use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\Reference;
use Symfony\Component\DependencyInjection\ContainerInterface;

use Symfony\Component\Config\Definition\Exception\InvalidConfigurationException;

class NewRelicCompilerPass implements CompilerPassInterface
{
    /**
     * {@inheritDoc}
     */
    public function process(ContainerBuilder $container)
    {
        if (function_exists('newrelic_name_transaction')) {
            return;
        }

        $container->removeDefinition('ekino.new_relic.request_listener');
        $container->removeDefinition('ekino.new_relic.response_listener');
        $container->removeDefinition('ekino.new_relic.exception_listener');
    }
}
{'fraction_non_alphanumeric': 0.09271803556308214, 'fraction_numerical': 0.0, 'mean_word_length': 4.65311004784689, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 14, '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': '7655164', 'n_tokens_mistral': 615, 'n_tokens_neox': 612, 'n_words': 130}