Completed
Push — master ( 185853...b7deb5 )
by Marcel
01:56
created
src/Storages/Drivers/FileStorage.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@
 block discarded – undo
16 16
     }
17 17
 
18 18
     /**
19
-     * @param $key
19
+     * @param string $key
20 20
      * @return string
21 21
      */
22 22
     protected function getFilename($key)
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@
 block discarded – undo
36 36
 
37 37
         $saved = $this->get($key)->merge($data);
38 38
 
39
-        if (! is_dir(dirname($file))) {
39
+        if ( ! is_dir(dirname($file))) {
40 40
             mkdir(dirname($file), 0777, true);
41 41
         }
42 42
         file_put_contents($file, json_encode($saved->all()));
Please login to merge, or discard this patch.
src/Storages/Drivers/RedisStorage.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -82,7 +82,7 @@
 block discarded – undo
82 82
     /**
83 83
      * Namespace botman keys in redis.
84 84
      *
85
-     * @param $key
85
+     * @param string $key
86 86
      * @return string
87 87
      */
88 88
     private function decorateKey($key)
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
      */
28 28
     public function __construct($host = '127.0.0.1', $port = 6379, $auth = null)
29 29
     {
30
-        if (! class_exists(Redis::class)) {
30
+        if ( ! class_exists(Redis::class)) {
31 31
             throw new RuntimeException('phpredis extension is required for RedisStorage');
32 32
         }
33 33
         $this->host = $host;
Please login to merge, or discard this patch.
src/Middleware/Wit.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -109,7 +109,7 @@
 block discarded – undo
109 109
     {
110 110
         $entities = Collection::make($message->getExtras())->get('entities', []);
111 111
 
112
-        if (! empty($entities)) {
112
+        if ( ! empty($entities)) {
113 113
             foreach ($entities as $name => $entity) {
114 114
                 if ($name === 'intent') {
115 115
                     foreach ($entity as $item) {
Please login to merge, or discard this patch.
src/Middleware/MiddlewareManager.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -74,7 +74,7 @@
 block discarded – undo
74 74
      */
75 75
     public function applyMiddleware($method, $payload, array $additionalMiddleware = [], Closure $destination = null)
76 76
     {
77
-        $destination = is_null($destination) ? function ($payload) {
77
+        $destination = is_null($destination) ? function($payload) {
78 78
             return $payload;
79 79
         }
80 80
         : $destination;
Please login to merge, or discard this patch.
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@
 block discarded – undo
62 62
 
63 63
     /**
64 64
      * @param Matching[] ...$middleware
65
-     * @return Matching[]|$this
65
+     * @return Matching[]
66 66
      */
67 67
     public function matching(Matching ...$middleware)
68 68
     {
Please login to merge, or discard this patch.
src/Drivers/DriverManager.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -94,7 +94,7 @@
 block discarded – undo
94 94
      * @param string $name
95 95
      * @param array $config
96 96
      * @param Request|null $request
97
-     * @return mixed|HttpDriver|NullDriver
97
+     * @return HttpDriver
98 98
      */
99 99
     public static function loadFromName($name, array $config, Request $request = null)
100 100
     {
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@
 block discarded – undo
47 47
      */
48 48
     public static function getAvailableHttpDrivers()
49 49
     {
50
-        return Collection::make(self::$drivers)->filter(function ($driver) {
50
+        return Collection::make(self::$drivers)->filter(function($driver) {
51 51
             return is_subclass_of($driver, HttpDriver::class);
52 52
         })->toArray();
53 53
     }
Please login to merge, or discard this patch.
src/Traits/HandlesConversations.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@
 block discarded – undo
49 49
      * Get a stored conversation array from the cache for a given message.
50 50
      *
51 51
      * @param null|IncomingMessage $message
52
-     * @return array
52
+     * @return callable
53 53
      */
54 54
     public function getStoredConversation($message = null)
55 55
     {
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
      */
21 21
     public function startConversation(Conversation $instance, $recipient = null, $driver = null)
22 22
     {
23
-        if (! is_null($recipient) && ! is_null($driver)) {
23
+        if ( ! is_null($recipient) && ! is_null($driver)) {
24 24
             $this->message = new IncomingMessage('', $recipient, '');
25 25
             $this->driver = DriverManager::loadFromName($driver, $this->config);
26 26
         }
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
      */
75 75
     public function touchCurrentConversation()
76 76
     {
77
-        if (! is_null($this->currentConversationData)) {
77
+        if ( ! is_null($this->currentConversationData)) {
78 78
             $touched = $this->currentConversationData;
79 79
             $touched['time'] = microtime();
80 80
 
@@ -167,11 +167,11 @@  discard block
 block discarded – undo
167 167
     {
168 168
         $this->loadedConversation = false;
169 169
 
170
-        Collection::make($this->getMessages())->reject(function (IncomingMessage $message) {
170
+        Collection::make($this->getMessages())->reject(function(IncomingMessage $message) {
171 171
             return $message->isFromBot();
172
-        })->filter(function (IncomingMessage $message) {
172
+        })->filter(function(IncomingMessage $message) {
173 173
             return $this->cache->has($message->getConversationIdentifier()) || $this->cache->has($message->getOriginatedConversationIdentifier());
174
-        })->each(function ($message) {
174
+        })->each(function($message) {
175 175
             $message = $this->middleware->applyMiddleware('received', $message);
176 176
             $message = $this->middleware->applyMiddleware('captured', $message);
177 177
 
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
     {
246 246
         /** @var \BotMan\BotMan\Messages\Conversations\Conversation $conversation */
247 247
         $conversation = $convo['conversation'];
248
-        if (! $conversation instanceof ShouldQueue) {
248
+        if ( ! $conversation instanceof ShouldQueue) {
249 249
             $conversation->setBot($this);
250 250
         }
251 251
         /*
Please login to merge, or discard this patch.
src/Messages/Conversations/Conversation.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
     {
120 120
         $conversation = $this->bot->getStoredConversation();
121 121
 
122
-        if (! $question instanceof Question && ! $question) {
122
+        if ( ! $question instanceof Question && ! $question) {
123 123
             $question = unserialize($conversation['question']);
124 124
         }
125 125
 
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
         if (is_string($next)) {
130 130
             $next = unserialize($next)->getClosure();
131 131
         } elseif (is_array($next)) {
132
-            $next = Collection::make($next)->map(function ($callback) {
132
+            $next = Collection::make($next)->map(function($callback) {
133 133
                 if ($this->bot->getDriver()->serializesCallbacks() && ! $this->bot->runsOnSocket()) {
134 134
                     $callback['callback'] = unserialize($callback['callback'])->getClosure();
135 135
                 }
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
     public function __sleep()
184 184
     {
185 185
         $properties = get_object_vars($this);
186
-        if (! $this instanceof ShouldQueue) {
186
+        if ( ! $this instanceof ShouldQueue) {
187 187
             unset($properties['bot']);
188 188
         }
189 189
 
Please login to merge, or discard this patch.
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
     /**
168 168
      * Should the conversation be skipped (temporarily).
169 169
      * @param  IncomingMessage $message
170
-     * @return bool
170
+     * @return boolean|null
171 171
      */
172 172
     public function skipsConversation(IncomingMessage $message)
173 173
     {
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
     /**
178 178
      * Should the conversation be removed and stopped (permanently).
179 179
      * @param  IncomingMessage $message
180
-     * @return bool
180
+     * @return boolean|null
181 181
      */
182 182
     public function stopsConversation(IncomingMessage $message)
183 183
     {
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
 
187 187
     /**
188 188
      * Override default conversation cache time (only for this conversation).
189
-     * @return mixed
189
+     * @return integer|null
190 190
      */
191 191
     public function getConversationCacheTime()
192 192
     {
Please login to merge, or discard this patch.
src/Messages/Incoming/IncomingMessage.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -87,7 +87,7 @@
 block discarded – undo
87 87
      */
88 88
     public function getExtras($key = null)
89 89
     {
90
-        if (! is_null($key)) {
90
+        if ( ! is_null($key)) {
91 91
             return Collection::make($this->extras)->get($key);
92 92
         }
93 93
 
Please login to merge, or discard this patch.
src/Commands/ConversationManager.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@
 block discarded – undo
34 34
      *
35 35
      * @param IncomingMessage $message
36 36
      * @param array $parameters
37
-     * @return array
37
+     * @return callable
38 38
      */
39 39
     public function addDataParameters(IncomingMessage $message, array $parameters)
40 40
     {
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@
 block discarded – undo
66 66
     public function getMatchingMessages($messages, MiddlewareManager $middleware, Answer $answer, DriverInterface $driver, $withReceivedMiddleware = true) : array
67 67
     {
68 68
         $matcher = new Matcher();
69
-        $messages = Collection::make($messages)->reject(function (IncomingMessage $message) {
69
+        $messages = Collection::make($messages)->reject(function(IncomingMessage $message) {
70 70
             return $message->isFromBot();
71 71
         });
72 72
 
Please login to merge, or discard this patch.