We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -235,7 +235,7 @@ |
||
| 235 | 235 | $fields = Solr::getFields(); |
| 236 | 236 | $params = []; |
| 237 | 237 | // Restrict the fields to the required ones |
| 238 | - $params['fields'] = $fields['uid'] . ',' . $fields['id'] .',' . $fields['toplevel'] . ',' . $fields['thumbnail'] . ',' . $fields['page']; |
|
| 238 | + $params['fields'] = $fields['uid'] . ',' . $fields['id'] . ',' . $fields['toplevel'] . ',' . $fields['thumbnail'] . ',' . $fields['page']; |
|
| 239 | 239 | foreach ($this->solrConfig as $solr_name) { |
| 240 | 240 | $params['fields'] .= ',' . $solr_name; |
| 241 | 241 | } |
@@ -20,7 +20,8 @@ discard block |
||
| 20 | 20 | * @subpackage dlf |
| 21 | 21 | * @access public |
| 22 | 22 | */ |
| 23 | -class Region { |
|
| 23 | +class Region |
|
| 24 | +{ |
|
| 24 | 25 | |
| 25 | 26 | /** |
| 26 | 27 | * The identifier of the region |
@@ -104,7 +105,8 @@ discard block |
||
| 104 | 105 | * |
| 105 | 106 | * @return void |
| 106 | 107 | */ |
| 107 | - public function __construct($id, $region) { |
|
| 108 | + public function __construct($id, $region) |
|
| 109 | + { |
|
| 108 | 110 | $this->id = $id; |
| 109 | 111 | $this->pageId = $region['pageIdx']; |
| 110 | 112 | $this->xBeginPosition = $region['ulx']; |
@@ -123,7 +125,8 @@ discard block |
||
| 123 | 125 | * |
| 124 | 126 | * @return int The region's identifier |
| 125 | 127 | */ |
| 126 | - public function getId() { |
|
| 128 | + public function getId() |
|
| 129 | + { |
|
| 127 | 130 | return $this->id; |
| 128 | 131 | } |
| 129 | 132 | |
@@ -134,7 +137,8 @@ discard block |
||
| 134 | 137 | * |
| 135 | 138 | * @return int The region's page identifier |
| 136 | 139 | */ |
| 137 | - public function getPageId() { |
|
| 140 | + public function getPageId() |
|
| 141 | + { |
|
| 138 | 142 | return $this->pageId; |
| 139 | 143 | } |
| 140 | 144 | |
@@ -145,7 +149,8 @@ discard block |
||
| 145 | 149 | * |
| 146 | 150 | * @return int The region's horizontal beginning position |
| 147 | 151 | */ |
| 148 | - public function getXBeginPosition() { |
|
| 152 | + public function getXBeginPosition() |
|
| 153 | + { |
|
| 149 | 154 | return $this->xBeginPosition; |
| 150 | 155 | } |
| 151 | 156 | |
@@ -156,7 +161,8 @@ discard block |
||
| 156 | 161 | * |
| 157 | 162 | * @return int The region's horizontal ending position |
| 158 | 163 | */ |
| 159 | - public function getXEndPosition() { |
|
| 164 | + public function getXEndPosition() |
|
| 165 | + { |
|
| 160 | 166 | return $this->xEndPosition; |
| 161 | 167 | } |
| 162 | 168 | |
@@ -167,7 +173,8 @@ discard block |
||
| 167 | 173 | * |
| 168 | 174 | * @return int The region's vertical beginning position |
| 169 | 175 | */ |
| 170 | - public function getYBeginPosition() { |
|
| 176 | + public function getYBeginPosition() |
|
| 177 | + { |
|
| 171 | 178 | return $this->yBeginPosition; |
| 172 | 179 | } |
| 173 | 180 | |
@@ -178,7 +185,8 @@ discard block |
||
| 178 | 185 | * |
| 179 | 186 | * @return int The region's vertical ending position |
| 180 | 187 | */ |
| 181 | - public function getYEndPosition() { |
|
| 188 | + public function getYEndPosition() |
|
| 189 | + { |
|
| 182 | 190 | return $this->yEndPosition; |
| 183 | 191 | } |
| 184 | 192 | |
@@ -189,7 +197,8 @@ discard block |
||
| 189 | 197 | * |
| 190 | 198 | * @return int The region's width |
| 191 | 199 | */ |
| 192 | - public function getWidth() { |
|
| 200 | + public function getWidth() |
|
| 201 | + { |
|
| 193 | 202 | return $this->width; |
| 194 | 203 | } |
| 195 | 204 | |
@@ -200,7 +209,8 @@ discard block |
||
| 200 | 209 | * |
| 201 | 210 | * @return int The region's height |
| 202 | 211 | */ |
| 203 | - public function getHeight() { |
|
| 212 | + public function getHeight() |
|
| 213 | + { |
|
| 204 | 214 | return $this->height; |
| 205 | 215 | } |
| 206 | 216 | |
@@ -211,7 +221,8 @@ discard block |
||
| 211 | 221 | * |
| 212 | 222 | * @return string The region's text |
| 213 | 223 | */ |
| 214 | - public function getText() { |
|
| 224 | + public function getText() |
|
| 225 | + { |
|
| 215 | 226 | return $this->text; |
| 216 | 227 | } |
| 217 | 228 | } |
@@ -20,7 +20,8 @@ discard block |
||
| 20 | 20 | * @subpackage dlf |
| 21 | 21 | * @access public |
| 22 | 22 | */ |
| 23 | -class Highlight { |
|
| 23 | +class Highlight |
|
| 24 | +{ |
|
| 24 | 25 | |
| 25 | 26 | /** |
| 26 | 27 | * The identifier in form 'w_h_x_y' |
@@ -95,7 +96,8 @@ discard block |
||
| 95 | 96 | * |
| 96 | 97 | * @return void |
| 97 | 98 | */ |
| 98 | - public function __construct($highlight) { |
|
| 99 | + public function __construct($highlight) |
|
| 100 | + { |
|
| 99 | 101 | $this->parentRegionId = $highlight['parentRegionIdx']; |
| 100 | 102 | $this->xBeginPosition = $highlight['ulx']; |
| 101 | 103 | $this->xEndPosition = $highlight['lrx']; |
@@ -113,7 +115,8 @@ discard block |
||
| 113 | 115 | * |
| 114 | 116 | * @return string The highlight's identifier |
| 115 | 117 | */ |
| 116 | - public function getId() { |
|
| 118 | + public function getId() |
|
| 119 | + { |
|
| 117 | 120 | return $this->id; |
| 118 | 121 | } |
| 119 | 122 | |
@@ -124,7 +127,8 @@ discard block |
||
| 124 | 127 | * |
| 125 | 128 | * @return int The highlight's horizontal beginning position |
| 126 | 129 | */ |
| 127 | - public function getXBeginPosition() { |
|
| 130 | + public function getXBeginPosition() |
|
| 131 | + { |
|
| 128 | 132 | return $this->xBeginPosition; |
| 129 | 133 | } |
| 130 | 134 | |
@@ -135,7 +139,8 @@ discard block |
||
| 135 | 139 | * |
| 136 | 140 | * @return int The highlight's horizontal ending position |
| 137 | 141 | */ |
| 138 | - public function getXEndPosition() { |
|
| 142 | + public function getXEndPosition() |
|
| 143 | + { |
|
| 139 | 144 | return $this->xEndPosition; |
| 140 | 145 | } |
| 141 | 146 | |
@@ -146,7 +151,8 @@ discard block |
||
| 146 | 151 | * |
| 147 | 152 | * @return int The highlight's vertical beginning position |
| 148 | 153 | */ |
| 149 | - public function getYBeginPosition() { |
|
| 154 | + public function getYBeginPosition() |
|
| 155 | + { |
|
| 150 | 156 | return $this->yBeginPosition; |
| 151 | 157 | } |
| 152 | 158 | |
@@ -157,7 +163,8 @@ discard block |
||
| 157 | 163 | * |
| 158 | 164 | * @return int The highlight's vertical ending position |
| 159 | 165 | */ |
| 160 | - public function getYEndPosition() { |
|
| 166 | + public function getYEndPosition() |
|
| 167 | + { |
|
| 161 | 168 | return $this->yEndPosition; |
| 162 | 169 | } |
| 163 | 170 | |
@@ -168,7 +175,8 @@ discard block |
||
| 168 | 175 | * |
| 169 | 176 | * @return int The highlight's width |
| 170 | 177 | */ |
| 171 | - public function getWidth() { |
|
| 178 | + public function getWidth() |
|
| 179 | + { |
|
| 172 | 180 | return $this->width; |
| 173 | 181 | } |
| 174 | 182 | |
@@ -179,7 +187,8 @@ discard block |
||
| 179 | 187 | * |
| 180 | 188 | * @return int The highlight's height |
| 181 | 189 | */ |
| 182 | - public function getHeight() { |
|
| 190 | + public function getHeight() |
|
| 191 | + { |
|
| 183 | 192 | return $this->height; |
| 184 | 193 | } |
| 185 | 194 | } |
@@ -20,7 +20,8 @@ discard block |
||
| 20 | 20 | * @subpackage dlf |
| 21 | 21 | * @access public |
| 22 | 22 | */ |
| 23 | -class Page { |
|
| 23 | +class Page |
|
| 24 | +{ |
|
| 24 | 25 | |
| 25 | 26 | /** |
| 26 | 27 | * The identifier of the page |
@@ -64,7 +65,8 @@ discard block |
||
| 64 | 65 | * |
| 65 | 66 | * @return void |
| 66 | 67 | */ |
| 67 | - public function __construct($id, $page) { |
|
| 68 | + public function __construct($id, $page) |
|
| 69 | + { |
|
| 68 | 70 | $this->id = $id; |
| 69 | 71 | $this->name = $page['id']; |
| 70 | 72 | $this->width = $page['width']; |
@@ -78,7 +80,8 @@ discard block |
||
| 78 | 80 | * |
| 79 | 81 | * @return int The page's identifier |
| 80 | 82 | */ |
| 81 | - public function getId() { |
|
| 83 | + public function getId() |
|
| 84 | + { |
|
| 82 | 85 | return $this->id; |
| 83 | 86 | } |
| 84 | 87 | |
@@ -89,7 +92,8 @@ discard block |
||
| 89 | 92 | * |
| 90 | 93 | * @return string The page's name |
| 91 | 94 | */ |
| 92 | - public function getName() { |
|
| 95 | + public function getName() |
|
| 96 | + { |
|
| 93 | 97 | return $this->name; |
| 94 | 98 | } |
| 95 | 99 | |
@@ -100,7 +104,8 @@ discard block |
||
| 100 | 104 | * |
| 101 | 105 | * @return int The page's width |
| 102 | 106 | */ |
| 103 | - public function getWidth() { |
|
| 107 | + public function getWidth() |
|
| 108 | + { |
|
| 104 | 109 | return $this->width; |
| 105 | 110 | } |
| 106 | 111 | |
@@ -111,7 +116,8 @@ discard block |
||
| 111 | 116 | * |
| 112 | 117 | * @return int The page's height |
| 113 | 118 | */ |
| 114 | - public function getHeight() { |
|
| 119 | + public function getHeight() |
|
| 120 | + { |
|
| 115 | 121 | return $this->height; |
| 116 | 122 | } |
| 117 | 123 | } |
@@ -247,7 +247,8 @@ |
||
| 247 | 247 | * |
| 248 | 248 | * @return array fields |
| 249 | 249 | */ |
| 250 | - public static function getFields() { |
|
| 250 | + public static function getFields() |
|
| 251 | + { |
|
| 251 | 252 | $conf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][self::$extKey]); |
| 252 | 253 | |
| 253 | 254 | $fields = []; |
@@ -113,7 +113,7 @@ |
||
| 113 | 113 | '###LABEL_HIGHLIGHT_WORD###' => $this->conf['highlightWordInputName'], |
| 114 | 114 | '###LABEL_ENCRYPTED###' => $this->conf['encryptedInputName'], |
| 115 | 115 | '###CURRENT_DOCUMENT###' => $this->getCurrentDocumentId(), |
| 116 | - '###SOLR_ENCRYPTED###' => $this->getEncryptedCoreName() ?: '', |
|
| 116 | + '###SOLR_ENCRYPTED###' => $this->getEncryptedCoreName() ? : '', |
|
| 117 | 117 | ]; |
| 118 | 118 | |
| 119 | 119 | $content .= $this->templateService->substituteMarkerArray($this->template, $markerArray); |
@@ -24,7 +24,8 @@ discard block |
||
| 24 | 24 | * @subpackage dlf |
| 25 | 25 | * @access public |
| 26 | 26 | */ |
| 27 | -class ResultDocument { |
|
| 27 | +class ResultDocument |
|
| 28 | +{ |
|
| 28 | 29 | |
| 29 | 30 | /** |
| 30 | 31 | * The identifier |
@@ -101,7 +102,8 @@ discard block |
||
| 101 | 102 | * |
| 102 | 103 | * @return void |
| 103 | 104 | */ |
| 104 | - public function __construct($record, $highlighting, $fields) { |
|
| 105 | + public function __construct($record, $highlighting, $fields) |
|
| 106 | + { |
|
| 105 | 107 | $this->id = $record[$fields['id']]; |
| 106 | 108 | $this->uid = $record[$fields['uid']]; |
| 107 | 109 | $this->page = $record[$fields['page']]; |
@@ -122,7 +124,8 @@ discard block |
||
| 122 | 124 | * |
| 123 | 125 | * @return string The result's record identifier |
| 124 | 126 | */ |
| 125 | - public function getId() { |
|
| 127 | + public function getId() |
|
| 128 | + { |
|
| 126 | 129 | return $this->id; |
| 127 | 130 | } |
| 128 | 131 | |
@@ -133,7 +136,8 @@ discard block |
||
| 133 | 136 | * |
| 134 | 137 | * @return string|null The result's record unified identifier |
| 135 | 138 | */ |
| 136 | - public function getUid() { |
|
| 139 | + public function getUid() |
|
| 140 | + { |
|
| 137 | 141 | return $this->uid; |
| 138 | 142 | } |
| 139 | 143 | |
@@ -144,7 +148,8 @@ discard block |
||
| 144 | 148 | * |
| 145 | 149 | * @return int The result's record page |
| 146 | 150 | */ |
| 147 | - public function getPage() { |
|
| 151 | + public function getPage() |
|
| 152 | + { |
|
| 148 | 153 | return $this->page; |
| 149 | 154 | } |
| 150 | 155 | |
@@ -155,7 +160,8 @@ discard block |
||
| 155 | 160 | * |
| 156 | 161 | * @return string All result's record snippets imploded to one string |
| 157 | 162 | */ |
| 158 | - public function getSnippets() { |
|
| 163 | + public function getSnippets() |
|
| 164 | + { |
|
| 159 | 165 | return $this->snippets; |
| 160 | 166 | } |
| 161 | 167 | |
@@ -166,7 +172,8 @@ discard block |
||
| 166 | 172 | * |
| 167 | 173 | * @return array(Page) All result's pages which contain search phrase |
| 168 | 174 | */ |
| 169 | - public function getPages() { |
|
| 175 | + public function getPages() |
|
| 176 | + { |
|
| 170 | 177 | return $this->pages; |
| 171 | 178 | } |
| 172 | 179 | |
@@ -177,7 +184,8 @@ discard block |
||
| 177 | 184 | * |
| 178 | 185 | * @return array(Region) All result's regions which contain search phrase |
| 179 | 186 | */ |
| 180 | - public function getRegions() { |
|
| 187 | + public function getRegions() |
|
| 188 | + { |
|
| 181 | 189 | return $this->regions; |
| 182 | 190 | } |
| 183 | 191 | |
@@ -188,7 +196,8 @@ discard block |
||
| 188 | 196 | * |
| 189 | 197 | * @return array(Highlight) All result's highlights of search phrase |
| 190 | 198 | */ |
| 191 | - public function getHighlights() { |
|
| 199 | + public function getHighlights() |
|
| 200 | + { |
|
| 192 | 201 | return $this->highlights; |
| 193 | 202 | } |
| 194 | 203 | |
@@ -199,7 +208,8 @@ discard block |
||
| 199 | 208 | * |
| 200 | 209 | * @return array(string) All result's highlights of search phrase |
| 201 | 210 | */ |
| 202 | - public function getHighlightsIds() { |
|
| 211 | + public function getHighlightsIds() |
|
| 212 | + { |
|
| 203 | 213 | $highlightsIds = []; |
| 204 | 214 | foreach ($this->highlights as $highlight) { |
| 205 | 215 | array_push($highlightsIds, $highlight->getId()); |
@@ -215,7 +225,8 @@ discard block |
||
| 215 | 225 | * |
| 216 | 226 | * @return void |
| 217 | 227 | */ |
| 218 | - private function parseSnippets() { |
|
| 228 | + private function parseSnippets() |
|
| 229 | + { |
|
| 219 | 230 | $snippetArray = $this->getArrayByIndex('text'); |
| 220 | 231 | |
| 221 | 232 | $this->snippets = !empty($snippetArray) ? implode(' [...] ', $snippetArray) : ''; |
@@ -229,7 +240,8 @@ discard block |
||
| 229 | 240 | * |
| 230 | 241 | * @return void |
| 231 | 242 | */ |
| 232 | - private function parsePages() { |
|
| 243 | + private function parsePages() |
|
| 244 | + { |
|
| 233 | 245 | $pageArray = $this->getArrayByIndex('pages'); |
| 234 | 246 | |
| 235 | 247 | $i = 0; |
@@ -249,7 +261,8 @@ discard block |
||
| 249 | 261 | * |
| 250 | 262 | * @return void |
| 251 | 263 | */ |
| 252 | - private function parseRegions() { |
|
| 264 | + private function parseRegions() |
|
| 265 | + { |
|
| 253 | 266 | $regionArray = $this->getArrayByIndex('regions'); |
| 254 | 267 | |
| 255 | 268 | $i = 0; |
@@ -269,7 +282,8 @@ discard block |
||
| 269 | 282 | * |
| 270 | 283 | * @return void |
| 271 | 284 | */ |
| 272 | - private function parseHighlights() { |
|
| 285 | + private function parseHighlights() |
|
| 286 | + { |
|
| 273 | 287 | $highlightArray = $this->getArrayByIndex('highlights'); |
| 274 | 288 | |
| 275 | 289 | foreach ($highlightArray as $highlights) { |
@@ -290,7 +304,8 @@ discard block |
||
| 290 | 304 | * |
| 291 | 305 | * @return array |
| 292 | 306 | */ |
| 293 | - private function getArrayByIndex($index) { |
|
| 307 | + private function getArrayByIndex($index) |
|
| 308 | + { |
|
| 294 | 309 | $objectArray = []; |
| 295 | 310 | foreach ($this->snippetsForRecord as $snippet) { |
| 296 | 311 | array_push($objectArray, $snippet[$index]); |
@@ -107,6 +107,6 @@ |
||
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | private function getUid($uid) { |
| 110 | - return is_numeric($uid) > 0 ? intval($uid) : $uid; |
|
| 110 | + return is_numeric($uid) > 0 ? intval($uid) : $uid; |
|
| 111 | 111 | } |
| 112 | 112 | } |
@@ -102,11 +102,13 @@ |
||
| 102 | 102 | return $response; |
| 103 | 103 | } |
| 104 | 104 | |
| 105 | - private function getQuery($fields, $parameters) { |
|
| 105 | + private function getQuery($fields, $parameters) |
|
| 106 | + { |
|
| 106 | 107 | return $fields['fulltext'] . ':(' . Solr::escapeQuery((string) $parameters['q']) . ') AND ' . $fields['uid'] . ':' . $this->getUid($parameters['uid']); |
| 107 | 108 | } |
| 108 | 109 | |
| 109 | - private function getUid($uid) { |
|
| 110 | + private function getUid($uid) |
|
| 111 | + { |
|
| 110 | 112 | return is_numeric($uid) > 0 ? intval($uid) : $uid; |
| 111 | 113 | } |
| 112 | 114 | } |
@@ -462,12 +462,12 @@ |
||
| 462 | 462 | ) { |
| 463 | 463 | // Search in document and all subordinates (valid for up to three levels of hierarchy). |
| 464 | 464 | $params['filterquery'][]['query'] = '_query_:"{!join from=' |
| 465 | - . $fields['uid'] .' to=' . $fields['partof'] .'}' |
|
| 466 | - . $fields['uid'] .':{!join from=' . $fields['uid'] .' to=' . $fields['partof'] .'}' |
|
| 467 | - . $fields['uid'] .':' . $this->piVars['id'] . '"' . ' OR {!join from=' |
|
| 468 | - . $fields['uid'] .' to=' . $fields['partof'] .'}' |
|
| 469 | - . $fields['uid'] .':' . $this->piVars['id'] . ' OR ' |
|
| 470 | - . $fields['uid'] .':' . $this->piVars['id']; |
|
| 465 | + . $fields['uid'] . ' to=' . $fields['partof'] . '}' |
|
| 466 | + . $fields['uid'] . ':{!join from=' . $fields['uid'] . ' to=' . $fields['partof'] . '}' |
|
| 467 | + . $fields['uid'] . ':' . $this->piVars['id'] . '"' . ' OR {!join from=' |
|
| 468 | + . $fields['uid'] . ' to=' . $fields['partof'] . '}' |
|
| 469 | + . $fields['uid'] . ':' . $this->piVars['id'] . ' OR ' |
|
| 470 | + . $fields['uid'] . ':' . $this->piVars['id']; |
|
| 471 | 471 | $label .= htmlspecialchars(sprintf($this->pi_getLL('in', ''), Document::getTitle($this->piVars['id']))); |
| 472 | 472 | } |
| 473 | 473 | } |