]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/CoreBundle/Event/Subscriber/CustomDoctrineORMSubscriber.php
Merge pull request #4152 from ldidry/add-env-var-dev.sh
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Event / Subscriber / CustomDoctrineORMSubscriber.php
index 20ced679c5e795ae8f0b568ae3279aa17e9e11fa..b8f6e1d6cecd6fc24d989c6eab2569702946f546 100644 (file)
@@ -2,32 +2,29 @@
 
 namespace Wallabag\CoreBundle\Event\Subscriber;
 
-use Lexik\Bundle\FormFilterBundle\Event\Subscriber\DoctrineORMSubscriber;
 use Lexik\Bundle\FormFilterBundle\Event\GetFilterConditionEvent;
+use Lexik\Bundle\FormFilterBundle\Event\Subscriber\DoctrineORMSubscriber;
 use Symfony\Component\EventDispatcher\EventSubscriberInterface;
 
 /**
  * This custom class override the default behavior of LexikFilterBundle on `filter_date_range`
- * It converts a date_range to date_time_range to add hour to be able to grab a whole day (from 00:00:00 to 23:59:59)
+ * It converts a date_range to date_time_range to add hour to be able to grab a whole day (from 00:00:00 to 23:59:59).
  */
 class CustomDoctrineORMSubscriber extends DoctrineORMSubscriber implements EventSubscriberInterface
 {
-    /**
-     * @param GetFilterConditionEvent $event
-     */
     public function filterDateRange(GetFilterConditionEvent $event)
     {
-        $expr   = $event->getFilterQuery()->getExpressionBuilder();
+        $expr = $event->getFilterQuery()->getExpressionBuilder();
         $values = $event->getValues();
-        $value  = $values['value'];
+        $value = $values['value'];
 
         // left date should start at midnight
-        if (isset($value['left_date'][0]) && $value['left_date'][0] instanceOf \DateTime) {
+        if (isset($value['left_date'][0]) && $value['left_date'][0] instanceof \DateTime) {
             $value['left_date'][0]->setTime(0, 0, 0);
         }
 
         // right adte should end one second before midnight
-        if (isset($value['right_date'][0]) && $value['right_date'][0] instanceOf \DateTime) {
+        if (isset($value['right_date'][0]) && $value['right_date'][0] instanceof \DateTime) {
             $value['right_date'][0]->setTime(23, 59, 59);
         }