Completed
Push — master ( 166b13...ff8131 )
by dan
01:59
created
DatabaseNotificationManager.php 1 patch
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -17,6 +17,9 @@  discard block
 block discarded – undo
17 17
         $this->databaseConfiguration = $databaseConfiguration;
18 18
     }
19 19
 
20
+    /**
21
+     * @param \DateTime $now
22
+     */
20 23
     public function setReadAtDate(DatabaseNotificationInterface $notification, $now = null, $flush = true)
21 24
     {
22 25
         if (empty($now)) {
@@ -31,6 +34,9 @@  discard block
 block discarded – undo
31 34
         }
32 35
     }
33 36
 
37
+    /**
38
+     * @param \DateTime $now
39
+     */
34 40
     public function setUsersNotificationsAsRead(NotifiableInterface $notifiable, $now = null)
35 41
     {
36 42
         $entity = $this->notificationEntityName();
Please login to merge, or discard this patch.
Command/CreateDatabaseNotificationCommand.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@
 block discarded – undo
49 49
 
50 50
         // @TODO: Add existing bundle validation
51 51
         $question->setValidator(['Sensio\Bundle\GeneratorBundle\Command\Validators', 'validateBundleName']);
52
-        $question->setNormalizer(function ($value) {
52
+        $question->setNormalizer(function($value) {
53 53
             return $value ? trim($value) : '';
54 54
         });
55 55
         $question->setMaxAttempts(2);
Please login to merge, or discard this patch.
NotificationCollection.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@
 block discarded – undo
35 35
     public function markAsRead()
36 36
     {
37 37
         // @TODO: sort it.
38
-        $this->entities->forAll(function ($notification) {
38
+        $this->entities->forAll(function($notification) {
39 39
             $notification->markAsRead();
40 40
         });
41 41
     }
Please login to merge, or discard this patch.
Command/CreateNotificationCommand.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
         // @TODO: Add existing bundle validation
63 63
         $question->setValidator(['Sensio\Bundle\GeneratorBundle\Command\Validators', 'validateBundleName']);
64 64
         $question->setNormalizer(
65
-            function ($value) {
65
+            function($value) {
66 66
                 return $value ? trim($value) : '';
67 67
             }
68 68
         );
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
             $input->getOption('notification_name')
86 86
         );
87 87
         $question->setValidator(
88
-            function ($answer) {
88
+            function($answer) {
89 89
                 // Should only contain letters.
90 90
                 $valid = preg_match('/^[a-zA-Z]+$/', $answer);
91 91
                 if (!$valid) {
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
             }
99 99
         );
100 100
         $question->setNormalizer(
101
-            function ($value) {
101
+            function($value) {
102 102
                 return $value ? trim($value) : '';
103 103
             }
104 104
         );
@@ -164,19 +164,19 @@  discard block
 block discarded – undo
164 164
             ), 'yes'
165 165
         );
166 166
         $question->setNormalizer(
167
-            function ($value) {
167
+            function($value) {
168 168
                 return $value[0] == 'y' ? 'y' : 'n';
169 169
             }
170 170
         );
171 171
 
172 172
         $question->setValidator(
173
-            function ($answer) {
173
+            function($answer) {
174 174
                 // Should only contain letters.
175 175
                 $allowed = [
176 176
                     'y',
177 177
                     'n',
178 178
                 ];
179
-                $valid   = in_array($answer, $allowed);
179
+                $valid = in_array($answer, $allowed);
180 180
                 if (!$valid) {
181 181
                     throw new \RuntimeException(
182 182
                         'Only allowed value are ' . implode(', ', $allowed)
Please login to merge, or discard this patch.
Dispatcher/DatabaseMessageDispatcher.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -38,6 +38,9 @@
 block discarded – undo
38 38
         return false;
39 39
     }
40 40
 
41
+    /**
42
+     * @param MessageInterface $data
43
+     */
41 44
     protected function createDatabaseNotificationEntity($data)
42 45
     {
43 46
         if ($this->accessor === null) {
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 IrishDan\NotificationBundle\Dispatcher;
4 4
 
5 5
 use Doctrine\ORM\EntityManager;
6
-use IrishDan\NotificationBundle\Message\BaseMessage;
7 6
 use IrishDan\NotificationBundle\Message\MessageInterface;
8 7
 use Symfony\Component\PropertyAccess\PropertyAccess;
9 8
 
Please login to merge, or discard this patch.
Dispatcher/NexmoMessageDispatcher.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@
 block discarded – undo
25 25
         $messageData  = $message->getMessageData();
26 26
 
27 27
         if (empty($this->client)) {
28
-            $credentials  = new Client\Credentials\Basic(
28
+            $credentials = new Client\Credentials\Basic(
29 29
                 $this->nexmoConfiguration['api_key'],
30 30
                 $this->nexmoConfiguration['api_secret']
31 31
             );
Please login to merge, or discard this patch.
Broadcast/Broadcaster.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -4,7 +4,6 @@
 block discarded – undo
4 4
 
5 5
 
6 6
 use IrishDan\NotificationBundle\Channel\ChannelInterface;
7
-use IrishDan\NotificationBundle\Notification\NotifiableInterface;
8 7
 use IrishDan\NotificationBundle\Notification\NotificationInterface;
9 8
 
10 9
 class Broadcaster
Please login to merge, or discard this patch.
Formatter/MailDataFormatter.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,6 @@
 block discarded – undo
2 2
 
3 3
 namespace IrishDan\NotificationBundle\Formatter;
4 4
 
5
-use IrishDan\NotificationBundle\Message\MailMessage;
6 5
 use IrishDan\NotificationBundle\Message\Message;
7 6
 use IrishDan\NotificationBundle\Notification\NotificationInterface;
8 7
 
Please login to merge, or discard this patch.
Formatter/SlackWebhookFormatter.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,6 @@
 block discarded – undo
5 5
 use IrishDan\NotificationBundle\Message\Message;
6 6
 use IrishDan\NotificationBundle\Notification\NotificationInterface;
7 7
 use IrishDan\NotificationBundle\Slackable;
8
-use IrishDan\NotificationBundle\Textable;
9 8
 
10 9
 class SlackWebhookFormatter implements MessageFormatterInterface
11 10
 {
Please login to merge, or discard this patch.