Completed
Branch master (0ca5af)
by Dan
04:49
created
src/Examples/NytPlugin.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,6 @@
 block discarded – undo
10 10
 use Nopolabs\Yabot\Plugins\Giphy\GiphyService;
11 11
 use Nopolabs\Yabot\Plugins\Rss\RssService;
12 12
 use Psr\Log\LoggerInterface;
13
-use React\EventLoop\LoopInterface;
14 13
 
15 14
 class NytPlugin implements PluginInterface
16 15
 {
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
         $this->rssService
51 51
             ->fetch($url)
52 52
             ->then(
53
-                function ($rss) use ($msg, $n) {
53
+                function($rss) use ($msg, $n) {
54 54
                     $items = $rss->channel->item;
55 55
                     $n = min($n, count($items));
56 56
                     $format = $this->get('format', 'fixed_height');
@@ -59,16 +59,16 @@  discard block
 block discarded – undo
59 59
                         $this->giphyService
60 60
                             ->search($title, $format)
61 61
                             ->then(
62
-                                function (string $gifUrl) use ($msg, $title, $i) {
62
+                                function(string $gifUrl) use ($msg, $title, $i) {
63 63
                                     $msg->reply("<$gifUrl|$i: $title>");
64 64
                                 },
65
-                                function (Exception $e) {
65
+                                function(Exception $e) {
66 66
                                     $this->getLog()->warning($e->getMessage());
67 67
                                 }
68 68
                             );
69 69
                     }
70 70
                 },
71
-                function (Exception $e) {
71
+                function(Exception $e) {
72 72
                     $this->getLog()->warning($e->getMessage());
73 73
                 }
74 74
             );
Please login to merge, or discard this patch.
src/Sms/TextPlugin.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@
 block discarded – undo
71 71
 
72 72
         $sink = new BufferedSink();
73 73
         $request->pipe($sink);
74
-        $sink->promise()->then(function ($data) use ($response) {
74
+        $sink->promise()->then(function($data) use ($response) {
75 75
             if (mb_parse_str($data, $result)) {
76 76
                 $from = $result['From'];
77 77
                 $body = $result['Body'];
Please login to merge, or discard this patch.
src/Giphy/GiphyPlugin.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
     {
86 86
         if (trim($matches[1]) === 'formats') {
87 87
             $formats = $this->getFormats();
88
-            $msg->reply('Available formats: ' . implode(' ', $formats));
88
+            $msg->reply('Available formats: '.implode(' ', $formats));
89 89
             $msg->setHandled(true);
90 90
             return;
91 91
         }
@@ -93,10 +93,10 @@  discard block
 block discarded – undo
93 93
         list($query, $format) = $this->getQueryAndFormat($matches);
94 94
 
95 95
         $this->giphyService->search($query, $format)->then(
96
-            function (string $gifUrl) use ($msg) {
96
+            function(string $gifUrl) use ($msg) {
97 97
                 $msg->reply($gifUrl);
98 98
             },
99
-            function (Exception $e) {
99
+            function(Exception $e) {
100 100
                 $this->getLog()->warning($e->getMessage());
101 101
             }
102 102
         );
@@ -131,6 +131,6 @@  discard block
 block discarded – undo
131 131
     {
132 132
         $default = $this->getFormat();
133 133
 
134
-        return $this->get('formats', [$default]);;
134
+        return $this->get('formats', [$default]); ;
135 135
     }
136 136
 }
137 137
\ No newline at end of file
Please login to merge, or discard this patch.
src/Giphy/GiphyService.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@
 block discarded – undo
52 52
         $this->getLog()->info($url);
53 53
 
54 54
         return $this->getAsync($url)->then(
55
-            function (ResponseInterface $response) use ($format) {
55
+            function(ResponseInterface $response) use ($format) {
56 56
                 return $this->extractGifUrl($format, $response);
57 57
             }
58 58
         );
Please login to merge, or discard this patch.
src/Rss/RssService.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
     public function fetchRaw(string $url) : PromiseInterface
37 37
     {
38 38
         return $this->getAsync($url)->then(
39
-            function (ResponseInterface $response) {
39
+            function(ResponseInterface $response) {
40 40
                 return $response->getBody();
41 41
             }
42 42
         );
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
     public function fetchXml(string $url) : PromiseInterface
46 46
     {
47 47
         return $this->getAsync($url)->then(
48
-            function (ResponseInterface $response) {
48
+            function(ResponseInterface $response) {
49 49
                 $data = $response->getBody();
50 50
                 $options = $this->get('SimpleXMLElementOptions', 0);
51 51
                 return new SimpleXMLElement($data, $options);
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
     public function fetchJson(string $url) : PromiseInterface
57 57
     {
58 58
         return $this->getAsync($url)->then(
59
-            function (ResponseInterface $response) {
59
+            function(ResponseInterface $response) {
60 60
                 $data = $response->getBody();
61 61
                 $xmlOptions = $this->get('SimpleXMLElementOptions', 0);
62 62
                 $xml = new SimpleXMLElement($data, $xmlOptions);
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
     public function fetch(string $url) : PromiseInterface
70 70
     {
71 71
         return $this->getAsync($url)->then(
72
-            function (ResponseInterface $response) {
72
+            function(ResponseInterface $response) {
73 73
                 $data = $response->getBody();
74 74
                 $xmlOptions = $this->get('SimpleXMLElementOptions', 0);
75 75
                 $xml = new SimpleXMLElement($data, $xmlOptions);
Please login to merge, or discard this patch.
src/Rss/RssPlugin.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@
 block discarded – undo
40 40
         $url = $matches['url'];
41 41
 
42 42
         $this->rssService->fetchJson($url)->then(
43
-            function (string $json) use ($msg) {
43
+            function(string $json) use ($msg) {
44 44
                 $msg->reply($json);
45 45
             }
46 46
         );
Please login to merge, or discard this patch.