@@ -45,7 +45,7 @@  | 
                                                    ||
| 45 | 45 |          { | 
                                                        
| 46 | 46 | $this->template = $template;  | 
                                                        
| 47 | 47 | $this->request = $request;  | 
                                                        
| 48 | - $this->parameters = (array)$parameters;  | 
                                                        |
| 48 | + $this->parameters = (array) $parameters;  | 
                                                        |
| 49 | 49 | $this->matchedSitemapItem = $matchedSitemapItem;  | 
                                                        
| 50 | 50 | }  | 
                                                        
| 51 | 51 | |
@@ -163,7 +163,7 @@  | 
                                                    ||
| 163 | 163 |          if (isset($_SESSION[self::SESSION_PARAMETER_FORM_COMPONENT][$this->formParameterName][self::PARAMETER_FORM_ID])) { | 
                                                        
| 164 | 164 | $this->formId = $_SESSION[self::SESSION_PARAMETER_FORM_COMPONENT][$this->formParameterName][self::PARAMETER_FORM_ID];  | 
                                                        
| 165 | 165 |          } else { | 
                                                        
| 166 | - $_SESSION[self::SESSION_PARAMETER_FORM_COMPONENT][$this->formParameterName][self::PARAMETER_FORM_ID] = (string)microtime(true);  | 
                                                        |
| 166 | + $_SESSION[self::SESSION_PARAMETER_FORM_COMPONENT][$this->formParameterName][self::PARAMETER_FORM_ID] = (string) microtime(true);  | 
                                                        |
| 167 | 167 | $_SESSION[self::SESSION_PARAMETER_FORM_COMPONENT][$this->formParameterName]['submitted'] = false;  | 
                                                        
| 168 | 168 | $this->formId = $_SESSION[self::SESSION_PARAMETER_FORM_COMPONENT][$this->formParameterName][self::PARAMETER_FORM_ID];  | 
                                                        
| 169 | 169 | }  | 
                                                        
@@ -20,7 +20,7 @@  | 
                                                    ||
| 20 | 20 | public static function slugify($str, $replace = array(), $delimiter = '-')  | 
                                                        
| 21 | 21 |      { | 
                                                        
| 22 | 22 |          if (!empty($replace)) { | 
                                                        
| 23 | - $str = str_replace((array)$replace, ' ', $str);  | 
                                                        |
| 23 | + $str = str_replace((array) $replace, ' ', $str);  | 
                                                        |
| 24 | 24 | }  | 
                                                        
| 25 | 25 | |
| 26 | 26 |          $clean = iconv('UTF-8', 'ASCII//TRANSLIT//IGNORE', $str); | 
                                                        
@@ -151,7 +151,7 @@  | 
                                                    ||
| 151 | 151 | public function save()  | 
                                                        
| 152 | 152 |      { | 
                                                        
| 153 | 153 | $host = $this;  | 
                                                        
| 154 | -        array_map(function ($value) use ($host) { | 
                                                        |
| 154 | +        array_map(function($value) use ($host) { | 
                                                        |
| 155 | 155 | $host->saveSubset($value);  | 
                                                        
| 156 | 156 | }, $this->fileBasedSubsets);  | 
                                                        
| 157 | 157 | }  | 
                                                        
@@ -55,9 +55,9 @@ discard block  | 
                                                    ||
| 55 | 55 |  { | 
                                                        
| 56 | 56 |      if (!isset($_GET['unsanitized'])) { | 
                                                        
| 57 | 57 | $search = array(  | 
                                                        
| 58 | - '/\>[^\S ]+/s', // strip whitespaces after tags, except space  | 
                                                        |
| 59 | - '/[^\S ]+\</s', // strip whitespaces before tags, except space  | 
                                                        |
| 60 | - '/(\s)+/s', // shorten multiple whitespace sequences  | 
                                                        |
| 58 | + '/\>[^\S ]+/s', // strip whitespaces after tags, except space  | 
                                                        |
| 59 | + '/[^\S ]+\</s', // strip whitespaces before tags, except space  | 
                                                        |
| 60 | + '/(\s)+/s', // shorten multiple whitespace sequences  | 
                                                        |
| 61 | 61 | '/<!--(.|\s)*?-->/' // Remove HTML comments  | 
                                                        
| 62 | 62 | );  | 
                                                        
| 63 | 63 | |
@@ -85,7 +85,7 @@ discard block  | 
                                                    ||
| 85 | 85 | */  | 
                                                        
| 86 | 86 | function utf8Convert($array)  | 
                                                        
| 87 | 87 |  { | 
                                                        
| 88 | -    array_walk_recursive($array, function (&$item) { | 
                                                        |
| 88 | +    array_walk_recursive($array, function(&$item) { | 
                                                        |
| 89 | 89 |          if (!mb_detect_encoding($item, 'utf-8', true)) { | 
                                                        
| 90 | 90 | $item = utf8_encode($item);  | 
                                                        
| 91 | 91 | }  | 
                                                        
@@ -35,7 +35,7 @@  | 
                                                    ||
| 35 | 35 | }  | 
                                                        
| 36 | 36 | $object_vars = get_object_vars($valuelistObject->pairs);  | 
                                                        
| 37 | 37 | ksort($object_vars);  | 
                                                        
| 38 | - $valuelistObject->pairs = (object)$object_vars;  | 
                                                        |
| 38 | + $valuelistObject->pairs = (object) $object_vars;  | 
                                                        |
| 39 | 39 | |
| 40 | 40 | return new Valuelist($valuelistObject);  | 
                                                        
| 41 | 41 |          } else { | 
                                                        
@@ -87,7 +87,7 @@ discard block  | 
                                                    ||
| 87 | 87 | $errorMsg = $errorInfo[2];  | 
                                                        
| 88 | 88 |              throw new \Exception('SQLite Exception: ' . $errorMsg . ' in SQL: <br /><pre>' . $sql . '</pre>'); | 
                                                        
| 89 | 89 | }  | 
                                                        
| 90 | - return (int)$result;  | 
                                                        |
| 90 | + return (int) $result;  | 
                                                        |
| 91 | 91 | }  | 
                                                        
| 92 | 92 | |
| 93 | 93 | /**  | 
                                                        
@@ -183,7 +183,7 @@ discard block  | 
                                                    ||
| 183 | 183 | $resultObj = new SearchResult();  | 
                                                        
| 184 | 184 | $resultObj->documentPath = $result->documentPath;  | 
                                                        
| 185 | 185 | $resultObj->matchingTokens = array($token);  | 
                                                        
| 186 | - $resultObj->score = (float)$result->score;  | 
                                                        |
| 186 | + $resultObj->score = (float) $result->score;  | 
                                                        |
| 187 | 187 | $resultObj->setStorage($this->storage);  | 
                                                        
| 188 | 188 | $finalResults[$result->documentPath] = $resultObj;  | 
                                                        
| 189 | 189 | }  | 
                                                        
@@ -54,7 +54,7 @@  | 
                                                    ||
| 54 | 54 | $values = array();  | 
                                                        
| 55 | 55 | $i = 0;  | 
                                                        
| 56 | 56 |              foreach ($termsForDocumentField as $term) { | 
                                                        
| 57 | - $frequency = (int)$term->count / $documentField->totalTermCount;  | 
                                                        |
| 57 | + $frequency = (int) $term->count / $documentField->totalTermCount;  | 
                                                        |
| 58 | 58 | $values[] = $quotedDocumentPath . ',' . $quotedField . ', ' . $db->quote($term->term) . ', ' . $db->quote($frequency);  | 
                                                        
| 59 | 59 | $i += 1;  | 
                                                        
| 60 | 60 |                  if ($i >= Indexer::SQLITE_MAX_COMPOUND_SELECT) { | 
                                                        
@@ -57,7 +57,7 @@  | 
                                                    ||
| 57 | 57 | $values = array();  | 
                                                        
| 58 | 58 | $i = 0;  | 
                                                        
| 59 | 59 |          foreach ($uniqueFieldsPerDocument as $fieldRow) { | 
                                                        
| 60 | -            $values[] = 'UPDATE term_frequency SET termNorm = 1/sqrt(' . (int)$fieldRow->termCount . ') WHERE documentPath = ' . $db->quote($fieldRow->documentPath) . ' AND field = ' . $db->quote($fieldRow->field) . ';'; | 
                                                        |
| 60 | +            $values[] = 'UPDATE term_frequency SET termNorm = 1/sqrt(' . (int) $fieldRow->termCount . ') WHERE documentPath = ' . $db->quote($fieldRow->documentPath) . ' AND field = ' . $db->quote($fieldRow->field) . ';'; | 
                                                        |
| 61 | 61 | $i += 1;  | 
                                                        
| 62 | 62 |              if ($i >= Indexer::SQLITE_MAX_COMPOUND_SELECT) { | 
                                                        
| 63 | 63 | $this->executeUpdateTermNorm($values, $db);  |