@@ -36,7 +36,7 @@ |
||
| 36 | 36 | function dd() |
| 37 | 37 | { |
| 38 | 38 | |
| 39 | - array_map(function ($x) { |
|
| 39 | + array_map(function($x) { |
|
| 40 | 40 | print_r($x); |
| 41 | 41 | echo "\n"; |
| 42 | 42 | }, func_get_args()); |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | private function sortResponses(Collection $responses): Collection |
| 64 | 64 | { |
| 65 | 65 | return $responses->sort( |
| 66 | - function ($current, $previous) { |
|
| 66 | + function($current, $previous) { |
|
| 67 | 67 | return ($current->order < $previous->order) ? -1 : 1; |
| 68 | 68 | } |
| 69 | 69 | )->reverse(); |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | { |
| 109 | 109 | // @phpstan-ignore-next-line |
| 110 | 110 | return $responses->each( |
| 111 | - function (ResponseQueueItem $data, $response) use ($responses) { |
|
| 111 | + function(ResponseQueueItem $data, $response) use ($responses) { |
|
| 112 | 112 | if (isset($data->type)) { |
| 113 | 113 | switch ($data->type) { |
| 114 | 114 | case 'condition': |
@@ -61,7 +61,7 @@ |
||
| 61 | 61 | $parts = explode('.', $sub); |
| 62 | 62 | if (count($parts) !== 0) { |
| 63 | 63 | |
| 64 | - array_walk($parts, function (&$part) { |
|
| 64 | + array_walk($parts, function(&$part) { |
|
| 65 | 65 | $part = ucfirst(trim($part)); |
| 66 | 66 | }); |
| 67 | 67 | } |
@@ -82,7 +82,7 @@ |
||
| 82 | 82 | { |
| 83 | 83 | $patterns = synapse()->memory->substitute()->keys()->all(); |
| 84 | 84 | $replacements = synapse()->memory->substitute()->values()->all(); |
| 85 | - $this->source = mb_strtolower($this->original);; |
|
| 85 | + $this->source = mb_strtolower($this->original); ; |
|
| 86 | 86 | $this->source = preg_replace($patterns, $replacements, $this->source); |
| 87 | 87 | $this->source = preg_replace('/[^\pL\d\s]+/u', '', $this->source); |
| 88 | 88 | $this->source = remove_whitespace($this->source); |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | $triggers = $this->determineWordCount($triggers); |
| 86 | 86 | $triggers = $this->determineTypeCount($triggers); |
| 87 | 87 | |
| 88 | - $triggers = $triggers->sort(function ($current, $previous) { |
|
| 88 | + $triggers = $triggers->sort(function($current, $previous) { |
|
| 89 | 89 | return ($current['order'] < $previous['order']) ? -1 : 1; |
| 90 | 90 | })->reverse(); |
| 91 | 91 | |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | protected function determineTypeCount(Collection $triggers): Collection |
| 103 | 103 | { |
| 104 | 104 | // @phpstan-ignore-next-line |
| 105 | - return $triggers->each(function ($data, $trigger) use ($triggers) { |
|
| 105 | + return $triggers->each(function($data, $trigger) use ($triggers) { |
|
| 106 | 106 | if (isset($data['type'])) { |
| 107 | 107 | switch ($data['type']) { |
| 108 | 108 | case 'atomic': |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | protected function determineWordCount(Collection $triggers): Collection |
| 136 | 136 | { |
| 137 | 137 | // @phpstan-ignore-next-line |
| 138 | - return $triggers->each(function ($data, $trigger) use ($triggers) { |
|
| 138 | + return $triggers->each(function($data, $trigger) use ($triggers) { |
|
| 139 | 139 | $data['order'] = count(explode(' ', $trigger)); |
| 140 | 140 | |
| 141 | 141 | $triggers->put($trigger, $data); |
@@ -31,7 +31,7 @@ |
||
| 31 | 31 | protected function parseTags(string $trigger, Input $input): string |
| 32 | 32 | { |
| 33 | 33 | |
| 34 | - synapse()->tags->each(function ($tag) use (&$trigger, $input) { |
|
| 34 | + synapse()->tags->each(function($tag) use (&$trigger, $input) { |
|
| 35 | 35 | $class = "\\Axiom\\Rivescript\\Cortex\\Tags\\$tag"; |
| 36 | 36 | $tagClass = new $class('trigger'); |
| 37 | 37 | |
@@ -58,7 +58,7 @@ |
||
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | |
| 61 | - $commands->each(function ($command) use ($node) { |
|
| 61 | + $commands->each(function($command) use ($node) { |
|
| 62 | 62 | $class = "\\Axiom\\Rivescript\\Cortex\\Commands\\$command"; |
| 63 | 63 | $commandClass = new $class(); |
| 64 | 64 | $commandClass->parse($node); |