@@ -210,8 +210,8 @@ discard block |
||
210 | 210 | } |
211 | 211 | $checkfilestart($file, count($sentences)); |
212 | 212 | $sentences = $this->checkSentences( |
213 | - $sentences, |
|
214 | - $checksentence |
|
213 | + $sentences, |
|
214 | + $checksentence |
|
215 | 215 | ); |
216 | 216 | $htmlcode = $this->convertToHtml($file->getFilename(), $sentences); |
217 | 217 | |
@@ -258,8 +258,8 @@ discard block |
||
258 | 258 | $sentences = $html->getSentences(); |
259 | 259 | $checkfilestart($file, count($sentences)); |
260 | 260 | $sentences = $this->checkSentences( |
261 | - $sentences, |
|
262 | - $checksentence |
|
261 | + $sentences, |
|
262 | + $checksentence |
|
263 | 263 | ); |
264 | 264 | $htmlcode = $this->convertToHtml($title, $sentences); |
265 | 265 |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | { |
119 | 119 | $html = '<!DOCTYPE HTML>'; |
120 | 120 | $html .= '<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8">'; |
121 | - $html .= '<title>' . $title . '</title>'; |
|
121 | + $html .= '<title>'.$title.'</title>'; |
|
122 | 122 | $html .= '<style>'; |
123 | 123 | $html .= '.error { color: red }'; |
124 | 124 | |
@@ -169,10 +169,10 @@ discard block |
||
169 | 169 | $tooltip = $error->getMessage(); |
170 | 170 | $suggs = $error->getSuggestions(); |
171 | 171 | if (count($suggs) > 0) { |
172 | - $tooltip .= " : " . $suggs[0]; |
|
172 | + $tooltip .= " : ".$suggs[0]; |
|
173 | 173 | } |
174 | 174 | $zone = mb_substr($text, $offset, $length, 'UTF-8'); |
175 | - $cons .= '<span class="error tooltip" data-tooltip="' . $tooltip . '">' . $zone . '</span>'; |
|
175 | + $cons .= '<span class="error tooltip" data-tooltip="'.$tooltip.'">'.$zone.'</span>'; |
|
176 | 176 | |
177 | 177 | $start = $offset + $length; |
178 | 178 | } |
@@ -222,9 +222,9 @@ discard block |
||
222 | 222 | $sentences, |
223 | 223 | $checksentence |
224 | 224 | ); |
225 | - $htmlcode = $this->convertToHtml($file->getFilename(), $sentences); |
|
225 | + $htmlcode = $this->convertToHtml($file->getFilename(), $sentences); |
|
226 | 226 | |
227 | - $checkerfile = sys_get_temp_dir() . "/" . uniqid("spellcheck") . ".html"; |
|
227 | + $checkerfile = sys_get_temp_dir()."/".uniqid("spellcheck").".html"; |
|
228 | 228 | file_put_contents($checkerfile, $htmlcode); |
229 | 229 | $results[] = $checkerfile; |
230 | 230 | |
@@ -270,9 +270,9 @@ discard block |
||
270 | 270 | $sentences, |
271 | 271 | $checksentence |
272 | 272 | ); |
273 | - $htmlcode = $this->convertToHtml($title, $sentences); |
|
273 | + $htmlcode = $this->convertToHtml($title, $sentences); |
|
274 | 274 | |
275 | - $checkerfile = sys_get_temp_dir() . "/" . uniqid("spellcheck") . ".html"; |
|
275 | + $checkerfile = sys_get_temp_dir()."/".uniqid("spellcheck").".html"; |
|
276 | 276 | file_put_contents($checkerfile, $htmlcode); |
277 | 277 | $results[] = $checkerfile; |
278 | 278 | |
@@ -297,7 +297,7 @@ discard block |
||
297 | 297 | $url = "http://{$this->languageToolServerIP}:{$this->languageToolServerPort}"; |
298 | 298 | $sentencesChecked = []; |
299 | 299 | foreach ($sentences as $sentence) { |
300 | - $response = $this->languagetoolClientHttp->get( |
|
300 | + $response = $this->languagetoolClientHttp->get( |
|
301 | 301 | $url, |
302 | 302 | [ |
303 | 303 | 'query' => [ |
@@ -313,8 +313,8 @@ discard block |
||
313 | 313 | if (count($errors) > 0) { |
314 | 314 | foreach ($errors as $error) { |
315 | 315 | $msg = $error->getAttribute('msg'); |
316 | - $offset = (int)$error->getAttribute('offset'); |
|
317 | - $length = (int)$error->getAttribute('errorlength'); |
|
316 | + $offset = (int) $error->getAttribute('offset'); |
|
317 | + $length = (int) $error->getAttribute('errorlength'); |
|
318 | 318 | $suggs = []; |
319 | 319 | $word = null; |
320 | 320 | if ($error->getAttribute('locqualityissuetype') == 'misspelling') { |
@@ -342,7 +342,7 @@ discard block |
||
342 | 342 | */ |
343 | 343 | private function startLanguageToolServer($directory) |
344 | 344 | { |
345 | - $jar = $directory . "languagetool-server.jar"; |
|
345 | + $jar = $directory."languagetool-server.jar"; |
|
346 | 346 | $command = "java -cp $jar org.languagetool.server.HTTPServer --port {$this->languageToolServerPort}"; |
347 | 347 | $this->languagetoolServer = new Process($command); |
348 | 348 | $this->languagetoolServer->start(); |
@@ -103,7 +103,7 @@ |
||
103 | 103 | private function sortedErrorsByOffset() { |
104 | 104 | usort( |
105 | 105 | $this->errors, |
106 | - function (GlSpellCheckerError $a, GlSpellCheckerError $b) { |
|
106 | + function(GlSpellCheckerError $a, GlSpellCheckerError $b) { |
|
107 | 107 | if ($a->getOffset() == $b->getOffset()) { |
108 | 108 | return 0; |
109 | 109 | } |
@@ -66,15 +66,15 @@ |
||
66 | 66 | * @param GlSpellCheckerError $mergeerror |
67 | 67 | */ |
68 | 68 | public function merge(GlSpellCheckerError $mergeerror) { |
69 | - $this->msg .= ' ' . $mergeerror->msg; |
|
70 | - $this->word .= ' ' . $mergeerror->word; |
|
69 | + $this->msg .= ' '.$mergeerror->msg; |
|
70 | + $this->word .= ' '.$mergeerror->word; |
|
71 | 71 | if ($mergeerror->length > $this->length) { |
72 | 72 | $this->length = $mergeerror->length; |
73 | 73 | } |
74 | 74 | |
75 | 75 | if (isset($mergeerror->suggs)) { |
76 | 76 | if (isset($this->suggs)) { |
77 | - $this->suggs = array_merge($this->suggs,$mergeerror->suggs); |
|
77 | + $this->suggs = array_merge($this->suggs, $mergeerror->suggs); |
|
78 | 78 | } else { |
79 | 79 | $this->suggs = $mergeerror->suggs; |
80 | 80 | } |