Completed
Push — master ( 3c2aac...e01722 )
by Dan
02:38
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/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.
src/Examples/YesOrNoPlugin.php 2 patches
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -53,6 +53,9 @@  discard block
 block discarded – undo
53 53
         $this->respond($msg);
54 54
     }
55 55
 
56
+    /**
57
+     * @param string $force
58
+     */
56 59
     private function respond(Message $msg, $force = null)
57 60
     {
58 61
         $url = $this->url($force);
@@ -67,6 +70,9 @@  discard block
 block discarded – undo
67 70
             );
68 71
     }
69 72
 
73
+    /**
74
+     * @return string
75
+     */
70 76
     private function url($force = null)
71 77
     {
72 78
         $query = $force ? "?force=$force" : '';
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@
 block discarded – undo
58 58
         $url = $this->url($force);
59 59
         $this->guzzle->getAsync($url)
60 60
             ->then(
61
-                function (ResponseInterface $response) use ($msg) {
61
+                function(ResponseInterface $response) use ($msg) {
62 62
                     $json = $response->getBody();
63 63
                     $rsp = json_decode($json);
64 64
 
Please login to merge, or discard this patch.
src/GitHubV4/GitHubPlugin.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@
 block discarded – undo
54 54
 
55 55
         $this->postAsync($url, ['body' => '{"query": "query { viewer { login }}"}'])
56 56
             ->then(
57
-                function (ResponseInterface $response) use ($msg) {
57
+                function(ResponseInterface $response) use ($msg) {
58 58
                     $json = $response->getBody();
59 59
                     $msg->reply($json);
60 60
                 }
Please login to merge, or discard this patch.
src/Giphy/GiphyPlugin.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
     {
67 67
         if (trim($matches[1]) === 'formats') {
68 68
             $formats = $this->getFormats();
69
-            $msg->reply('Available formats: ' . implode(' ', $formats));
69
+            $msg->reply('Available formats: '.implode(' ', $formats));
70 70
             $msg->setHandled(true);
71 71
             return;
72 72
         }
@@ -76,10 +76,10 @@  discard block
 block discarded – undo
76 76
         $format = $this->getFormat($terms);
77 77
 
78 78
         $this->giphyService->search($query, $format)->then(
79
-            function (string $gifUrl) use ($msg) {
79
+            function(string $gifUrl) use ($msg) {
80 80
                 $msg->reply($gifUrl);
81 81
             },
82
-            function (Exception $e) {
82
+            function(Exception $e) {
83 83
                 $this->getLog()->warning($e->getMessage());
84 84
             }
85 85
         );
Please login to merge, or discard this patch.