Completed
Push — master ( 694c49...18d05c )
by Marcel
02:12
created
src/Commands/Command.php 1 patch
Spacing   +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
     public function driver($driver)
86 86
     {
87
-        $this->driver = Collection::make($driver)->transform(function ($driver) {
87
+        $this->driver = Collection::make($driver)->transform(function($driver) {
88 88
             if (class_exists($driver) && is_subclass_of($driver, DriverInterface::class)) {
89 89
                 $driver = basename(str_replace('\\', '/', $driver));
90 90
                 $driver = preg_replace('/(.*)(Driver)$/', '$1', $driver);
@@ -149,11 +149,11 @@  discard block
 block discarded – undo
149 149
      */
150 150
     public function middleware($middleware)
151 151
     {
152
-        if (! is_array($middleware)) {
152
+        if ( ! is_array($middleware)) {
153 153
             $middleware = [$middleware];
154 154
         }
155 155
 
156
-        $this->middleware = Collection::make($middleware)->filter(function ($item) {
156
+        $this->middleware = Collection::make($middleware)->filter(function($item) {
157 157
             return $item instanceof Matching || $item instanceof Heard;
158 158
         })->merge($this->middleware)->toArray();
159 159
 
Please login to merge, or discard this patch.
src/BotMan.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
      */
199 199
     public function getBotMessages()
200 200
     {
201
-        return Collection::make($this->getDriver()->getMessages())->filter(function (IncomingMessage $message) {
201
+        return Collection::make($this->getDriver()->getMessages())->filter(function(IncomingMessage $message) {
202 202
             return $message->isFromBot();
203 203
         })->toArray();
204 204
     }
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
     {
250 250
         preg_match_all(Matcher::PARAM_NAME_REGEX, $value, $matches);
251 251
 
252
-        return array_map(function ($m) {
252
+        return array_map(function($m) {
253 253
             return trim($m, '?');
254 254
         }, $matches[1]);
255 255
     }
@@ -364,9 +364,9 @@  discard block
 block discarded – undo
364 364
         if ($driverEvent instanceof DriverEventInterface) {
365 365
             $this->firedDriverEvents = true;
366 366
 
367
-            Collection::make($this->events)->filter(function ($event) use ($driverEvent) {
367
+            Collection::make($this->events)->filter(function($event) use ($driverEvent) {
368 368
                 return $driverEvent->getName() === $event['name'];
369
-            })->each(function ($event) use ($driverEvent) {
369
+            })->each(function($event) use ($driverEvent) {
370 370
                 /**
371 371
                  * Load the message, so driver events can reply.
372 372
                  */
@@ -431,7 +431,7 @@  discard block
 block discarded – undo
431 431
             // Set the message first, so it's available for middlewares
432 432
             $this->message = $matchingMessage->getMessage();
433 433
 
434
-            $commandMiddleware = Collection::make($this->command->getMiddleware())->filter(function ($middleware) {
434
+            $commandMiddleware = Collection::make($this->command->getMiddleware())->filter(function($middleware) {
435 435
                 return $middleware instanceof Heard;
436 436
             })->toArray();
437 437
 
@@ -538,7 +538,7 @@  discard block
 block discarded – undo
538 538
      */
539 539
     public function ask($question, $next, $additionalParameters = [], $recipient = null, $driver = null)
540 540
     {
541
-        if (! is_null($recipient) && ! is_null($driver)) {
541
+        if ( ! is_null($recipient) && ! is_null($driver)) {
542 542
             if (is_string($driver)) {
543 543
                 $driver = DriverManager::loadFromName($driver, $this->config);
544 544
             }
@@ -610,7 +610,7 @@  discard block
 block discarded – undo
610 610
      */
611 611
     public function sendPayload($payload)
612 612
     {
613
-        return $this->middleware->applyMiddleware('sending', $payload, [], function ($payload) {
613
+        return $this->middleware->applyMiddleware('sending', $payload, [], function($payload) {
614 614
             $this->outgoingMessage = null;
615 615
 
616 616
             return $this->getDriver()->sendPayload($payload);
@@ -636,7 +636,7 @@  discard block
 block discarded – undo
636 636
      */
637 637
     protected function makeInvokableAction($action)
638 638
     {
639
-        if (! method_exists($action, '__invoke')) {
639
+        if ( ! method_exists($action, '__invoke')) {
640 640
             throw new UnexpectedValueException(sprintf(
641 641
                 'Invalid hears action: [%s]', $action
642 642
             ));
Please login to merge, or discard this patch.