diff --git a/DependencyInjection/EoHoneypotExtension.php b/DependencyInjection/EoHoneypotExtension.php index cb5b7e9..0a751e1 100644 --- a/DependencyInjection/EoHoneypotExtension.php +++ b/DependencyInjection/EoHoneypotExtension.php @@ -16,7 +16,6 @@ use Symfony\Component\HttpKernel\DependencyInjection\Extension; use Symfony\Component\DependencyInjection\Loader; use Symfony\Component\DependencyInjection\Reference; -use Symfony\Component\DependencyInjection\Definition; /** * This is the class that loads and manages your bundle configuration diff --git a/EventListener/RedirectListener.php b/EventListener/RedirectListener.php index 2e36926..00279bb 100644 --- a/EventListener/RedirectListener.php +++ b/EventListener/RedirectListener.php @@ -4,8 +4,7 @@ use Eo\HoneypotBundle\Manager\HoneypotManager; use Symfony\Component\EventDispatcher\EventDispatcherInterface; use Symfony\Component\HttpFoundation\RedirectResponse; -use Symfony\Component\HttpKernel\Event\FilterResponseEvent; -use Symfony\Component\HttpKernel\HttpKernel; +use Symfony\Component\HttpKernel\Event\ResponseEvent; use Symfony\Component\Routing\RouterInterface; class RedirectListener @@ -26,9 +25,9 @@ public function onBirdInCage() $this->eventDispatcher->addListener('kernel.response', array($this, 'onKernelResponse')); } - public function onKernelResponse(FilterResponseEvent $event) + public function onKernelResponse(ResponseEvent $event) { - if (HttpKernel::MASTER_REQUEST != $event->getRequestType()) { + if (!$event->isMainRequest()) { return; } diff --git a/Model/HoneypotPrey.php b/Model/HoneypotPrey.php index 162fd26..01fc800 100644 --- a/Model/HoneypotPrey.php +++ b/Model/HoneypotPrey.php @@ -27,7 +27,7 @@ class HoneypotPrey implements HoneypotPreyInterface protected $ip; /** - * @var DateTime + * @var \DateTime */ protected $createdAt; @@ -78,7 +78,7 @@ public function getIp() /** * Set createdAt * - * @param DateTime $createdAt + * @param \DateTime $createdAt * @return self */ public function setCreatedAt(\DateTime $createdAt) @@ -91,7 +91,7 @@ public function setCreatedAt(\DateTime $createdAt) /** * Get createdAt * - * @return DateTime $createdAt + * @return \DateTime $createdAt */ public function getCreatedAt() { diff --git a/composer.json b/composer.json index d26f612..1a476ed 100644 --- a/composer.json +++ b/composer.json @@ -26,6 +26,9 @@ "autoload": { "psr-0": { "Eo\\HoneypotBundle": "" + }, + "psr-4": { + "Eo\\HoneypotBundle\\": "" } }, "extra": {