Merge pull request #94 from piotrantosik/psr
update docblock, fix typos, improve composer.json
This commit is contained in:
commit
bd208c45a8
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -51,4 +51,3 @@ class Configuration implements ConfigurationInterface
|
|||
return $treeBuilder;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -160,4 +160,3 @@ class CaptchaGenerator
|
|||
return $phrase;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -103,4 +103,3 @@ class ImageFileHandler
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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,8 +43,9 @@ class CaptchaType extends AbstractType
|
|||
private $options = array();
|
||||
|
||||
/**
|
||||
* @param \Symfony\Component\HttpFoundation\Session\SessionInterface $session
|
||||
* @param \Gregwar\CaptchaBundle\Generator\CaptchaGenerator $generator
|
||||
* @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)
|
||||
{
|
||||
|
|
|
@ -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 TranslatorInterface $translator
|
||||
* @param SessionInterface $session
|
||||
* @param string $key
|
||||
* @param string $invalidMessage
|
||||
* @param string|null $bypassCode
|
||||
* @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
|
||||
*/
|
||||
|
|
|
@ -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": {
|
||||
|
|
Loading…
Reference in New Issue