Passed
Push — master ( 1eec8f...87a06b )
by Johnny
08:20
created
src/Cortex/Responses/Redirect.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@
 block discarded – undo
38 38
     public function parse()
39 39
     {
40 40
         if ($this->responseQueueItem()->getCommand() === '@') {
41
-           return $this->source();
41
+            return $this->source();
42 42
         }
43 43
 
44 44
         return false;
Please login to merge, or discard this patch.
src/Cortex/Tags/Sentence.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -86,7 +86,7 @@
 block discarded – undo
86 86
                     }
87 87
                 }
88 88
 
89
-               //  $sub = str_replace(["&#60;", "&#62;"], ["<", ">"], $sub);
89
+                //  $sub = str_replace(["&#60;", "&#62;"], ["<", ">"], $sub);
90 90
 
91 91
                 $source = str_replace($match[0], $sub, $source);
92 92
             }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -75,7 +75,7 @@
 block discarded – undo
75 75
                     if (strpos($sub, '.') > -1) {
76 76
                         $parts = explode('.', $sub);
77 77
                         if (count($parts) !== 0) {
78
-                            array_walk($parts, static function (&$part) {
78
+                            array_walk($parts, static function(&$part) {
79 79
                                 $part = ucfirst(trim($part));
80 80
                             });
81 81
                         }
Please login to merge, or discard this patch.
src/Rivescript.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -263,8 +263,8 @@  discard block
 block discarded – undo
263 263
      * @return void
264 264
      */
265 265
     public function warn(string $message,
266
-                         array  $args = [],
267
-                         int    $verbosity = Rivescript::VERBOSITY_DEBUG): void
266
+                            array  $args = [],
267
+                            int    $verbosity = Rivescript::VERBOSITY_DEBUG): void
268 268
     {
269 269
         $message = "[WARNING]: " . $this->formatString($message, $args);
270 270
 
@@ -281,8 +281,8 @@  discard block
 block discarded – undo
281 281
      * @return void
282 282
      */
283 283
     public function debug(string $message,
284
-                          array  $args = [],
285
-                          int    $verbosity = Rivescript::VERBOSITY_NORMAL): void
284
+                            array  $args = [],
285
+                            int    $verbosity = Rivescript::VERBOSITY_NORMAL): void
286 286
     {
287 287
         $message = "[DEBUG]: " . $this->formatString($message, $args);
288 288
 
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
     {
100 100
         parent::__construct();
101 101
 
102
-        include __DIR__ . '/bootstrap.php';
102
+        include __DIR__.'/bootstrap.php';
103 103
 
104 104
         synapse()->brain->setMaster($this);
105 105
         synapse()->rivescript = $this;
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
     private function registerTags(): void
124 124
     {
125 125
         synapse()->tags->each(
126
-            function ($tag) {
126
+            function($tag) {
127 127
                 $class = "\\Axiom\\Rivescript\\Cortex\\Tags\\$tag";
128 128
                 $tagInstance = new $class();
129 129
 
@@ -271,7 +271,7 @@  discard block
 block discarded – undo
271 271
                          array  $args = [],
272 272
                          int    $verbosity = Rivescript::VERBOSITY_DEBUG): void
273 273
     {
274
-        $message = "[WARNING]: " . $this->formatString($message, $args);
274
+        $message = "[WARNING]: ".$this->formatString($message, $args);
275 275
 
276 276
         $this->emit(Event::DEBUG_WARNING, $message);
277 277
     }
@@ -289,7 +289,7 @@  discard block
 block discarded – undo
289 289
                           array  $args = [],
290 290
                           int    $verbosity = Rivescript::VERBOSITY_NORMAL): void
291 291
     {
292
-        $message = "[DEBUG]: " . $this->formatString($message, $args);
292
+        $message = "[DEBUG]: ".$this->formatString($message, $args);
293 293
 
294 294
         $this->emit(EVENT::DEBUG, $message);
295 295
     }
Please login to merge, or discard this patch.
sandbox/api.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@
 block discarded – undo
25 25
 $rivescript->stream($script);
26 26
 
27 27
 $rivescript->on(Event::DEBUG, 'onDebug')
28
-           ->on(Event::DEBUG_VERBOSE, 'onVerbose');
28
+            ->on(Event::DEBUG_VERBOSE, 'onVerbose');
29 29
 
30 30
 
31 31
 echo $rivescript->reply("hi bot");
32 32
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@
 block discarded – undo
4 4
 use Axiom\Rivescript\Events\Event;
5 5
 use Axiom\Rivescript\Rivescript;
6 6
 
7
-$script =<<<EOF
7
+$script = <<<EOF
8 8
 + hi bot
9 9
 - hello human
10 10
 EOF;
Please login to merge, or discard this patch.
src/Cortex/Commands/Response.php 2 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -40,9 +40,9 @@
 block discarded – undo
40 40
     public function parse(Node $node): void
41 41
     {
42 42
         $types = [
43
-          '-', '*',
44
-          '^', '@',
45
-          '%'
43
+            '-', '*',
44
+            '^', '@',
45
+            '%'
46 46
         ];
47 47
 
48 48
         if (in_array($node->command(), $types) === true) {
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@
 block discarded – undo
56 56
             $key = -1;
57 57
             foreach (synapse()->brain->topic($topic)->triggers() as $index => $info) {
58 58
                 if ($info->getText() === $string) {
59
-                    $trigger= $info;
59
+                    $trigger = $info;
60 60
                     $key = $index;
61 61
                     break;
62 62
                 }
Please login to merge, or discard this patch.
src/Cortex/Topic.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
         $triggers = $this->determineWordCount($triggers);
103 103
         $triggers = $this->determineTypeCount($triggers);
104 104
 
105
-        return $triggers->sort(function ($current, $previous) {
105
+        return $triggers->sort(function($current, $previous) {
106 106
             return ($current->getOrder() < $previous->getOrder()) ? -1 : 1;
107 107
         })->reverse();
108 108
     }
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
      */
117 117
     protected function determineTypeCount(Collection $triggers): Collection
118 118
     {
119
-        return $triggers->each(function (&$trigger) use ($triggers) {
119
+        return $triggers->each(function(&$trigger) use ($triggers) {
120 120
 
121 121
             $order = $trigger->getOrder();
122 122
             $type = $trigger->getType();
Please login to merge, or discard this patch.
src/Cortex/Output.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -75,7 +75,7 @@
 block discarded – undo
75 75
         $triggers = synapse()->brain->topic($topic)->triggers();
76 76
 
77 77
         if ($recursion === synapse()->memory->global()->get('depth')) {
78
-            synapse()->rivescript->warn("Top many recursive calls to :func", ["func" => __CLASS__ . "::" . __FUNCTION__]);
78
+            synapse()->rivescript->warn("Top many recursive calls to :func", ["func" => __CLASS__."::".__FUNCTION__]);
79 79
             return "ERR: Deep Recursion Detected";
80 80
         }
81 81
 
Please login to merge, or discard this patch.
sandbox/rsts/app/TestCase.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -74,10 +74,10 @@  discard block
 block discarded – undo
74 74
         $this->rs = new Rivescript();
75 75
         $this->rs->setClientId($this->client_id);
76 76
 
77
-        $this->rs->on(Event::DEBUG, function ($msg) {
77
+        $this->rs->on(Event::DEBUG, function($msg) {
78 78
             echo "{$msg}\n";
79 79
         })
80
-        ->on(Event::DEBUG_VERBOSE, function ($msg) {
80
+        ->on(Event::DEBUG_VERBOSE, function($msg) {
81 81
             echo "{$msg}\n";
82 82
         });
83 83
 
@@ -119,8 +119,8 @@  discard block
 block discarded – undo
119 119
             $expected = rtrim($expected, "\n");
120 120
             if (strtolower($reply) !== strtolower($expected)) {
121 121
                 throw new AssertionError(
122
-                    "Got unexpected exception from reply() for input: {$step['input']}\n\n" .
123
-                    " Expected: {$expected}\n" .
122
+                    "Got unexpected exception from reply() for input: {$step['input']}\n\n".
123
+                    " Expected: {$expected}\n".
124 124
                     " Got: {$reply}"
125 125
                 );
126 126
             }
@@ -136,8 +136,8 @@  discard block
 block discarded – undo
136 136
             if ($correct === 0) {
137 137
                 $expected = implode(' or ', $expected);
138 138
                 throw new AssertionError(
139
-                    "Got unexpected exception from reply() for input: {$step['input']}\n\n" .
140
-                    " Expected: {$expected}\n" .
139
+                    "Got unexpected exception from reply() for input: {$step['input']}\n\n".
140
+                    " Expected: {$expected}\n".
141 141
                     " Got: {$reply}"
142 142
                 );
143 143
             }
@@ -175,8 +175,8 @@  discard block
 block discarded – undo
175 175
 
176 176
             if ($actual != $value) {
177 177
                 throw new AssertionError(
178
-                    "Failed to assert that the value of user variable: {$key}\n\n" .
179
-                    " Expected: {$expected}\n" .
178
+                    "Failed to assert that the value of user variable: {$key}\n\n".
179
+                    " Expected: {$expected}\n".
180 180
                     " Got: {$actual}"
181 181
                 );
182 182
             }
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
     private function fail(AssertionError $e): void
244 244
     {
245 245
         $banner = "x {$this->name}";
246
-        $banner .= "\n " . str_repeat("=", strlen($banner)) . "\n";
246
+        $banner .= "\n ".str_repeat("=", strlen($banner))."\n";
247 247
 
248 248
         echo " {$banner} {$e->getMessage()} \n\n";
249 249
     }
Please login to merge, or discard this patch.
src/Cortex/Triggers/Wildcard.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@
 block discarded – undo
44 44
         $trigger = $this->parseTags($trigger, $input);
45 45
 
46 46
         $wildcards = [
47
-     //       '/@(\s+)/' => ".*?\b",
47
+        //       '/@(\s+)/' => ".*?\b",
48 48
             '/_/' => '[^\s\d]+?',
49 49
             '/#/' => '\\d+?',
50 50
             '/\*/' => '.*?',
Please login to merge, or discard this 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
                 }
72 72
             }
73 73
 
74
-            if (@preg_match_all('/' . $parsedTrigger . '/ui', $input->source(), $results)) {
74
+            if (@preg_match_all('/'.$parsedTrigger.'/ui', $input->source(), $results)) {
75 75
                 $replacement = $results[1][0];
76 76
                 $pattern = "(@{$array_name})";
77 77
 
@@ -85,14 +85,14 @@  discard block
 block discarded – undo
85 85
         }
86 86
 
87 87
         foreach ($wildcards as $pattern => $replacement) {
88
-            $parsedTrigger = preg_replace($pattern, '(' . $replacement . ')', $trigger);
88
+            $parsedTrigger = preg_replace($pattern, '('.$replacement.')', $trigger);
89 89
 
90 90
 
91 91
             if ($parsedTrigger === $trigger) {
92 92
                 continue;
93 93
             }
94 94
 
95
-            if (@preg_match_all('/' . $parsedTrigger . '$/ui', $input->source(), $results)) {
95
+            if (@preg_match_all('/'.$parsedTrigger.'$/ui', $input->source(), $results)) {
96 96
                 synapse()->rivescript->say("Wildcard trigger");
97 97
                 array_shift($results);
98 98
 
Please login to merge, or discard this patch.