@@ -90,7 +90,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 | } |
@@ -54,7 +54,7 @@ |
||
| 54 | 54 | public function parse(string $source, SourceInput $input): string |
| 55 | 55 | { |
| 56 | 56 | if (!$this->sourceAllowed()) { |
| 57 | - return $source; |
|
| 57 | + return $source; |
|
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | if ($this->hasMatches($source)) { |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | protected function searchTriggers(string $trigger): void |
| 97 | 97 | { |
| 98 | 98 | synapse()->triggers->each( |
| 99 | - function ($class) use ($trigger) { |
|
| 99 | + function($class) use ($trigger) { |
|
| 100 | 100 | $triggerClass = "\\Axiom\\Rivescript\\Cortex\\Triggers\\$class"; |
| 101 | 101 | $triggerInstance = new $triggerClass(synapse()->input); |
| 102 | 102 | |
@@ -188,7 +188,7 @@ discard block |
||
| 188 | 188 | protected function parseResponse(string $response): string |
| 189 | 189 | { |
| 190 | 190 | synapse()->tags->each( |
| 191 | - function ($tag) use (&$response) { |
|
| 191 | + function($tag) use (&$response) { |
|
| 192 | 192 | $class = "\\Axiom\\Rivescript\\Cortex\\Tags\\$tag"; |
| 193 | 193 | $tagClass = new $class(); |
| 194 | 194 | |
@@ -38,7 +38,7 @@ |
||
| 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; |
@@ -52,7 +52,7 @@ |
||
| 52 | 52 | $condition = $matches[0][0]; |
| 53 | 53 | |
| 54 | 54 | $y = ">".$this->original()."<"; |
| 55 | - return str_replace($condition, "", $this->source()); |
|
| 55 | + return str_replace($condition, "", $this->source()); |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | } |
@@ -103,10 +103,10 @@ |
||
| 103 | 103 | $patterns = synapse()->memory->substitute()->keys()->all(); |
| 104 | 104 | $replacements = synapse()->memory->substitute()->values()->all(); |
| 105 | 105 | |
| 106 | - // $this->source = mb_strtolower($this->original); |
|
| 106 | + // $this->source = mb_strtolower($this->original); |
|
| 107 | 107 | $this->source = $this->original; |
| 108 | - // $this->source = preg_replace($patterns, $replacements, $this->source); |
|
| 109 | - // $this->source = preg_replace('/[^\pL\d\s]+/u', '', $this->source); |
|
| 110 | - // $this->source = remove_whitespace($this->source); |
|
| 108 | + // $this->source = preg_replace($patterns, $replacements, $this->source); |
|
| 109 | + // $this->source = preg_replace('/[^\pL\d\s]+/u', '', $this->source); |
|
| 110 | + // $this->source = remove_whitespace($this->source); |
|
| 111 | 111 | } |
| 112 | 112 | } |