update docblock, fix typos, improve composer.json
This commit is contained in:
parent
90088c80fc
commit
9614209d83
|
@ -2,9 +2,9 @@
|
||||||
|
|
||||||
namespace Gregwar\CaptchaBundle\Controller;
|
namespace Gregwar\CaptchaBundle\Controller;
|
||||||
|
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
|
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
|
||||||
|
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generates a captcha via a URL
|
* 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
|
* Action that is used to generate the captcha, save its code, and stream the image
|
||||||
*
|
*
|
||||||
* @param \Symfony\Component\HttpFoundation\Request $request
|
|
||||||
* @param string $key
|
* @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');
|
$options = $this->container->getParameter('gregwar_captcha.config');
|
||||||
$session = $this->get('session');
|
$session = $this->get('session');
|
||||||
|
@ -56,4 +57,3 @@ class CaptchaController extends Controller
|
||||||
return $response;
|
return $response;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -51,4 +51,3 @@ class Configuration implements ConfigurationInterface
|
||||||
return $treeBuilder;
|
return $treeBuilder;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -160,4 +160,3 @@ class CaptchaGenerator
|
||||||
return $phrase;
|
return $phrase;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -103,4 +103,3 @@ class ImageFileHandler
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -22,12 +22,12 @@ use Gregwar\CaptchaBundle\Generator\CaptchaGenerator;
|
||||||
class CaptchaType extends AbstractType
|
class CaptchaType extends AbstractType
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @var \Symfony\Component\HttpFoundation\Session\SessionInterface
|
* @var SessionInterface
|
||||||
*/
|
*/
|
||||||
protected $session;
|
protected $session;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var \Gregwar\CaptchaBundle\Generator\CaptchaGenerator
|
* @var CaptchaGenerator
|
||||||
*/
|
*/
|
||||||
protected $generator;
|
protected $generator;
|
||||||
|
|
||||||
|
@ -43,8 +43,9 @@ class CaptchaType extends AbstractType
|
||||||
private $options = array();
|
private $options = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param \Symfony\Component\HttpFoundation\Session\SessionInterface $session
|
* @param SessionInterface $session
|
||||||
* @param \Gregwar\CaptchaBundle\Generator\CaptchaGenerator $generator
|
* @param CaptchaGenerator $generator
|
||||||
|
* @param TranslatorInterface $translator
|
||||||
* @param array $options
|
* @param array $options
|
||||||
*/
|
*/
|
||||||
public function __construct(SessionInterface $session, CaptchaGenerator $generator, TranslatorInterface $translator, $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
|
* {@inheritdoc}
|
||||||
* @param array $options
|
|
||||||
*/
|
*/
|
||||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||||
{
|
{
|
||||||
|
@ -74,9 +74,7 @@ class CaptchaType extends AbstractType
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param \Symfony\Component\Form\FormView $view
|
* {@inheritdoc}
|
||||||
* @param \Symfony\Component\Form\FormInterface $form
|
|
||||||
* @param array $options
|
|
||||||
*/
|
*/
|
||||||
public function buildView(FormView $view, FormInterface $form, array $options)
|
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)
|
public function setDefaultOptions(OptionsResolverInterface $resolver)
|
||||||
{
|
{
|
||||||
|
|
|
@ -15,7 +15,7 @@ use Symfony\Component\Translation\TranslatorInterface;
|
||||||
class CaptchaValidator
|
class CaptchaValidator
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @var \Symfony\Component\HttpFoundation\Session\SessionInterface
|
* @var SessionInterface
|
||||||
*/
|
*/
|
||||||
private $session;
|
private $session;
|
||||||
|
|
||||||
|
@ -47,10 +47,12 @@ class CaptchaValidator
|
||||||
private $translator;
|
private $translator;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param \Symfony\Component\HttpFoundation\Session\SessionInterface $session
|
* @param TranslatorInterface $translator
|
||||||
|
* @param SessionInterface $session
|
||||||
* @param string $key
|
* @param string $key
|
||||||
* @param string $invalidMessage
|
* @param string $invalidMessage
|
||||||
* @param string|null $bypassCode
|
* @param string $bypassCode
|
||||||
|
* @param int $humanity
|
||||||
*/
|
*/
|
||||||
public function __construct(TranslatorInterface $translator, SessionInterface $session, $key, $invalidMessage, $bypassCode, $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
|
* @return mixed|null
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -18,7 +18,9 @@
|
||||||
],
|
],
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=5.3.0",
|
"php": ">=5.3.0",
|
||||||
"gregwar/captcha": "v1.0.11"
|
"gregwar/captcha": "~1.0.11",
|
||||||
|
"symfony/framework-bundle": "~2.1",
|
||||||
|
"symfony/form": "~2.1"
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-0": {
|
"psr-0": {
|
||||||
|
|
Loading…
Reference in New Issue