<?xml version="1.0" ?>

<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="pv.form.type.recaptcha.class">Pv\RecaptchaBundle\Form\Type\ReCaptchaType</parameter>
        <parameter key="pv.form.validator.recaptcha.class">Pv\RecaptchaBundle\Validator\ReCaptchaValidator</parameter>
    </parameters>

    <services>
        <service id="pv.form.type.recaptcha" class="%pv.form.type.recaptcha.class%">
            <tag name="form.type" alias="pv_recaptcha" />
            <argument>%pv_recaptcha.recaptcha_public_key%</argument>
            <argument>%locale%</argument>
        </service>

        <service id="pv.form.validator.recaptcha" class="%pv.form.validator.recaptcha.class%">
            <tag name="validator.constraint_validator" alias="pv_recaptcha_validator" />
            <argument type="service" id="request" strict="false"/>
            <argument>%pv_recaptcha.recaptcha_private_key%</argument>
        </service>
    </services>
</container>
