Passed
Push — master ( ed0c97...af6300 )
by Johnny
02:49 queued 10s
created
src/Cortex/Triggers/Wildcard.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -52,13 +52,13 @@
 block discarded – undo
52 52
         ];
53 53
 
54 54
         foreach ($wildcards as $pattern => $replacement) {
55
-            $parsedTrigger = preg_replace($pattern, '(' . $replacement . ')', $trigger);
55
+            $parsedTrigger = preg_replace($pattern, '('.$replacement.')', $trigger);
56 56
 
57 57
             if ($parsedTrigger === $trigger) {
58 58
                 continue;
59 59
             }
60 60
 
61
-            if (@preg_match_all('/' . $parsedTrigger . '$/iu', $input->source(), $wildcards)) {
61
+            if (@preg_match_all('/'.$parsedTrigger.'$/iu', $input->source(), $wildcards)) {
62 62
                 array_shift($wildcards);
63 63
 
64 64
                 $wildcards = Collection::make($wildcards)->flatten()->all();
Please login to merge, or discard this patch.
src/Cortex/Triggers/Optional.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -90,7 +90,7 @@
 block discarded – undo
90 90
                     $sentences [] = trim($tmp);
91 91
                 }
92 92
 
93
-                $result = array_filter($sentences, static function (string $sentence) use ($input) {
93
+                $result = array_filter($sentences, static function(string $sentence) use ($input) {
94 94
                     return (strtolower($sentence) === strtolower($input->source()));
95 95
                 });
96 96
 
Please login to merge, or discard this patch.
src/Cortex/Tags/OptionalTag.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -90,7 +90,7 @@
 block discarded – undo
90 90
                     $sentences [] = trim($tmp);
91 91
                 }
92 92
 
93
-                $result = array_filter($sentences, static function (string $sentence) use ($input) {
93
+                $result = array_filter($sentences, static function(string $sentence) use ($input) {
94 94
                     return (strtolower($sentence) === strtolower($input->source()));
95 95
                 });
96 96
 
Please login to merge, or discard this patch.
src/Cortex/Triggers/Alternation.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
                 if (count($set) > 0) {
91 91
                     if ($match[1] === '(') {
92 92
                         foreach ($set as $setIndex => $item) {
93
-                            $set[$setIndex] = $this->signatures['alternation'] . $item;
93
+                            $set[$setIndex] = $this->signatures['alternation'].$item;
94 94
                             $set[$setIndex] = str_replace(" ", $this->signatures['alternation'], $set[$setIndex]);
95 95
                         }
96 96
                         $triggerString = str_replace($match[0], "{{$index}}", $triggerString);
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
                         $tmp = str_replace("{{$index}}", $string, $tmp);
122 122
                     }
123 123
 
124
-                    $tmp = str_replace([$this->signatures['optional'] . " ", $this->signatures['optional']], "", $tmp);
124
+                    $tmp = str_replace([$this->signatures['optional']." ", $this->signatures['optional']], "", $tmp);
125 125
                     $tmp = trim($tmp);
126 126
 
127 127
                     $sentences [] = $tmp;
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
                 $signature = $this->signatures['alternation'];
131 131
                 $cmp = [$this, 'isMatchesWithoutSignature'];
132 132
 
133
-                $result = array_filter($sentences, static function (string $sentence) use ($input, $signature, $cmp) {
133
+                $result = array_filter($sentences, static function(string $sentence) use ($input, $signature, $cmp) {
134 134
                     if (strpos($sentence, $signature) > -1) {
135 135
                         return $cmp(strtolower($sentence), strtolower($input->source()));
136 136
                     }
Please login to merge, or discard this patch.
src/Cortex/Responses/Condition.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -51,8 +51,8 @@
 block discarded – undo
51 51
                         $matches = $this->getMatchesFromPattern($pattern, $this->source());
52 52
                         $condition = $matches[0][0];
53 53
 
54
-                        $ret = str_replace($condition, "",  $this->source());
55
-                        return str_replace($condition, "",  $this->source());
54
+                        $ret = str_replace($condition, "", $this->source());
55
+                        return str_replace($condition, "", $this->source());
56 56
                     }
57 57
 
58 58
                 }
Please login to merge, or discard this patch.
src/Console/ChatCommand.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
     public function execute(InputInterface $input, OutputInterface $output): int
76 76
     {
77 77
         try {
78
-            $this->rivescript->onSay = static function (string $msg, int $verbosity) use ($output) {
78
+            $this->rivescript->onSay = static function(string $msg, int $verbosity) use ($output) {
79 79
                 $output->writeln("Say: {$msg}", $verbosity);
80 80
             };
81 81
 
@@ -91,8 +91,8 @@  discard block
 block discarded – undo
91 91
             $output->writeln('RiveScript Interpreter (PHP) -- Interactive Console v2.0');
92 92
             $output->writeln('--------------------------------------------------------');
93 93
             $output->writeln('RiveScript Version:       2.0');
94
-            $output->writeln('Currently Loaded Source:  ' . $loadedSource);
95
-            $output->writeln('Debug mode: ' . $debugMode);
94
+            $output->writeln('Currently Loaded Source:  '.$loadedSource);
95
+            $output->writeln('Debug mode: '.$debugMode);
96 96
 
97 97
             $output->writeln('');
98 98
             $output->writeln('You are now chatting with a RiveScript bot. Type a message and press Return');
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
         $reply = $this->rivescript->reply($message);
183 183
         $response = "<info>{$reply}</info>";
184 184
 
185
-        $output->writeln($bot . $response);
185
+        $output->writeln($bot.$response);
186 186
 
187 187
         $this->waitForUserInput($input, $output);
188 188
     }
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
         if (is_dir($info)) {
200 200
             $directory = realpath($info);
201 201
             $files = [];
202
-            $brains = glob($directory . '/*.rive');
202
+            $brains = glob($directory.'/*.rive');
203 203
 
204 204
             foreach ($brains as $brain) {
205 205
                 $files[] = $brain;
Please login to merge, or discard this patch.
src/Cortex/Tags/Tag.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
         $this->sourceType = $sourceType;
72 72
 
73 73
         if (!isset($this->allowedSources)) {
74
-            throw new LogicException(get_class($this) . " must have an \"allowedSources\" property declared.");
74
+            throw new LogicException(get_class($this)." must have an \"allowedSources\" property declared.");
75 75
         }
76 76
     }
77 77
 
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
                 break;
110 110
             } elseif ($content[$i] === '>') {
111 111
                 $reminder = substr($content, $i + 1);
112
-                return ['response' => "<" . $tag . ">", 'reminder' => $reminder];
112
+                return ['response' => "<".$tag.">", 'reminder' => $reminder];
113 113
             }
114 114
 
115 115
             $tag .= $content[$i];
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
         $result = $this->secureSource($reminder, $tagName, ">");
119 119
         $reminder = $result['reminder'];
120 120
 
121
-        $response = (isset($tags[$tag]) === true) ? $result['response'] : "<" . $tag . " " . $result['response'] . ">";
121
+        $response = (isset($tags[$tag]) === true) ? $result['response'] : "<".$tag." ".$result['response'].">";
122 122
 
123 123
         return ['response' => $response, 'reminder' => $reminder];
124 124
     }
Please login to merge, or discard this patch.
src/Rivescript.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
     {
87 87
         parent::__construct();
88 88
 
89
-        include __DIR__ . '/bootstrap.php';
89
+        include __DIR__.'/bootstrap.php';
90 90
 
91 91
         synapse()->brain->setMaster($this);
92 92
         synapse()->rivescript = $this;
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
     private function registerTags(): void
103 103
     {
104 104
         synapse()->tags->each(
105
-            function ($tag) {
105
+            function($tag) {
106 106
                 $class = "\\Axiom\\Rivescript\\Cortex\\Tags\\$tag";
107 107
                 $tagInstance = new $class();
108 108
 
@@ -242,7 +242,7 @@  discard block
 block discarded – undo
242 242
      */
243 243
     public function warn(string $message, array $args = [], int $verbosity = Rivescript::VERBOSITY_NORMAL): void
244 244
     {
245
-        $message = "[WARNING]: " . $this->formatString($message, $args);
245
+        $message = "[WARNING]: ".$this->formatString($message, $args);
246 246
 
247 247
         if ($this->onWarn) {
248 248
             call_user_func($this->onWarn, $message, $verbosity);
Please login to merge, or discard this patch.
src/Cortex/ResponseQueue/ResponseQueue.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
     public function attach(Node $node): void
82 82
     {
83 83
         $type = $this->determineResponseType($node->source());
84
-        $queueItem =  new ResponseQueueItem($node->command(), $node->value(),   $type, 0, $this->options);
84
+        $queueItem = new ResponseQueueItem($node->command(), $node->value(), $type, 0, $this->options);
85 85
         $this->responses->put($node->value(), $queueItem);
86 86
     }
87 87
 
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
     private function sortResponses(Collection $responses): Collection
96 96
     {
97 97
         return $responses->sort(
98
-            function ($current, $previous) {
98
+            function($current, $previous) {
99 99
                 return ($current->order < $previous->order) ? -1 : 1;
100 100
             }
101 101
         )->reverse();
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
 
147 147
         $continues = Collection::make($responses->all());
148 148
         $continues->each(
149
-            function (ResponseQueueItem $data, $response) use (&$lastData, &$lastResponse, &$continues) {
149
+            function(ResponseQueueItem $data, $response) use (&$lastData, &$lastResponse, &$continues) {
150 150
 
151 151
                 if ($data->type === 'continue') {
152 152
                     $continues->remove($lastResponse);
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
     private function determineResponseOrder(Collection $responses): Collection
200 200
     {
201 201
         return $responses->each(
202
-            function (ResponseQueueItem $data, $response) use ($responses) {
202
+            function(ResponseQueueItem $data, $response) use ($responses) {
203 203
                 if (isset($data->type)) {
204 204
                     switch ($data->type) {
205 205
                         case 'condition':
Please login to merge, or discard this patch.