<?xml version="1.0" encoding="UTF-8" ?>

<container xmlns="http://symfony.com/schema/dic/services"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">

    <parameters>
        <parameter key="fos_user.validator.password.class">FOS\UserBundle\Validator\PasswordValidator</parameter>
        <parameter key="fos_user.validator.unique.class">FOS\UserBundle\Validator\UniqueValidator</parameter>
    </parameters>

    <services>
        <!-- Unique Validator Service -->
        <service id="fos_user.validator.unique" class="%fos_user.validator.unique.class%">
            <argument type="service" id="fos_user.user_manager" />
            <tag name="validator.constraint_validator" alias="fos_user.validator.unique" />
        </service>
        
        <!-- Password Validator Service -->
        <service id="fos_user.validator.password" class="%fos_user.validator.password.class%">
            <call method="setEncoderFactory">
                <argument type="service" id="security.encoder_factory" />
            </call>
            <tag name="validator.constraint_validator" alias="fos_user.validator.password" />
        </service>
    </services>

</container>
