@@ -35,7 +35,7 @@ |
||
| 35 | 35 | */ |
| 36 | 36 | function dd() |
| 37 | 37 | { |
| 38 | - array_map(function ($x) { |
|
| 38 | + array_map(function($x) { |
|
| 39 | 39 | print_r($x); |
| 40 | 40 | echo "\n"; |
| 41 | 41 | }, func_get_args()); |
@@ -26,7 +26,7 @@ |
||
| 26 | 26 | protected function parseTags(string $response): string |
| 27 | 27 | { |
| 28 | 28 | synapse()->tags->each( |
| 29 | - function ($tag) use (&$response) { |
|
| 29 | + function($tag) use (&$response) { |
|
| 30 | 30 | $class = "\\Axiom\\Rivescript\\Cortex\\Tags\\$tag"; |
| 31 | 31 | $tagClass = new $class(); |
| 32 | 32 | |
@@ -30,7 +30,7 @@ |
||
| 30 | 30 | */ |
| 31 | 31 | protected function parseTags(string $trigger, Input $input): string |
| 32 | 32 | { |
| 33 | - synapse()->tags->each(function ($tag) use (&$trigger, $input) { |
|
| 33 | + synapse()->tags->each(function($tag) use (&$trigger, $input) { |
|
| 34 | 34 | $class = "\\Axiom\\Rivescript\\Cortex\\Tags\\$tag"; |
| 35 | 35 | $tagClass = new $class('trigger'); |
| 36 | 36 | |
@@ -58,7 +58,7 @@ |
||
| 58 | 58 | continue; |
| 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); |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | public function process(): string |
| 56 | 56 | { |
| 57 | 57 | synapse()->brain->topic()->triggers()->each( |
| 58 | - function ($data, $trigger) { |
|
| 58 | + function($data, $trigger) { |
|
| 59 | 59 | $this->searchTriggers($trigger); |
| 60 | 60 | |
| 61 | 61 | if ($this->output !== 'Error: Response could not be determined.') { |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | protected function searchTriggers(string $trigger) |
| 78 | 78 | { |
| 79 | 79 | synapse()->triggers->each( |
| 80 | - function ($class) use ($trigger) { |
|
| 80 | + function($class) use ($trigger) { |
|
| 81 | 81 | $triggerClass = "\\Axiom\\Rivescript\\Cortex\\Triggers\\$class"; |
| 82 | 82 | $triggerClass = new $triggerClass($this->input); |
| 83 | 83 | |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | string $response |
| 143 | 143 | ): string { |
| 144 | 144 | synapse()->tags->each( |
| 145 | - function ($tag) use (&$response) { |
|
| 145 | + function($tag) use (&$response) { |
|
| 146 | 146 | $class = "\\Axiom\\Rivescript\\Cortex\\Tags\\$tag"; |
| 147 | 147 | $tagClass = new $class(); |
| 148 | 148 | |
@@ -60,7 +60,7 @@ |
||
| 60 | 60 | if (strpos($sub, '.') > -1) { |
| 61 | 61 | $parts = explode('.', $sub); |
| 62 | 62 | if (count($parts) !== 0) { |
| 63 | - array_walk($parts, function (&$part) { |
|
| 63 | + array_walk($parts, function(&$part) { |
|
| 64 | 64 | $part = ucfirst(trim($part)); |
| 65 | 65 | }); |
| 66 | 66 | } |
@@ -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': |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | { |
| 85 | 85 | $triggers = $this->determineWordCount($triggers); |
| 86 | 86 | $triggers = $this->determineTypeCount($triggers); |
| 87 | - return $triggers->sort(function ($current, $previous) { |
|
| 87 | + return $triggers->sort(function($current, $previous) { |
|
| 88 | 88 | return ($current['order'] < $previous['order']) ? -1 : 1; |
| 89 | 89 | })->reverse(); |
| 90 | 90 | } |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | protected function determineTypeCount(Collection $triggers): Collection |
| 100 | 100 | { |
| 101 | 101 | // @phpstan-ignore-next-line |
| 102 | - return $triggers->each(function ($data, $trigger) use ($triggers) { |
|
| 102 | + return $triggers->each(function($data, $trigger) use ($triggers) { |
|
| 103 | 103 | if (isset($data['type'])) { |
| 104 | 104 | switch ($data['type']) { |
| 105 | 105 | case 'atomic': |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | protected function determineWordCount(Collection $triggers): Collection |
| 133 | 133 | { |
| 134 | 134 | // @phpstan-ignore-next-line |
| 135 | - return $triggers->each(function ($data, $trigger) use ($triggers) { |
|
| 135 | + return $triggers->each(function($data, $trigger) use ($triggers) { |
|
| 136 | 136 | $data['order'] = count(explode(' ', $trigger)); |
| 137 | 137 | |
| 138 | 138 | $triggers->put($trigger, $data); |