@@ -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 |
@@ -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(); |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | private function determineResponseOrder(Collection $responses): Collection |
108 | 108 | { |
109 | 109 | return $responses->each( |
110 | - function (ResponseQueueItem $data, $response) use ($responses) { |
|
110 | + function(ResponseQueueItem $data, $response) use ($responses) { |
|
111 | 111 | if (isset($data->type)) { |
112 | 112 | switch ($data->type) { |
113 | 113 | case 'condition': |
@@ -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 | } |
@@ -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 | } |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | */ |
99 | 99 | protected function determineTypeCount(Collection $triggers): Collection |
100 | 100 | { |
101 | - return $triggers->each(function ($data, $trigger) use ($triggers) { |
|
101 | + return $triggers->each(function($data, $trigger) use ($triggers) { |
|
102 | 102 | if (isset($data['type'])) { |
103 | 103 | switch ($data['type']) { |
104 | 104 | case 'atomic': |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | */ |
131 | 131 | protected function determineWordCount(Collection $triggers): Collection |
132 | 132 | { |
133 | - return $triggers->each(function ($data, $trigger) use ($triggers) { |
|
133 | + return $triggers->each(function($data, $trigger) use ($triggers) { |
|
134 | 134 | $data['order'] = count(explode(' ', $trigger)); |
135 | 135 | |
136 | 136 | $triggers->put($trigger, $data); |