Completed
Push — master ( 21f279...d6aafa )
by Maxim
02:34
created
src/Apns/Package.php 1 patch
Braces   +10 added lines, -5 removed lines patch added patch discarded remove patch
@@ -67,12 +67,14 @@  discard block
 block discarded – undo
67 67
     {
68 68
         $packagePath = $this->storage->getAdapter()->applyPathPrefix(static::PACKAGE_FILENAME);
69 69
 
70
-        if ($this->storage->has(static::PACKAGE_FILENAME)) {
70
+        if ($this->storage->has(static::PACKAGE_FILENAME))
71
+        {
71 72
             return $packagePath;
72 73
         }
73 74
 
74 75
         $this->zip = new \ZipArchive();
75
-        if ($this->zip->open($packagePath, \ZipArchive::CREATE) !== true) {
76
+        if ($this->zip->open($packagePath, \ZipArchive::CREATE) !== true)
77
+        {
76 78
             return false;
77 79
         }
78 80
 
@@ -97,7 +99,8 @@  discard block
 block discarded – undo
97 99
      */
98 100
     protected function addIcons()
99 101
     {
100
-        foreach ($this->icons as $file) {
102
+        foreach ($this->icons as $file)
103
+        {
101 104
             $this->addFile('icon.iconset/' . $file, $file);
102 105
         }
103 106
     }
@@ -148,7 +151,8 @@  discard block
 block discarded – undo
148 151
         $password = $this->certificate->getPassword();
149 152
 
150 153
         $certs = [];
151
-        if (! openssl_pkcs12_read($pkcs12, $certs, $password)) {
154
+        if (! openssl_pkcs12_read($pkcs12, $certs, $password))
155
+        {
152 156
             throw new \RuntimeException(openssl_error_string());
153 157
         }
154 158
 
@@ -164,7 +168,8 @@  discard block
 block discarded – undo
164 168
         // Convert the signature from PEM to DER
165 169
         $signature_pem = file_get_contents($signaturePath);
166 170
         $matches = [];
167
-        if (! preg_match('~Content-Disposition:[^\n]+\s*?([A-Za-z0-9+=/\r\n]+)\s*?-----~', $signature_pem, $matches)) {
171
+        if (! preg_match('~Content-Disposition:[^\n]+\s*?([A-Za-z0-9+=/\r\n]+)\s*?-----~', $signature_pem, $matches))
172
+        {
168 173
             throw new \RuntimeException(openssl_error_string());
169 174
         }
170 175
 
Please login to merge, or discard this patch.
src/Statistics.php 1 patch
Braces   +8 added lines, -4 removed lines patch added patch discarded remove patch
@@ -49,16 +49,20 @@
 block discarded – undo
49 49
      */
50 50
     public function provideListeners(ListenerAcceptorInterface $listener)
51 51
     {
52
-        $listener->addListener(NotificationSent::class, function ($e) {
52
+        $listener->addListener(NotificationSent::class, function ($e)
53
+        {
53 54
             $this->sent($e);
54 55
         });
55
-        $listener->addListener(NotificationDelivered::class, function ($e) {
56
+        $listener->addListener(NotificationDelivered::class, function ($e)
57
+        {
56 58
             $this->delivered($e);
57 59
         });
58
-        $listener->addListener(NotificationClicked::class, function ($e) {
60
+        $listener->addListener(NotificationClicked::class, function ($e)
61
+        {
59 62
             $this->clicked($e);
60 63
         });
61
-        $listener->addListener(NotificationFailed::class, function ($e) {
64
+        $listener->addListener(NotificationFailed::class, function ($e)
65
+        {
62 66
             $this->failed($e);
63 67
         });
64 68
 
Please login to merge, or discard this patch.
src/Driver.php 1 patch
Braces   +21 added lines, -10 removed lines patch added patch discarded remove patch
@@ -92,10 +92,14 @@  discard block
 block discarded – undo
92 92
 
93 93
         $partials = $this->splitSubscribers();
94 94
 
95
-        foreach ($partials as $provider => $subscribers) {
96
-            try {
95
+        foreach ($partials as $provider => $subscribers)
96
+        {
97
+            try
98
+            {
97 99
                 $this->provider($provider)->send($this->notification, $subscribers);
98
-            } catch (\RuntimeException $e) {
100
+            }
101
+            catch (\RuntimeException $e)
102
+            {
99 103
                 static::emit('flush.exception', $e);
100 104
             }
101 105
         }
@@ -133,20 +137,24 @@  discard block
 block discarded – undo
133 137
         $partials = [];
134 138
 
135 139
         /** @var Subscriber $subscriber */
136
-        foreach ($this->subscribers as $subscriber) {
140
+        foreach ($this->subscribers as $subscriber)
141
+        {
137 142
             $provider = $subscriber->getProvider();
138 143
 
139
-            if (! $this->project->providerConnected($provider)) {
144
+            if (! $this->project->providerConnected($provider))
145
+            {
140 146
                 continue;
141 147
             }
142 148
 
143
-            if (! isset($partials[$provider])) {
149
+            if (! isset($partials[$provider]))
150
+            {
144 151
                 $partials[$provider] = [];
145 152
             }
146 153
 
147 154
             $partials[$provider][] = $subscriber;
148 155
 
149
-            if ($this->payloadStorage) {
156
+            if ($this->payloadStorage)
157
+            {
150 158
                 $this->payloadStorage->assignNotificationToSubscriber(
151 159
                     $subscriber,
152 160
                     $this->notification,
@@ -165,11 +173,13 @@  discard block
 block discarded – undo
165 173
      */
166 174
     protected function validate()
167 175
     {
168
-        if (is_null($this->notification)) {
176
+        if (is_null($this->notification))
177
+        {
169 178
             throw new \RuntimeException("Notification wasn't set.");
170 179
         }
171 180
 
172
-        if (is_null($this->subscribers)) {
181
+        if (is_null($this->subscribers))
182
+        {
173 183
             throw new \RuntimeException('No subscribers set.');
174 184
         }
175 185
     }
@@ -202,7 +212,8 @@  discard block
 block discarded – undo
202 212
      */
203 213
     protected function bootListeners()
204 214
     {
205
-        if (! is_null($this->statisticsStorage)) {
215
+        if (! is_null($this->statisticsStorage))
216
+        {
206 217
             static::$events->useListenerProvider($this->statisticsStorage);
207 218
         }
208 219
     }
Please login to merge, or discard this patch.