Completed
Pull Request — master (#4)
by dan
14:39
created
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.
DatabaseNotificationManager.php 1 patch
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
 
85 85
     /**
86 86
      * @param DatabaseNotificationInterface $notification
87
-     * @param null                          $now
87
+     * @param null|\DateTime                          $now
88 88
      * @param bool                          $flush
89 89
      */
90 90
     public function setReadAtDate(DatabaseNotificationInterface $notification, $now = null, $flush = true)
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
 
105 105
     /**
106 106
      * @param NotifiableInterface $notifiable
107
-     * @param null                $now
107
+     * @param \DateTime                $now
108 108
      */
109 109
     public function setUsersNotificationsAsRead(NotifiableInterface $notifiable, $now = null)
110 110
     {
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
     }
160 160
 
161 161
     /**
162
-     * @return bool|mixed
162
+     * @return string
163 163
      */
164 164
     protected function notificationEntityName()
165 165
     {
Please login to merge, or discard this patch.
NotificationManager.php 1 patch
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
 
113 113
     /**
114 114
      * @param DatabaseNotificationInterface $notification
115
-     * @return bool
115
+     * @return boolean|null
116 116
      */
117 117
     public function markAsRead(DatabaseNotificationInterface $notification)
118 118
     {
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
 
129 129
     /**
130 130
      * @param NotifiableInterface $user
131
-     * @return bool
131
+     * @return boolean|null
132 132
      */
133 133
     public function markAllAsRead(NotifiableInterface $user)
134 134
     {
Please login to merge, or discard this patch.
Adapter/BaseMessageAdapter.php 1 patch
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
      * @param $data
40 40
      * @param $user
41 41
      * @param $template
42
-     * @return mixed
42
+     * @return string
43 43
      */
44 44
     protected function renderTwigTemplate($data, $user, $template)
45 45
     {
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
     }
139 139
 
140 140
     /**
141
-     * @param mixed $channeName
141
+     * @param string $channelName
142 142
      */
143 143
     public function setChannelName($channelName)
144 144
     {
Please login to merge, or discard this patch.
DependencyInjection/Configuration.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\DependencyInjection;
4 4
 
5
-use IrishDan\NotificationBundle\DependencyInjection\Factory\BroadcasterFactory;
6 5
 use IrishDan\NotificationBundle\DependencyInjection\Factory\ChannelFactory;
7 6
 use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
8 7
 use Symfony\Component\Config\Definition\Builder\TreeBuilder;
Please login to merge, or discard this patch.
Command/CreateNotificationCommand.php 2 patches
Spacing   +5 added lines, -5 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,13 +164,13 @@  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',
Please login to merge, or discard this patch.
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -157,6 +157,9 @@
 block discarded – undo
157 157
         $questionHelper->writeGeneratorSummary($output, []);
158 158
     }
159 159
 
160
+    /**
161
+     * @param InputInterface $input
162
+     */
160 163
     protected function createYesNoQuestion($questionHelper, $input, $channel)
161 164
     {
162 165
         $question = new Question(
Please login to merge, or discard this patch.
DependencyInjection/NotificationExtension.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\DependencyInjection\Factory\BroadcasterFactory;
6 6
 use IrishDan\NotificationBundle\DependencyInjection\Factory\ChannelFactory;
7 7
 use Symfony\Component\Config\FileLocator;
8
-use Symfony\Component\DependencyInjection\Compiler\PassConfig;
9 8
 use Symfony\Component\DependencyInjection\Definition;
10 9
 use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
11 10
 use Symfony\Component\DependencyInjection\Reference;
Please login to merge, or discard this patch.
EventListener/MessageCRUDSubscriber.php 1 patch
Doc Comments   +4 added lines patch added patch discarded remove patch
@@ -64,6 +64,10 @@
 block discarded – undo
64 64
         ];
65 65
     }
66 66
 
67
+    /**
68
+     * @param string $string
69
+     * @param \IrishDan\NotificationBundle\Message\MessageInterface $message
70
+     */
67 71
     protected function log($string, $message)
68 72
     {
69 73
         if ($this->logger) {
Please login to merge, or discard this patch.
Subscriber/NotificationChannelSubscriber.php 2 patches
Unused Use Statements   -5 removed lines patch added patch discarded remove patch
@@ -4,13 +4,8 @@
 block discarded – undo
4 4
 
5 5
 use IrishDan\NotificationBundle\Adapter\MessageAdapterInterface;
6 6
 use IrishDan\NotificationBundle\Channel\ChannelInterface;
7
-use IrishDan\NotificationBundle\Channel\EventChannel;
8
-use IrishDan\NotificationBundle\Event\MessageCreatedEvent;
9
-use IrishDan\NotificationBundle\Event\MessageDispatchedEvent;
10 7
 use IrishDan\NotificationBundle\Event\NotificationReadyToFormatEvent;
11 8
 use IrishDan\NotificationBundle\Exception\MessageDispatchException;
12
-use IrishDan\NotificationBundle\Message\MessageInterface;
13
-use Psr\Log\LoggerInterface;
14 9
 use Symfony\Component\EventDispatcher\EventDispatcherInterface;
15 10
 use Symfony\Component\EventDispatcher\EventSubscriberInterface;
16 11
 
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@
 block discarded – undo
68 68
         // get the adapter name from the
69 69
         // $adapterKey = $message->getChannel();
70 70
         $adapterKey = $this->channelConfigMap[$notification->getChannel()]['adapter'];
71
-        $channelConfiguration =  $this->channelConfigMap[$notification->getChannel()]['config'];
71
+        $channelConfiguration = $this->channelConfigMap[$notification->getChannel()]['config'];
72 72
 
73 73
         // Get the adapter for this channel
74 74
         // and inject it into the adapterless channel
Please login to merge, or discard this patch.