Getting compatible with php>=5.3.9

This commit is contained in:
Gregwar 2015-12-13 12:10:14 +01:00
parent e10494a767
commit 42cb26794d
3 changed files with 5 additions and 3 deletions

View File

@ -105,6 +105,8 @@ You can use the "captcha" type in your forms this way:
use Gregwar\CaptchaBundle\Type\CaptchaType;
// ...
$builder->add('captcha', CaptchaType::class); // That's all !
// If you're using php<5.5, you can use instead:
$builder->add('captcha', 'Gregwar\CaptchaBundle\Type\CaptchaType');
// ...
```

View File

@ -11,7 +11,6 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
use Symfony\Component\Form\FormEvents;
use Symfony\Component\Translation\TranslatorInterface;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Gregwar\CaptchaBundle\Validator\CaptchaValidator;
use Gregwar\CaptchaBundle\Generator\CaptchaGenerator;
@ -144,7 +143,8 @@ class CaptchaType extends AbstractType
*/
public function getParent()
{
return TextType::class;
// Not using ::class to support Symfony 2.8 w/ php<5.5
return 'Symfony\Component\Form\Extension\Core\Type\TextType';
}
/**

View File

@ -17,7 +17,7 @@
}
],
"require": {
"php": ">=5.5.0",
"php": ">=5.3.9",
"gregwar/captcha": "~1.1",
"symfony/framework-bundle": "~2.1|~3.0",
"symfony/form": "~2.1|~3.0"