@@ -62,7 +62,7 @@ |
||
| 62 | 62 | $this->sourceType = $sourceType; |
| 63 | 63 | |
| 64 | 64 | if (!isset($this->allowedSources)) { |
| 65 | - throw new LogicException(get_class($this) . " must have an \"allowedSources\" property declared."); |
|
| 65 | + throw new LogicException(get_class($this)." must have an \"allowedSources\" property declared."); |
|
| 66 | 66 | } |
| 67 | 67 | } |
| 68 | 68 | |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | $triggers = $this->determineWordCount($triggers); |
| 95 | 95 | $triggers = $this->determineTypeCount($triggers); |
| 96 | 96 | |
| 97 | - return $triggers->sort(function ($current, $previous) { |
|
| 97 | + return $triggers->sort(function($current, $previous) { |
|
| 98 | 98 | return ($current['order'] < $previous['order']) ? -1 : 1; |
| 99 | 99 | })->reverse(); |
| 100 | 100 | } |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | */ |
| 109 | 109 | protected function determineTypeCount(Collection $triggers): Collection |
| 110 | 110 | { |
| 111 | - return $triggers->each(function ($data, $trigger) use ($triggers) { |
|
| 111 | + return $triggers->each(function($data, $trigger) use ($triggers) { |
|
| 112 | 112 | if (isset($data['type'])) { |
| 113 | 113 | switch ($data['type']) { |
| 114 | 114 | case 'atomic': |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | */ |
| 141 | 141 | protected function determineWordCount(Collection $triggers): Collection |
| 142 | 142 | { |
| 143 | - return $triggers->each(function ($data, $trigger) use ($triggers) { |
|
| 143 | + return $triggers->each(function($data, $trigger) use ($triggers) { |
|
| 144 | 144 | $data['order'] = count(explode(' ', $trigger)); |
| 145 | 145 | |
| 146 | 146 | $triggers->put($trigger, $data); |
@@ -70,7 +70,7 @@ |
||
| 70 | 70 | stream_wrapper_unregister($this->name); |
| 71 | 71 | } |
| 72 | 72 | if (stream_wrapper_register($this->name, ContentStream::class) === true) { |
| 73 | - $this->stream = fopen($this->name . "://input", 'wb+'); |
|
| 73 | + $this->stream = fopen($this->name."://input", 'wb+'); |
|
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | if (is_resource($this->stream) === false) { |
@@ -55,7 +55,7 @@ |
||
| 55 | 55 | } |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | - if (@preg_match_all('/' . $trigger . '$/ui', $input->source(), $wildcards)) { |
|
| 58 | + if (@preg_match_all('/'.$trigger.'$/ui', $input->source(), $wildcards)) { |
|
| 59 | 59 | array_shift($wildcards); |
| 60 | 60 | |
| 61 | 61 | if ($wildcards) { |
@@ -52,13 +52,13 @@ |
||
| 52 | 52 | ]; |
| 53 | 53 | |
| 54 | 54 | foreach ($wildcards as $pattern => $replacement) { |
| 55 | - $parsedTrigger = preg_replace($pattern, '(' . $replacement . ')', $trigger); |
|
| 55 | + $parsedTrigger = preg_replace($pattern, '('.$replacement.')', $trigger); |
|
| 56 | 56 | |
| 57 | 57 | if ($parsedTrigger === $trigger) { |
| 58 | 58 | continue; |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | - if (@preg_match_all('/' . $parsedTrigger . '$/u', $input->source(), $wildcards)) { |
|
| 61 | + if (@preg_match_all('/'.$parsedTrigger.'$/u', $input->source(), $wildcards)) { |
|
| 62 | 62 | array_shift($wildcards); |
| 63 | 63 | |
| 64 | 64 | $wildcards = Collection::make($wildcards)->flatten()->all(); |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | public function process(): string |
| 75 | 75 | { |
| 76 | 76 | synapse()->brain->topic()->triggers()->each( |
| 77 | - function ($data, $trigger) { |
|
| 77 | + function($data, $trigger) { |
|
| 78 | 78 | $this->searchTriggers($trigger); |
| 79 | 79 | |
| 80 | 80 | if ($this->output !== 'Error: Response could not be determined.') { |
@@ -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 | $triggerClass = new $triggerClass($this->input); |
| 102 | 102 | |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | protected function searchTriggers2(string $trigger) |
| 163 | 163 | { |
| 164 | 164 | synapse()->triggers->each( |
| 165 | - function ($class) use ($trigger) { |
|
| 165 | + function($class) use ($trigger) { |
|
| 166 | 166 | $triggerClass = "\\Axiom\\Rivescript\\Cortex\\Triggers\\$class"; |
| 167 | 167 | $triggerClass = new $triggerClass($this->input); |
| 168 | 168 | |
@@ -325,7 +325,7 @@ discard block |
||
| 325 | 325 | protected function parseResponse(string $response): string |
| 326 | 326 | { |
| 327 | 327 | synapse()->tags->each( |
| 328 | - function ($tag) use (&$response) { |
|
| 328 | + function($tag) use (&$response) { |
|
| 329 | 329 | $class = "\\Axiom\\Rivescript\\Cortex\\Tags\\$tag"; |
| 330 | 330 | $tagClass = new $class(); |
| 331 | 331 | |