diff --git a/README.md b/README.md index 7b72ce7..19d0255 100644 --- a/README.md +++ b/README.md @@ -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'); // ... ``` diff --git a/Type/CaptchaType.php b/Type/CaptchaType.php index 0da5afb..3e57168 100644 --- a/Type/CaptchaType.php +++ b/Type/CaptchaType.php @@ -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'; } /** diff --git a/composer.json b/composer.json index 537f07b..8ad3bf3 100644 --- a/composer.json +++ b/composer.json @@ -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"