<commit_before><?php

namespace Knplabs\MarkupValidatorBundle\DependencyInjection\Compiler;

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

/**
 * Dependency injection container compiler pass to register markup validation
 * processors. It finds all services having the "markup_validator.processor"
 * tag and adds them to the validator
 *
 * @author <NAME> <<EMAIL>>
 */
class RegisterValidatorsPass implements CompilerPassInterface
{
    /**
     * {@inheritDoc}
     */
    public function process(ContainerBuilder $container)
    {
        if (!$container->hasDefinition('markup_validator')) {
            return ;
        }

        foreach ($container->findTaggedServiceIds('markup_validator.processor') as $id => $attributes) {
            if (isset($attributes[0]['alias'])) {
                $container->setAlias(sprintf('markup_validator.%s_processor', $attributes[0]['alias']), $id);
            }
        }
    }
}<commit_msg>Remove the need to define a default validator<commit_after><?php

namespace Knplabs\MarkupValidatorBundle\DependencyInjection\Compiler;

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

/**
 * Dependency injection container compiler pass to register markup validation
 * processors. It finds all services having the "markup_validator.processor"
 * tag and adds them to the validator
 *
 * @author <NAME> <<EMAIL>>
 */
class RegisterValidatorsPass implements CompilerPassInterface
{
    /**
     * {@inheritDoc}
     */
    public function process(ContainerBuilder $container)
    {
        foreach ($container->findTaggedServiceIds('markup_validator.processor') as $id => $attributes) {
            if (isset($attributes[0]['alias'])) {
                $container->setAlias(sprintf('markup_validator.%s_processor', $attributes[0]['alias']), $id);
            }
        }
    }
}
{'fraction_non_alphanumeric': 0.11116412213740458, 'fraction_numerical': 0.0019083969465648854, 'mean_word_length': 4.016746411483253, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 16, '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': '1885350', 'n_tokens_mistral': 544, 'n_tokens_neox': 543, 'n_words': 120}