Passed
Push — master ( 7494de...312a8a )
by Erjan
03:32
created
src/Message.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -116,7 +116,7 @@
 block discarded – undo
116 116
      */
117 117
     public function send($content = null)
118 118
     {
119
-        if (! is_null($content))
119
+        if (!is_null($content))
120 120
             $this->setContent($content);
121 121
 
122 122
         return $this->client->api->sendMessage($this);
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -116,8 +116,9 @@
 block discarded – undo
116 116
      */
117 117
     public function send($content = null)
118 118
     {
119
-        if (! is_null($content))
120
-            $this->setContent($content);
119
+        if (! is_null($content)) {
120
+                    $this->setContent($content);
121
+        }
121 122
 
122 123
         return $this->client->api->sendMessage($this);
123 124
     }
Please login to merge, or discard this patch.
src/Client.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@
 block discarded – undo
28 28
     {
29 29
         if (is_null($events_handler)) {
30 30
             $events_handler = new EventsHandler();
31
-        } elseif (! $events_handler instanceof EventsHandler) {
31
+        } elseif (!$events_handler instanceof EventsHandler) {
32 32
             throw new InvalidArgumentException('Second parameter must be instance of EventsHandler');
33 33
         }
34 34
 
Please login to merge, or discard this patch.
src/EventsHandler.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@
 block discarded – undo
26 26
      */
27 27
     public function run($name, $data)
28 28
     {
29
-        if (! array_key_exists($name, $this->events))
29
+        if (!array_key_exists($name, $this->events))
30 30
             throw new \BadMethodCallException;
31 31
 
32 32
         if (is_callable($this->events[$name]))
Please login to merge, or discard this patch.
Braces   +8 added lines, -6 removed lines patch added patch discarded remove patch
@@ -26,13 +26,15 @@
 block discarded – undo
26 26
      */
27 27
     public function run($name, $data)
28 28
     {
29
-        if (! array_key_exists($name, $this->events))
30
-            throw new \BadMethodCallException;
29
+        if (! array_key_exists($name, $this->events)) {
30
+                    throw new \BadMethodCallException;
31
+        }
31 32
 
32
-        if (is_callable($this->events[$name]))
33
-            call_user_func($this->events[$name], $data);
34
-        else
35
-            call_user_func([$this, $this->events[$name]], $data);
33
+        if (is_callable($this->events[$name])) {
34
+                    call_user_func($this->events[$name], $data);
35
+        } else {
36
+                    call_user_func([$this, $this->events[$name]], $data);
37
+        }
36 38
     }
37 39
 
38 40
     /**
Please login to merge, or discard this patch.
src/Api.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -137,12 +137,12 @@
 block discarded – undo
137 137
         }
138 138
         
139 139
         $response = json_decode($this->guzzle->post($this->api_url_files, [
140
-             'multipart' => [
141
-                 [
140
+                'multipart' => [
141
+                    [
142 142
                     'name' => 'file',
143 143
                     'contents' => fopen($filename, 'r')
144
-                 ]
145
-             ]
144
+                    ]
145
+                ]
146 146
         ])->getBody());
147 147
 
148 148
         if ((isset($response->success)) && ($response->success)) {
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -132,7 +132,7 @@
 block discarded – undo
132 132
      */
133 133
     public function uploadFile($filename)
134 134
     {
135
-        if (! file_exists($filename)) {
135
+        if (!file_exists($filename)) {
136 136
             throw new \BadMethodCallException('File not exists');
137 137
         }
138 138
         
Please login to merge, or discard this patch.
examples/file.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@
 block discarded – undo
19 19
     $media->setType(Message::CONTENT_TYPE_MEDIA_IMAGE);
20 20
     $media->setContent($token);
21 21
 
22
-    $client->command('message/new', function ($message) use ($client, $media) {
22
+    $client->command('message/new', function($message) use ($client, $media) {
23 23
 
24 24
         $client->to($message['chat_id'])->setType($media->getType())->send($media->getContent());
25 25
         /* or */
Please login to merge, or discard this patch.
examples/echo.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -8,13 +8,13 @@
 block discarded – undo
8 8
 try {
9 9
     $client = new Client($API_KEY);
10 10
 
11
-    $client->command('user/follow', function ($user) use ($client) {
11
+    $client->command('user/follow', function($user) use ($client) {
12 12
         $chat = $client->api->createChat($user['id']);
13 13
 
14 14
         $client->to($chat->data->id)->send('Welcome');
15 15
     });
16 16
 
17
-    $client->command('message/new', function ($message) use ($client) {
17
+    $client->command('message/new', function($message) use ($client) {
18 18
         $client->to($message['chat_id'])->setType($message['type'])->send($message['content']);
19 19
     });
20 20
 
Please login to merge, or discard this patch.