Test Setup Failed
Branch master (d874c5)
by Lucas
18:59
created
src/LoginCidadao/NotificationBundle/Entity/Notification.php 1 patch
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -385,6 +385,9 @@  discard block
 block discarded – undo
385 385
         return $this->level;
386 386
     }
387 387
 
388
+    /**
389
+     * @param integer $level
390
+     */
388 391
     public function setLevel($level)
389 392
     {
390 393
         switch ($level) {
@@ -426,6 +429,9 @@  discard block
 block discarded – undo
426 429
         return $this->htmlTemplate;
427 430
     }
428 431
 
432
+    /**
433
+     * @param string $var
434
+     */
429 435
     public function parseHtmlTemplate($var)
430 436
     {
431 437
         $cplaces = array('%title%' => $this->title, '%shorttext%' => $this->shortText);
Please login to merge, or discard this patch.
src/LoginCidadao/NotificationBundle/Entity/NotificationRepository.php 3 patches
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -53,6 +53,9 @@  discard block
 block discarded – undo
53 53
         }
54 54
     }
55 55
 
56
+    /**
57
+     * @param PersonInterface $person
58
+     */
56 59
     public function getTotalUnreadGroupByClient($person)
57 60
     {
58 61
         $qb = $this->getEntityManager()->createQueryBuilder('n')
@@ -70,6 +73,9 @@  discard block
 block discarded – undo
70 73
                 ->getResult();
71 74
     }
72 75
 
76
+    /**
77
+     * @param PersonInterface $person
78
+     */
73 79
     public function getTotalUnread($person)
74 80
     {
75 81
         return $this->getEntityManager()->createQueryBuilder('n')
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -4,7 +4,6 @@
 block discarded – undo
4 4
 
5 5
 use Doctrine\ORM\EntityRepository;
6 6
 use LoginCidadao\CoreBundle\Entity\Person;
7
-use Doctrine\ORM\Query;
8 7
 use LoginCidadao\CoreBundle\Model\PersonInterface;
9 8
 use LoginCidadao\OAuthBundle\Model\ClientInterface;
10 9
 
Please login to merge, or discard this patch.
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -12,8 +12,8 @@  discard block
 block discarded – undo
12 12
 {
13 13
 
14 14
     public function findNextNotifications(Person $person, $items = 8,
15
-                                          $lastId = 0,
16
-                                          ClientInterface $client = null)
15
+                                            $lastId = 0,
16
+                                            ClientInterface $client = null)
17 17
     {
18 18
         $qb = $this->getEntityManager()->createQueryBuilder()
19 19
             ->select('n')
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
         return $this->getEntityManager()->createQueryBuilder('n')
76 76
                 ->select('COUNT(n.id) total')
77 77
                 ->from('LoginCidadaoNotificationBundle:Notification',
78
-                       'n')
78
+                        'n')
79 79
                 ->where('n.person = :person')
80 80
                 ->andWhere('n.readDate IS NULL')
81 81
                 ->setParameter('person', $person)
Please login to merge, or discard this patch.
NotificationBundle/Handler/AuthenticatedNotificationHandler.php 2 patches
Unused Use Statements   -7 removed lines patch added patch discarded remove patch
@@ -2,17 +2,10 @@
 block discarded – undo
2 2
 
3 3
 namespace LoginCidadao\NotificationBundle\Handler;
4 4
 
5
-use Doctrine\Common\Persistence\ObjectManager;
6
-use Symfony\Component\Form\FormFactoryInterface;
7 5
 use LoginCidadao\NotificationBundle\Handler\NotificationHandlerInterface;
8
-use LoginCidadao\NotificationBundle\Form\NotificationType;
9
-use LoginCidadao\NotificationBundle\Model\NotificationInterface;
10
-use LoginCidadao\NotificationBundle\Exception\InvalidFormException;
11 6
 use LoginCidadao\CoreBundle\Model\PersonInterface;
12 7
 use LoginCidadao\OAuthBundle\Model\ClientInterface;
13 8
 use LoginCidadao\NotificationBundle\Model\CategoryInterface;
14
-use LoginCidadao\NotificationBundle\Entity\PersonNotificationOption;
15
-use LoginCidadao\NotificationBundle\Model\NotificationSettings;
16 9
 use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
17 10
 
18 11
 class AuthenticatedNotificationHandler implements AuthenticatedNotificationHandlerInterface
Please login to merge, or discard this patch.
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
     }
46 46
 
47 47
     public function getAllFromClient(ClientInterface $client, $limit = 5,
48
-                                     $offset = 0, $orderby = null)
48
+                                        $offset = 0, $orderby = null)
49 49
     {
50 50
         return $this->handler->getAllFromPersonByClient($this->person, $client,
51 51
                                                         $limit, $offset,
@@ -78,10 +78,10 @@  discard block
 block discarded – undo
78 78
     }
79 79
 
80 80
     public function getGroupedSettings(ClientInterface $client = null,
81
-                                       CategoryInterface $category = null)
81
+                                        CategoryInterface $category = null)
82 82
     {
83 83
         return $this->handler->getGroupedSettings($this->person, $client,
84
-                                                  $category);
84
+                                                    $category);
85 85
     }
86 86
 
87 87
     public function countUnread()
Please login to merge, or discard this patch.
src/LoginCidadao/NotificationBundle/Handler/NotificationHandler.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -372,6 +372,9 @@
 block discarded – undo
372 372
         return $this->oauthDefaultClient;
373 373
     }
374 374
 
375
+    /**
376
+     * @param resource $ch
377
+     */
375 378
     protected function registerFailedCallback(NotificationInterface $notification,
376 379
                                               ObjectManager $om, $ch,
377 380
                                               $curlResponse)
Please login to merge, or discard this 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 2 patches
Doc Comments   +3 added lines, -4 removed lines patch added patch discarded remove patch
@@ -48,8 +48,8 @@  discard block
 block discarded – undo
48 48
      * Same as getAllFromPerson but uses the notification's id as the offset.
49 49
      *
50 50
      * @param PersonInterface $person
51
-     * @param type $limit
52
-     * @param type $offset the id of the last notification received
51
+     * @param integer $limit
52
+     * @param integer $offset the id of the last notification received
53 53
      * @param ClientInterface $client optionally filters by OAuth Client
54 54
      *
55 55
      * @return NotificationInterface[]
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
      * Retrieves a person's settings.
114 114
      *
115 115
      * @param PersonInterface   $person
116
-     * @param CategoryInterface $client optionally filter by category
116
+     * @param ClientInterface $client optionally filter by category
117 117
      * @param ClientInterface $client optionally filter by client
118 118
      *
119 119
      * @return PersonNotificationOption[]
@@ -184,7 +184,6 @@  discard block
 block discarded – undo
184 184
     /**
185 185
      * Return a person's number of unread notifications grouping by Client
186 186
      * @param PersonInterface $person
187
-     * @param ClientInterface $client
188 187
      *
189 188
      * @return array
190 189
      */
Please login to merge, or discard this 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/Helper/NotificationsHelper.php 2 patches
Doc Comments   +13 added lines patch added patch discarded remove patch
@@ -69,6 +69,9 @@  discard block
 block discarded – undo
69 69
         return $this->em->getRepository("LoginCidadaoNotificationBundle:Notification");
70 70
     }
71 71
 
72
+    /**
73
+     * @return \LoginCidadao\CoreBundle\Model\PersonInterface
74
+     */
72 75
     public function getUser()
73 76
     {
74 77
         return $this->context->getToken()->getUser();
@@ -101,6 +104,16 @@  discard block
 block discarded – undo
101 104
         }
102 105
     }
103 106
 
107
+    /**
108
+     * @param string $title
109
+     * @param string $shortText
110
+     * @param string $text
111
+     * @param string $icon
112
+     * @param Notification $notification
113
+     * @param Placeholder[] $parameters
114
+     *
115
+     * @return NotificationInterface
116
+     */
104 117
     private function getDefaultNotification(Person $person, $title, $shortText,
105 118
                                             $text, $icon, Category $category,
106 119
                                             $notification, $parameters = null)
Please login to merge, or discard this patch.
Unused Use Statements   -5 removed lines patch added patch discarded remove patch
@@ -10,12 +10,7 @@
 block discarded – undo
10 10
 use LoginCidadao\NotificationBundle\Entity\Notification;
11 11
 use LoginCidadao\NotificationBundle\Entity\Category;
12 12
 use LoginCidadao\NotificationBundle\Exception\MissingCategoryException;
13
-use Symfony\Component\Serializer\Normalizer\GetSetMethodNormalizer;
14
-use Symfony\Component\Serializer\Encoder\JsonEncoder;
15
-use Symfony\Component\Serializer\Serializer;
16
-use LoginCidadao\NotificationBundle\Form\NotificationType;
17 13
 use JMS\Serializer\SerializationContext;
18
-use LoginCidadao\NotificationBundle\Handler\NotificationHandler;
19 14
 use LoginCidadao\NotificationBundle\Entity\Placeholder;
20 15
 
21 16
 class NotificationsHelper
Please login to merge, or discard this patch.
src/LoginCidadao/NotificationBundle/Model/BroadcastPlaceholder.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -3,7 +3,6 @@
 block discarded – undo
3 3
 namespace LoginCidadao\NotificationBundle\Model;
4 4
 
5 5
 use LoginCidadao\NotificationBundle\Entity\Placeholder;
6
-use Doctrine\Common\Collections\ArrayCollection;
7 6
 use Doctrine\ORM\EntityManager;
8 7
 
9 8
 class BroadcastPlaceholder
Please login to merge, or discard this patch.
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -34,13 +34,13 @@
 block discarded – undo
34 34
 
35 35
     public function getValue()
36 36
     {
37
-      return $this->value;
37
+        return $this->value;
38 38
     }
39 39
 
40 40
     public function setValue($value)
41 41
     {
42
-      $this->value = $value;
43
-      return $this;
42
+        $this->value = $value;
43
+        return $this;
44 44
     }
45 45
     
46 46
     public function getName()
Please login to merge, or discard this patch.
src/LoginCidadao/OAuthBundle/Entity/Client.php 2 patches
Doc Comments   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -214,6 +214,9 @@  discard block
 block discarded – undo
214 214
         return $this->name;
215 215
     }
216 216
 
217
+    /**
218
+     * @param string $description
219
+     */
217 220
     public function setDescription($description)
218 221
     {
219 222
         $this->description = $description;
@@ -382,8 +385,8 @@  discard block
 block discarded – undo
382 385
 
383 386
     /**
384 387
      * Sets the Unique Id of the Entity.
385
-     * @param string $id the entity UID
386
-     * @return AbstractUniqueEntity
388
+     * @param string $uid the entity UID
389
+     * @return Client
387 390
      */
388 391
     public function setUid($uid = null)
389 392
     {
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,6 @@
 block discarded – undo
8 8
 use LoginCidadao\NotificationBundle\Entity\Notification;
9 9
 use Symfony\Component\HttpFoundation\File\File;
10 10
 use Symfony\Component\Validator\Constraints as Assert;
11
-use JMS\Serializer\Tests\Fixtures\Publisher;
12 11
 use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
13 12
 use JMS\Serializer\Annotation as JMS;
14 13
 use OAuth2\OAuth2;
Please login to merge, or discard this patch.
src/LoginCidadao/OAuthBundle/Entity/Organization.php 1 patch
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
 
140 140
     /**
141 141
      * @param PersonInterface[] $members
142
-     * @return \Organization
142
+     * @return Organization
143 143
      */
144 144
     public function setMembers(array $members)
145 145
     {
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
 
159 159
     /**
160 160
      * @param \DateTime $verifiedAt
161
-     * @return \Organization
161
+     * @return Organization
162 162
      */
163 163
     public function setVerifiedAt($verifiedAt)
164 164
     {
Please login to merge, or discard this patch.