diff --git a/Controller/CaptchaController.php b/Controller/CaptchaController.php index acdfa48..5cc45db 100644 --- a/Controller/CaptchaController.php +++ b/Controller/CaptchaController.php @@ -2,9 +2,9 @@ namespace Gregwar\CaptchaBundle\Controller; -use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Bundle\FrameworkBundle\Controller\Controller; +use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; /** * Generates a captcha via a URL @@ -16,12 +16,13 @@ class CaptchaController extends Controller /** * Action that is used to generate the captcha, save its code, and stream the image * - * @param \Symfony\Component\HttpFoundation\Request $request * @param string $key * - * @return \Symfony\Component\HttpFoundation\Response + * @return Response + * + * @throws NotFoundHttpException */ - public function generateCaptchaAction(Request $request, $key) + public function generateCaptchaAction($key) { $options = $this->container->getParameter('gregwar_captcha.config'); $session = $this->get('session'); @@ -56,4 +57,3 @@ class CaptchaController extends Controller return $response; } } - diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php index 0ef9877..06c869d 100644 --- a/DependencyInjection/Configuration.php +++ b/DependencyInjection/Configuration.php @@ -51,4 +51,3 @@ class Configuration implements ConfigurationInterface return $treeBuilder; } } - diff --git a/Generator/CaptchaGenerator.php b/Generator/CaptchaGenerator.php index 60db59b..d58c00b 100644 --- a/Generator/CaptchaGenerator.php +++ b/Generator/CaptchaGenerator.php @@ -160,4 +160,3 @@ class CaptchaGenerator return $phrase; } } - diff --git a/Generator/ImageFileHandler.php b/Generator/ImageFileHandler.php index 1a47420..71dda0f 100644 --- a/Generator/ImageFileHandler.php +++ b/Generator/ImageFileHandler.php @@ -103,4 +103,3 @@ class ImageFileHandler } } } - diff --git a/Type/CaptchaType.php b/Type/CaptchaType.php index 967df7d..17b4e2f 100644 --- a/Type/CaptchaType.php +++ b/Type/CaptchaType.php @@ -22,12 +22,12 @@ use Gregwar\CaptchaBundle\Generator\CaptchaGenerator; class CaptchaType extends AbstractType { /** - * @var \Symfony\Component\HttpFoundation\Session\SessionInterface + * @var SessionInterface */ protected $session; /** - * @var \Gregwar\CaptchaBundle\Generator\CaptchaGenerator + * @var CaptchaGenerator */ protected $generator; @@ -43,9 +43,10 @@ class CaptchaType extends AbstractType private $options = array(); /** - * @param \Symfony\Component\HttpFoundation\Session\SessionInterface $session - * @param \Gregwar\CaptchaBundle\Generator\CaptchaGenerator $generator - * @param array $options + * @param SessionInterface $session + * @param CaptchaGenerator $generator + * @param TranslatorInterface $translator + * @param array $options */ public function __construct(SessionInterface $session, CaptchaGenerator $generator, TranslatorInterface $translator, $options) { @@ -56,8 +57,7 @@ class CaptchaType extends AbstractType } /** - * @param \Symfony\Component\Form\FormBuilderInterface $builder - * @param array $options + * {@inheritdoc} */ public function buildForm(FormBuilderInterface $builder, array $options) { @@ -74,9 +74,7 @@ class CaptchaType extends AbstractType } /** - * @param \Symfony\Component\Form\FormView $view - * @param \Symfony\Component\Form\FormInterface $form - * @param array $options + * {@inheritdoc} */ public function buildView(FormView $view, FormInterface $form, array $options) { @@ -122,7 +120,7 @@ class CaptchaType extends AbstractType } /** - * @param \Symfony\Component\OptionsResolver\OptionsResolverInterface $resolver + * {@inheritdoc} */ public function setDefaultOptions(OptionsResolverInterface $resolver) { diff --git a/Validator/CaptchaValidator.php b/Validator/CaptchaValidator.php index 11d2402..4469cec 100644 --- a/Validator/CaptchaValidator.php +++ b/Validator/CaptchaValidator.php @@ -15,7 +15,7 @@ use Symfony\Component\Translation\TranslatorInterface; class CaptchaValidator { /** - * @var \Symfony\Component\HttpFoundation\Session\SessionInterface + * @var SessionInterface */ private $session; @@ -47,10 +47,12 @@ class CaptchaValidator private $translator; /** - * @param \Symfony\Component\HttpFoundation\Session\SessionInterface $session - * @param string $key - * @param string $invalidMessage - * @param string|null $bypassCode + * @param TranslatorInterface $translator + * @param SessionInterface $session + * @param string $key + * @param string $invalidMessage + * @param string $bypassCode + * @param int $humanity */ public function __construct(TranslatorInterface $translator, SessionInterface $session, $key, $invalidMessage, $bypassCode, $humanity) { @@ -112,7 +114,7 @@ class CaptchaValidator } /** - * Retreive the humanity + * Retrieve the humanity * * @return mixed|null */ diff --git a/composer.json b/composer.json index 81abbee..f466389 100644 --- a/composer.json +++ b/composer.json @@ -18,7 +18,9 @@ ], "require": { "php": ">=5.3.0", - "gregwar/captcha": "v1.0.11" + "gregwar/captcha": "~1.0.11", + "symfony/framework-bundle": "~2.1", + "symfony/form": "~2.1" }, "autoload": { "psr-0": {