Completed
Pull Request — master (#2)
by Craig
03:03
created
src/ServiceProvider.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
             'laravel-yourls-plugin'
26 26
         );
27 27
 
28
-        $this->app->singleton(LaravelYourlsPlugin::class, function ($app) {
28
+        $this->app->singleton(LaravelYourlsPlugin::class, function($app) {
29 29
             return new LaravelYourlsPlugin($app['config']['laravel-yourls-plugin']);
30 30
         });
31 31
     }
Please login to merge, or discard this patch.
src/Response.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -50,18 +50,18 @@
 block discarded – undo
50 50
 
51 51
     protected function parseResponseBody($body)
52 52
     {
53
-        if(empty($body)){
53
+        if (empty($body)) {
54 54
             throw new \Exception("No response recieved");
55 55
         }
56 56
 
57
-        if( \is_string($body)){
57
+        if (\is_string($body)) {
58 58
             $this->status = 'success';
59 59
             $this->statusCode = '200';
60 60
             $this->shorturl = $url;
61 61
             return;
62 62
         }
63 63
 
64
-        foreach( (array) $body as $key => $value){
64
+        foreach ((array) $body as $key => $value) {
65 65
             $this->{$key} = $value;
66 66
         }
67 67
 
Please login to merge, or discard this patch.
src/LaravelYourlsPlugin.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -158,14 +158,14 @@  discard block
 block discarded – undo
158 158
      */
159 159
     public function stats(string $filter = null, int $limit = null, string $format = null)
160 160
     {
161
-        $filter = empty($filter) || ! in_array($filter, $this->filters) ? $this->filter : $filter;
161
+        $filter = empty($filter) || !in_array($filter, $this->filters) ? $this->filter : $filter;
162 162
 
163 163
         $params = [
164 164
             'action' => 'stats',
165 165
             'filter' => $filter,
166 166
             'format' => $this->setFormat($format),
167 167
         ];
168
-        if (! empty($limit)) {
168
+        if (!empty($limit)) {
169 169
             $params = array_merge($params, ['limit' => $limit]);
170 170
         }
171 171
 
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
         $form_params = array_merge($request, $this->authParam);
205 205
 
206 206
         $result = $this->client->request('POST', 'yourls-api.php', ['form_params' => $form_params]);
207
-        if(! $result || '200' != $result->getStatusCode()) {
207
+        if (!$result || '200' != $result->getStatusCode()) {
208 208
             throw new \Exception('Failed to process request');
209 209
         }
210 210
 
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
      *
233 233
      * @return string
234 234
      */
235
-    protected function setFormat(string $format = NULL){
236
-        return empty($format) || !in_array($format, $this->formats) ? $this->format: $format;
235
+    protected function setFormat(string $format = NULL) {
236
+        return empty($format) || !in_array($format, $this->formats) ? $this->format : $format;
237 237
     }
238 238
 }
Please login to merge, or discard this patch.