@@ -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 |
@@ -50,7 +50,7 @@ |
||
50 | 50 | if ($stars) { |
51 | 51 | $stars = Collection::make($stars)->flatten()->all(); |
52 | 52 | |
53 | - // synapse()->memory->shortTerm()->put('wildcards', $stars); |
|
53 | + // synapse()->memory->shortTerm()->put('wildcards', $stars); |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | return true; |
@@ -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); |
@@ -83,7 +83,7 @@ |
||
83 | 83 | $patterns = synapse()->memory->substitute()->keys()->all(); |
84 | 84 | $replacements = synapse()->memory->substitute()->values()->all(); |
85 | 85 | |
86 | - $this->source = mb_strtolower($this->original);; |
|
86 | + $this->source = mb_strtolower($this->original); ; |
|
87 | 87 | $this->source = preg_replace($patterns, $replacements, $this->source); |
88 | 88 | $this->source = preg_replace('/[^\pL\d\s]+/u', '', $this->source); |
89 | 89 | $this->source = remove_whitespace($this->source); |
@@ -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 | } |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | $triggers = $this->determineWordCount($triggers); |
83 | 83 | $triggers = $this->determineTypeCount($triggers); |
84 | 84 | |
85 | - $triggers = $triggers->sort(function ($current, $previous) { |
|
85 | + $triggers = $triggers->sort(function($current, $previous) { |
|
86 | 86 | return ($current['order'] < $previous['order']) ? -1 : 1; |
87 | 87 | })->reverse(); |
88 | 88 | |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | */ |
99 | 99 | protected function determineTypeCount(Collection $triggers): Collection |
100 | 100 | { |
101 | - $triggers = $triggers->each(function ($data, $trigger) use ($triggers) { |
|
101 | + $triggers = $triggers->each(function($data, $trigger) use ($triggers) { |
|
102 | 102 | if (isset($data['type'])) { |
103 | 103 | switch ($data['type']) { |
104 | 104 | case 'atomic': |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | */ |
133 | 133 | protected function determineWordCount(Collection $triggers): Collection |
134 | 134 | { |
135 | - $triggers = $triggers->each(function ($data, $trigger) use ($triggers) { |
|
135 | + $triggers = $triggers->each(function($data, $trigger) use ($triggers) { |
|
136 | 136 | $data['order'] = count(explode(' ', $trigger)); |
137 | 137 | |
138 | 138 | $triggers->put($trigger, $data); |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | private function sortResponses(Collection $responses): Collection |
62 | 62 | { |
63 | 63 | return $responses->sort( |
64 | - function ($current, $previous) { |
|
64 | + function($current, $previous) { |
|
65 | 65 | return ($current->order < $previous->order) ? -1 : 1; |
66 | 66 | } |
67 | 67 | )->reverse(); |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | private function determineResponseOrder(Collection $responses): Collection |
105 | 105 | { |
106 | 106 | return $responses->each( |
107 | - function ($data, $response) use ($responses) { |
|
107 | + function($data, $response) use ($responses) { |
|
108 | 108 | if (isset($data->type)) { |
109 | 109 | switch ($data->type) { |
110 | 110 | case 'condition': |