Completed
Branch master (ca1420)
by Guilherme
07:28 queued 32s
created
src/LoginCidadao/NotificationBundle/Form/BroadcastSettingsType.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@
 block discarded – undo
29 29
 
30 30
         $builder
31 31
             ->add('placeholders', 'collection',
32
-                   array(
32
+                    array(
33 33
                     'type' => new BroadcastPlaceholderType()
34 34
             ))
35 35
             ->add('title', 'text', array("required"=> true))
Please login to merge, or discard this patch.
src/LoginCidadao/NotificationBundle/Form/BroadcastType.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
             'empty_data' => null,
58 58
             'class' => 'LoginCidadao\NotificationBundle\Entity\Category',
59 59
             'property' => 'name',
60
-            'query_builder' => function (CategoryRepository $repository) use ($person, $clientId) {
60
+            'query_builder' => function(CategoryRepository $repository) use ($person, $clientId) {
61 61
                 return $repository->getOwnedCategoriesQuery($person)
62 62
                         ->andWhere('c.id = :clientId')
63 63
                         ->setParameter('clientId', $clientId);
@@ -66,10 +66,10 @@  discard block
 block discarded – undo
66 66
         $builder->add('client_id', 'hidden',
67 67
             array('required' => false, 'mapped' => false, 'data' => $clientId));
68 68
         $builder->addEventListener(FormEvents::PRE_SUBMIT,
69
-            function (FormEvent $event) use (&$receiversConfig, &$person, $clientId) {
69
+            function(FormEvent $event) use (&$receiversConfig, &$person, $clientId) {
70 70
             $entity                           = $event->getData();
71 71
             $form                             = $event->getForm();
72
-            $receiversConfig['query_builder'] = function (PersonRepository $repository) use ($clientId, &$entity) {
72
+            $receiversConfig['query_builder'] = function(PersonRepository $repository) use ($clientId, &$entity) {
73 73
                 $sql = $repository->getFindAuthorizedByClientIdQuery($clientId);
74 74
                 if (!empty($entity['receivers'])) {
75 75
                     $sql->andWhere('p.id in (:receivers)');
@@ -80,10 +80,10 @@  discard block
 block discarded – undo
80 80
             $form->add('receivers', 'ajax_choice', $receiversConfig);
81 81
         });
82 82
         $builder->addEventListener(FormEvents::PRE_SET_DATA,
83
-            function (FormEvent $event) use (&$receiversConfig, &$person, &$clientId) {
83
+            function(FormEvent $event) use (&$receiversConfig, &$person, &$clientId) {
84 84
             $entity                           = $event->getData();
85 85
             $form                             = $event->getForm();
86
-            $receiversConfig['query_builder'] = function (PersonRepository $repository) {
86
+            $receiversConfig['query_builder'] = function(PersonRepository $repository) {
87 87
                 $sql = $repository->createQueryBuilder('u');
88 88
                 $sql->where('1 != 1');
89 89
                 return $sql;
Please login to merge, or discard this patch.
src/LoginCidadao/NotificationBundle/Form/NotificationType.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
         $em                = $this->em;
28 28
         $placesHoldersForm = $builder->create('placeholders', 'form');
29 29
         $builder->add($placesHoldersForm);
30
-        $preSubmit         = function (FormEvent $event) use (&$em) {
30
+        $preSubmit         = function(FormEvent $event) use (&$em) {
31 31
             $data = $event->getData();
32 32
             $form = $event->getForm();
33 33
             $form
Please login to merge, or discard this patch.
NotificationBundle/Handler/AuthenticatedNotificationHandlerInterface.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
      * @return array
55 55
      */
56 56
     public function getAllFromClient(ClientInterface $client, $limit = 5,
57
-                                     $offset = 0, $orderby = null);
57
+                                        $offset = 0, $orderby = null);
58 58
 
59 59
     /**
60 60
      * Retrieves a person's settings.
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
      * @return NotificationSettings PersonNotificationOptions grouped by Client
88 88
      */
89 89
     public function getGroupedSettings(ClientInterface $client = null,
90
-                                       CategoryInterface $category = null);
90
+                                        CategoryInterface $category = null);
91 91
 
92 92
     /**
93 93
      * Return a person's number of unread notifications.
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -3,7 +3,6 @@
 block discarded – undo
3 3
 namespace LoginCidadao\APIBundle\Entity;
4 4
 
5 5
 use Doctrine\ORM\Mapping as ORM;
6
-use LoginCidadao\CoreBundle\Model\PersonInterface;
7 6
 use LoginCidadao\OAuthBundle\Model\ClientInterface;
8 7
 
9 8
 /**
Please login to merge, or discard this patch.
src/LoginCidadao/NotificationBundle/Handler/NotificationHandler.php 1 patch
Indentation   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -66,16 +66,16 @@  discard block
 block discarded – undo
66 66
     }
67 67
 
68 68
     public function getAllFromPerson(PersonInterface $person, $limit = 5,
69
-                                     $offset = 0, $orderby = null)
69
+                                        $offset = 0, $orderby = null)
70 70
     {
71 71
         return $this->repository->findBy(array('person' => $person), $orderby,
72 72
                 $limit, $offset);
73 73
     }
74 74
 
75 75
     public function getAllFromPersonByClient(PersonInterface $person,
76
-                                             ClientInterface $client,
77
-                                             $limit = 5, $offset = 0,
78
-                                             $orderby = null)
76
+                                                ClientInterface $client,
77
+                                                $limit = 5, $offset = 0,
78
+                                                $orderby = null)
79 79
     {
80 80
         return $this->repository->findBy(array('person' => $person, 'sender' => $client),
81 81
                 $orderby, $limit, $offset);
@@ -114,8 +114,8 @@  discard block
 block discarded – undo
114 114
      * @throws \LoginCidadao\CoreBundle\Exception\Notification\InvalidFormException
115 115
      */
116 116
     private function processForm(NotificationInterface $notification,
117
-                                 array $parameters, $method = "PUT",
118
-                                 PersonInterface $person = null)
117
+                                    array $parameters, $method = "PUT",
118
+                                    PersonInterface $person = null)
119 119
     {
120 120
         $form = $this->formFactory->create($this->notificationType,
121 121
             $notification, compact('method'));
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
     }
195 195
 
196 196
     public function initializeSettings(PersonInterface $person,
197
-                                       ClientInterface $client = null)
197
+                                        ClientInterface $client = null)
198 198
     {
199 199
         $om               = $this->om;
200 200
         $categoriesRepo   = $om->getRepository('LoginCidadaoNotificationBundle:Category');
@@ -266,8 +266,8 @@  discard block
 block discarded – undo
266 266
     }
267 267
 
268 268
     public function getGroupedSettings(PersonInterface $person,
269
-                                       ClientInterface $client = null,
270
-                                       CategoryInterface $category = null)
269
+                                        ClientInterface $client = null,
270
+                                        CategoryInterface $category = null)
271 271
     {
272 272
         $settings = new NotificationSettings();
273 273
 
@@ -290,8 +290,8 @@  discard block
 block discarded – undo
290 290
     }
291 291
 
292 292
     public function getAllFromPersonIdOffset(PersonInterface $person,
293
-                                             $limit = 5, $offset = 0,
294
-                                             ClientInterface $client = null)
293
+                                                $limit = 5, $offset = 0,
294
+                                                ClientInterface $client = null)
295 295
     {
296 296
         return $this->repository->findNextNotifications($person, $limit,
297 297
                 $offset, $client);
@@ -348,9 +348,9 @@  discard block
 block discarded – undo
348 348
     }
349 349
 
350 350
     public static function renderEmailByCategory($category,
351
-                                                 $replacePlaceholders = null,
352
-                                                 $replaceTitle = null,
353
-                                                 $replaceShortText = null)
351
+                                                    $replacePlaceholders = null,
352
+                                                    $replaceTitle = null,
353
+                                                    $replaceShortText = null)
354 354
     {
355 355
         return self::_renderHtml($category->getMailTemplate(),
356 356
                 $replacePlaceholders, $replaceTitle, $replaceShortText);
@@ -373,8 +373,8 @@  discard block
 block discarded – undo
373 373
     }
374 374
 
375 375
     protected function registerFailedCallback(NotificationInterface $notification,
376
-                                              ObjectManager $om, $ch,
377
-                                              $curlResponse)
376
+                                                ObjectManager $om, $ch,
377
+                                                $curlResponse)
378 378
     {
379 379
         $info = curl_getinfo($ch);
380 380
 
@@ -393,7 +393,7 @@  discard block
 block discarded – undo
393 393
     }
394 394
 
395 395
     private function sendCallback(NotificationInterface $notification,
396
-                                  ObjectManager $om)
396
+                                    ObjectManager $om)
397 397
     {
398 398
         if ($notification->getCallbackUrl()) {
399 399
             $secret            = $notification->getCategory()->getClient()->getSecret();
Please login to merge, or discard this patch.
LoginCidadao/NotificationBundle/Handler/NotificationHandlerInterface.php 1 patch
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
      * @return NotificationInterface[]
43 43
      */
44 44
     public function getAllFromPerson(PersonInterface $person, $limit = 5,
45
-                                     $offset = 0, $orderby = null);
45
+                                        $offset = 0, $orderby = null);
46 46
 
47 47
     /**
48 48
      * Same as getAllFromPerson but uses the notification's id as the offset.
@@ -55,8 +55,8 @@  discard block
 block discarded – undo
55 55
      * @return NotificationInterface[]
56 56
      */
57 57
     public function getAllFromPersonIdOffset(PersonInterface $person,
58
-                                             $limit = 5, $offset = 0,
59
-                                             ClientInterface $client = null);
58
+                                                $limit = 5, $offset = 0,
59
+                                                ClientInterface $client = null);
60 60
 
61 61
     /**
62 62
      * Get a list of an user's Notifications restricted by Client.
@@ -70,9 +70,9 @@  discard block
 block discarded – undo
70 70
      * @return NotificationInterface[]
71 71
      */
72 72
     public function getAllFromPersonByClient(PersonInterface $person,
73
-                                             ClientInterface $client,
74
-                                             $limit = 5, $offset = 0,
75
-                                             $orderby = null);
73
+                                                ClientInterface $client,
74
+                                                $limit = 5, $offset = 0,
75
+                                                $orderby = null);
76 76
 
77 77
     /**
78 78
      * Post Notification, creates a new Notification
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
      * @return boolean
143 143
      */
144 144
     public function initializeSettings(PersonInterface $person,
145
-                                       ClientInterface $client);
145
+                                        ClientInterface $client);
146 146
 
147 147
     /**
148 148
      * Mark the specified range of IDs as read.
@@ -163,8 +163,8 @@  discard block
 block discarded – undo
163 163
      * @return NotificationSettings PersonNotificationOptions grouped by Client
164 164
      */
165 165
     public function getGroupedSettings(PersonInterface $person,
166
-                                       ClientInterface $client = null,
167
-                                       CategoryInterface $category = null);
166
+                                        ClientInterface $client = null,
167
+                                        CategoryInterface $category = null);
168 168
 
169 169
     /**
170 170
      *
Please login to merge, or discard this patch.
src/LoginCidadao/NotificationBundle/Model/BroadcastSettings.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
         return $this->category;
69 69
     }
70 70
     
71
-     public function setCategory($category)
71
+        public function setCategory($category)
72 72
     {
73 73
         $this->$category = $category;
74 74
         return $this;
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
         return $this->broadcast->getTitle();
83 83
     }
84 84
     
85
-     public function setTitle($title)
85
+        public function setTitle($title)
86 86
     {
87 87
         $this->broadcast->setTitle($title);
88 88
         return $this;
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
         return $this->broadcast->getShortText();
97 97
     }
98 98
     
99
-     public function setShortText($shortText)
99
+        public function setShortText($shortText)
100 100
     {
101 101
         $this->broadcast->setShortText($shortText);
102 102
         return $this;
Please login to merge, or discard this patch.
src/LoginCidadao/NotificationBundle/Model/ClientNotificationIterable.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -22,8 +22,8 @@
 block discarded – undo
22 22
     protected function getCurrentData()
23 23
     {
24 24
         return $this->handler->allIdOffset($this->getPerIteration(),
25
-                                           $this->getOffset(),
26
-                                           $this->client);
25
+                                            $this->getOffset(),
26
+                                            $this->client);
27 27
     }
28 28
 
29 29
 }
Please login to merge, or discard this patch.
src/LoginCidadao/NotificationBundle/Model/NotificationIterable.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -96,7 +96,7 @@
 block discarded – undo
96 96
     protected function getCurrentData()
97 97
     {
98 98
         $notifications = $this->handler->allIdOffset($this->getPerIteration(),
99
-                                                     $this->getOffset());
99
+                                                        $this->getOffset());
100 100
 
101 101
         return $notifications;
102 102
     }
Please login to merge, or discard this patch.