Passed
Pull Request — master (#123)
by
unknown
05:05
created
Classes/Controller/PageGridController.php 2 patches
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -23,8 +23,7 @@
 block discarded – undo
23 23
  *
24 24
  * @access public
25 25
  */
26
-class PageGridController extends AbstractController
27
-{
26
+class PageGridController extends AbstractController {
28 27
     /**
29 28
      * The main method of the plugin
30 29
      *
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@
 block discarded – undo
66 66
         $pageGridPagination = new PageGridPagination($pageGridPaginator);
67 67
 
68 68
         $pagination = $this->buildSimplePagination($pageGridPagination, $pageGridPaginator);
69
-        $this->view->assignMultiple([ 'pagination' => $pagination, 'paginator' => $pageGridPaginator ]);
69
+        $this->view->assignMultiple(['pagination' => $pagination, 'paginator' => $pageGridPaginator]);
70 70
 
71 71
         $this->view->assign('docUid', $this->requestData['id']);
72 72
 
Please login to merge, or discard this patch.
Classes/Controller/MetadataController.php 3 patches
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -27,8 +27,7 @@
 block discarded – undo
27 27
  *
28 28
  * @access public
29 29
  */
30
-class MetadataController extends AbstractController
31
-{
30
+class MetadataController extends AbstractController {
32 31
     /**
33 32
      * @access private
34 33
      * @var AbstractDocument
Please login to merge, or discard this patch.
Upper-Lower-Casing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
     protected function printMetadata(array $metadata): void
156 156
     {
157 157
         if ($this->useOriginalIiifManifestMetadata) {
158
-            $this->view->assign('useIiif', true);
158
+            $this->view->assign('useIiif', TRUE);
159 159
             $this->view->assign('iiifData', $this->buildIiifData($metadata));
160 160
         } else {
161 161
             // findBySettings also sorts entries by the `sorting` field
@@ -245,9 +245,9 @@  discard block
 block discarded – undo
245 245
         if (IRI::isAbsoluteIri($value) && ($scheme == 'http' || $scheme == 'https')) {
246 246
             //TODO: should really label be converted to empty string if equal to value?
247 247
             $label = $value == $label ? '' : $label;
248
-            $buildUrl = true;
248
+            $buildUrl = TRUE;
249 249
         } else {
250
-            $buildUrl = false;
250
+            $buildUrl = FALSE;
251 251
         }
252 252
 
253 253
         return [
@@ -388,7 +388,7 @@  discard block
 block discarded – undo
388 388
     private function parseParentTitle(int $i, $value, array &$metadata) : void
389 389
     {
390 390
         if (empty(implode('', $value)) && $this->settings['getTitle'] && $this->document->getPartof()) {
391
-            $superiorTitle = AbstractDocument::getTitle($this->document->getPartof(), true);
391
+            $superiorTitle = AbstractDocument::getTitle($this->document->getPartof(), TRUE);
392 392
             if (!empty($superiorTitle)) {
393 393
                 $metadata[$i]['title'] = ['[' . $superiorTitle . ']'];
394 394
             }
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
         }
132 132
 
133 133
         if (empty(array_filter($metadata))) {
134
-            $this->logger->warning('No metadata found for document with UID ' . $this->document->getUid());
134
+            $this->logger->warning('No metadata found for document with UID '.$this->document->getUid());
135 135
             return $this->htmlResponse();
136 136
         }
137 137
         ksort($metadata);
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
                     $this->parseMetadata($i, $name, $value, $metadata);
185 185
 
186 186
                     if (is_array($metadata[$i][$name])) {
187
-                        $metadata[$i][$name] = array_values(array_filter($metadata[$i][$name], function ($metadataValue) {
187
+                        $metadata[$i][$name] = array_values(array_filter($metadata[$i][$name], function($metadataValue) {
188 188
                             return !empty($metadataValue);
189 189
                         }));
190 190
                     }
@@ -401,7 +401,7 @@  discard block
 block discarded – undo
401 401
         if (empty(implode('', $value)) && $this->settings['getTitle'] && $this->document->getPartof()) {
402 402
             $superiorTitle = AbstractDocument::getTitle($this->document->getPartof(), true);
403 403
             if (!empty($superiorTitle)) {
404
-                $metadata[$i]['title'] = ['[' . $superiorTitle . ']'];
404
+                $metadata[$i]['title'] = ['['.$superiorTitle.']'];
405 405
             }
406 406
         }
407 407
     }
Please login to merge, or discard this patch.
Classes/Controller/TableOfContentsController.php 3 patches
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -23,8 +23,7 @@
 block discarded – undo
23 23
  *
24 24
  * @access public
25 25
  */
26
-class TableOfContentsController extends AbstractController
27
-{
26
+class TableOfContentsController extends AbstractController {
28 27
     /**
29 28
      * This holds the active entries according to the currently selected page
30 29
      *
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
                 }
162 162
             }
163 163
             // Append "IFSUB" to "ITEM_STATE" if this entry has sub-entries.
164
-            $entryArray['ITEM_STATE'] = ($entryArray['ITEM_STATE'] == 'NO' ? 'IFSUB' : $entryArray['ITEM_STATE'] . 'IFSUB');
164
+            $entryArray['ITEM_STATE'] = ($entryArray['ITEM_STATE'] == 'NO' ? 'IFSUB' : $entryArray['ITEM_STATE'].'IFSUB');
165 165
         }
166 166
         return $entryArray;
167 167
     }
@@ -338,16 +338,16 @@  discard block
 block discarded – undo
338 338
                     $title = '';
339 339
                     foreach ($fields as $field) {
340 340
                         if ($field == 'type') {
341
-                            $title .= $this->getTranslatedType($entry['type']) . ' ';
341
+                            $title .= $this->getTranslatedType($entry['type']).' ';
342 342
                         } else {
343
-                            $title .= $entry[$field] . ' ';
343
+                            $title .= $entry[$field].' ';
344 344
                         }
345 345
                     }
346 346
                     return trim($title);
347 347
                 }
348 348
             }
349 349
         }
350
-        return $label ?: $orderLabel;
350
+        return $label ? : $orderLabel;
351 351
     }
352 352
 
353 353
     /**
@@ -382,7 +382,7 @@  discard block
 block discarded – undo
382 382
     {
383 383
         usort(
384 384
             $menu[0]['_SUB_MENU'],
385
-            function ($firstElement, $secondElement) {
385
+            function($firstElement, $secondElement) {
386 386
                 if (!empty($firstElement['orderlabel'])) {
387 387
                     return $firstElement['orderlabel'] <=> $secondElement['orderlabel'];
388 388
                 }
Please login to merge, or discard this patch.
Upper-Lower-Casing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -72,12 +72,12 @@  discard block
 block discarded – undo
72 72
             $this->getAllLogicalUnits();
73 73
             // Go through table of contents and create all menu entries.
74 74
             foreach ($this->document->getCurrentDocument()->tableOfContents as $entry) {
75
-                $menuArray[] = $this->getMenuEntry($entry, true);
75
+                $menuArray[] = $this->getMenuEntry($entry, TRUE);
76 76
             }
77 77
         } else {
78 78
             // Go through table of contents and create top-level menu entries.
79 79
             foreach ($this->document->getCurrentDocument()->tableOfContents as $entry) {
80
-                $menuArray[] = $this->getMenuEntry($entry, false);
80
+                $menuArray[] = $this->getMenuEntry($entry, FALSE);
81 81
             }
82 82
             // Build table of contents from database.
83 83
             $result = $this->documentRepository->getTableOfContentsFromDb($this->document->getUid(), $this->document->getPid(), $this->settings);
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
                         'pagination' => '',
98 98
                         'targetUid' => $resArray['uid']
99 99
                     ];
100
-                    $menuArray[0]['_SUB_MENU'][] = $this->getMenuEntry($entry, false);
100
+                    $menuArray[0]['_SUB_MENU'][] = $this->getMenuEntry($entry, FALSE);
101 101
                 }
102 102
             }
103 103
         }
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
      *
116 116
      * @return array HMENU array for menu entry
117 117
      */
118
-    private function getMenuEntry(array $entry, bool $recursive = false): array
118
+    private function getMenuEntry(array $entry, bool $recursive = FALSE): array
119 119
     {
120 120
         $entry = $this->resolveMenuEntry($entry);
121 121
 
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
         $entryArray['doNotLinkIt'] = 1;
132 132
         $entryArray['ITEM_STATE'] = 'NO';
133 133
 
134
-        $this->buildMenuLinks($entryArray, $entry['id'], $entry['points'] ?? null, $entry['targetUid'] ?? null);
134
+        $this->buildMenuLinks($entryArray, $entry['id'], $entry['points'] ?? NULL, $entry['targetUid'] ?? NULL);
135 135
 
136 136
         // Set "ITEM_STATE" to "CUR" if this entry points to current page.
137 137
         if (in_array($entry['id'], $this->activeEntries)) {
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
         }
140 140
         // Build sub-menu if available and called recursively.
141 141
         if (
142
-            $recursive === true
142
+            $recursive === TRUE
143 143
             && !empty($entry['children'])
144 144
         ) {
145 145
             // Build sub-menu only if one of the following conditions apply:
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
                     if (in_array($child['id'], $this->activeEntries)) {
158 158
                         $entryArray['ITEM_STATE'] = 'ACT';
159 159
                     }
160
-                    $entryArray['_SUB_MENU'][] = $this->getMenuEntry($child, true);
160
+                    $entryArray['_SUB_MENU'][] = $this->getMenuEntry($child, TRUE);
161 161
                 }
162 162
             }
163 163
             // Append "IFSUB" to "ITEM_STATE" if this entry has sub-entries.
Please login to merge, or discard this patch.
Classes/Controller/FeedsController.php 3 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
         if ($library) {
76 76
             $feedMeta['copyright'] = $library->getLabel();
77 77
         } else {
78
-            $this->logger->error('Failed to fetch label of selected library with "' . $this->settings['library'] . '"');
78
+            $this->logger->error('Failed to fetch label of selected library with "'.$this->settings['library'].'"');
79 79
         }
80 80
 
81 81
         if (
@@ -95,12 +95,12 @@  discard block
 block discarded – undo
95 95
                 ) {
96 96
                     $superiorTitle = AbstractDocument::getTitle($document->getPartof(), true);
97 97
                     if (!empty($superiorTitle)) {
98
-                        $title .= '[' . $superiorTitle . ']';
98
+                        $title .= '['.$superiorTitle.']';
99 99
                     }
100 100
                 }
101 101
                 // Get title of document.
102 102
                 if (!empty($document->getTitle())) {
103
-                    $title .= ' ' . $document->getTitle();
103
+                    $title .= ' '.$document->getTitle();
104 104
                 }
105 105
                 // Set default title if empty.
106 106
                 if (empty($title)) {
@@ -108,13 +108,13 @@  discard block
 block discarded – undo
108 108
                 }
109 109
                 // Append volume information.
110 110
                 if (!empty($document->getVolume())) {
111
-                    $title .= ', ' . LocalizationUtility::translate('volume', 'dlf') . ' ' . $document->getVolume();
111
+                    $title .= ', '.LocalizationUtility::translate('volume', 'dlf').' '.$document->getVolume();
112 112
                 }
113 113
                 // Is this document new or updated?
114 114
                 if ($document->getCrdate() == $document->getTstamp()) {
115
-                    $title = LocalizationUtility::translate('plugins.feeds.new', 'dlf') . ' ' . trim($title);
115
+                    $title = LocalizationUtility::translate('plugins.feeds.new', 'dlf').' '.trim($title);
116 116
                 } else {
117
-                    $title = LocalizationUtility::translate('plugins.feeds.update', 'dlf') . ' ' . trim($title);
117
+                    $title = LocalizationUtility::translate('plugins.feeds.update', 'dlf').' '.trim($title);
118 118
                 }
119 119
 
120 120
                 $document->setTitle($title);
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -24,8 +24,7 @@
 block discarded – undo
24 24
  *
25 25
  * @access public
26 26
  */
27
-class FeedsController extends AbstractController
28
-{
27
+class FeedsController extends AbstractController {
29 28
 
30 29
     /**
31 30
      * @access protected
Please login to merge, or discard this patch.
Upper-Lower-Casing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
             || GeneralUtility::inList($this->settings['collections'], $requestData['collection'])
86 86
         ) {
87 87
 
88
-            $documents = $this->documentRepository->findAllByCollectionsLimited(GeneralUtility::intExplode(',', $requestData['collection'] ?? "", true), $this->settings['limit']);
88
+            $documents = $this->documentRepository->findAllByCollectionsLimited(GeneralUtility::intExplode(',', $requestData['collection'] ?? "", TRUE), $this->settings['limit']);
89 89
 
90 90
             foreach ($documents as $document) {
91 91
 
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
                 if ((empty($document->getTitle()) || !empty($this->settings['prependSuperiorTitle']))
95 95
                     && !empty($document->getPartof())
96 96
                 ) {
97
-                    $superiorTitle = AbstractDocument::getTitle($document->getPartof(), true);
97
+                    $superiorTitle = AbstractDocument::getTitle($document->getPartof(), TRUE);
98 98
                     if (!empty($superiorTitle)) {
99 99
                         $title .= '[' . $superiorTitle . ']';
100 100
                     }
Please login to merge, or discard this patch.
Classes/Controller/CalendarController.php 3 patches
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -25,8 +25,7 @@
 block discarded – undo
25 25
  *
26 26
  * @access public
27 27
  */
28
-class CalendarController extends AbstractController
29
-{
28
+class CalendarController extends AbstractController {
30 29
     /**
31 30
      * @access protected
32 31
      * @var StructureRepository
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -136,8 +136,8 @@  discard block
 block discarded – undo
136 136
         $this->view->assign('calendarData', $calendarData);
137 137
         $this->view->assign('documentId', $this->document->getUid());
138 138
         $this->view->assign('yearLinkTitle', $yearLinkTitle);
139
-        $this->view->assign('parentDocumentId', $this->document->getPartof() ?: $this->document->getCurrentDocument()->tableOfContents[0]['points']);
140
-        $this->view->assign('allYearDocTitle', $this->document->getCurrentDocument()->getTitle($this->document->getPartof()) ?: $this->document->getCurrentDocument()->tableOfContents[0]['label']);
139
+        $this->view->assign('parentDocumentId', $this->document->getPartof() ? : $this->document->getCurrentDocument()->tableOfContents[0]['points']);
140
+        $this->view->assign('allYearDocTitle', $this->document->getCurrentDocument()->getTitle($this->document->getPartof()) ? : $this->document->getCurrentDocument()->tableOfContents[0]['label']);
141 141
 
142 142
         return $this->htmlResponse();
143 143
     }
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
         }
225 225
 
226 226
         $this->view->assign('documentId', $this->document->getUid());
227
-        $this->view->assign('allYearDocTitle', $this->document->getCurrentDocument()->getTitle((int) $this->document->getUid()) ?: $this->document->getCurrentDocument()->tableOfContents[0]['label']);
227
+        $this->view->assign('allYearDocTitle', $this->document->getCurrentDocument()->getTitle((int) $this->document->getUid()) ? : $this->document->getCurrentDocument()->tableOfContents[0]['label']);
228 228
 
229 229
         return $this->htmlResponse();
230 230
     }
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
     protected function getCalendarYear(array &$calendarData, array $calendarIssuesByMonth, int $year, int $firstMonth = 1, int $lastMonth = 12): void
246 246
     {
247 247
         for ($i = $firstMonth; $i <= $lastMonth; $i++) {
248
-            $key = $year . '-' . $i;
248
+            $key = $year.'-'.$i;
249 249
 
250 250
             $calendarData[$key] = [
251 251
                 'DAYMON_NAME' => strftime('%a', strtotime('last Monday')),
@@ -255,16 +255,16 @@  discard block
 block discarded – undo
255 255
                 'DAYFRI_NAME' => strftime('%a', strtotime('last Friday')),
256 256
                 'DAYSAT_NAME' => strftime('%a', strtotime('last Saturday')),
257 257
                 'DAYSUN_NAME' => strftime('%a', strtotime('last Sunday')),
258
-                'MONTHNAME'  => strftime('%B', strtotime($year . '-' . $i . '-1')) . ' ' . $year,
258
+                'MONTHNAME'  => strftime('%B', strtotime($year.'-'.$i.'-1')).' '.$year,
259 259
                 'CALYEAR' => ($i == $firstMonth) ? $year : ''
260 260
             ];
261 261
 
262
-            $firstOfMonth = strtotime($year . '-' . $i . '-1');
262
+            $firstOfMonth = strtotime($year.'-'.$i.'-1');
263 263
             $lastOfMonth = strtotime('last day of', ($firstOfMonth));
264 264
             $firstOfMonthStart = strtotime('last Monday', $firstOfMonth);
265 265
             // There are never more than 6 weeks in a month.
266 266
             for ($j = 0; $j <= 5; $j++) {
267
-                $firstDayOfWeek = strtotime('+ ' . $j . ' Week', $firstOfMonthStart);
267
+                $firstDayOfWeek = strtotime('+ '.$j.' Week', $firstOfMonthStart);
268 268
 
269 269
                 $calendarData[$key]['week'][$j] = [
270 270
                     'DAYMON' => ['dayValue' => '&nbsp;'],
@@ -277,7 +277,7 @@  discard block
 block discarded – undo
277 277
                 ];
278 278
                 // Every week has seven days. ;-)
279 279
                 for ($k = 0; $k <= 6; $k++) {
280
-                    $currentDayTime = strtotime('+ ' . $k . ' Day', $firstDayOfWeek);
280
+                    $currentDayTime = strtotime('+ '.$k.' Day', $firstDayOfWeek);
281 281
                     if (
282 282
                         $currentDayTime >= $firstOfMonth
283 283
                         && $currentDayTime <= $lastOfMonth
@@ -348,7 +348,7 @@  discard block
 block discarded – undo
348 348
      */
349 349
     private function fillCalendar(array &$calendarData, int $currentDayTime, string $dayLinks, array $dayLinkDiv, int $firstDayOfWeek, int $k): void
350 350
     {
351
-        switch (strftime('%w', strtotime('+ ' . $k . ' Day', $firstDayOfWeek))) {
351
+        switch (strftime('%w', strtotime('+ '.$k.' Day', $firstDayOfWeek))) {
352 352
             case '0':
353 353
                 $this->fillDay($calendarData, $currentDayTime, 'DAYSUN', $dayLinks, $dayLinkDiv);
354 354
                 break;
@@ -452,7 +452,7 @@  discard block
 block discarded – undo
452 452
                 $_day = date('j', $dateTimestamp);
453 453
                 $issuesByYear[$_year][$_month][$_day][] = $issue;
454 454
             } else {
455
-                $this->logger->warning('Document with UID ' . $issue['uid'] . 'has no valid date of publication');
455
+                $this->logger->warning('Document with UID '.$issue['uid'].'has no valid date of publication');
456 456
             }
457 457
         }
458 458
         // Sort by years.
@@ -495,7 +495,7 @@  discard block
 block discarded – undo
495 495
             foreach ($year['children'] as $month) {
496 496
                 foreach ($month['children'] as $day) {
497 497
                     foreach ($day['children'] as $issue) {
498
-                        $title = $issue['label'] ?: $issue['orderlabel'];
498
+                        $title = $issue['label'] ? : $issue['orderlabel'];
499 499
                         if (strtotime($title) !== false) {
500 500
                             $title = strftime('%x', strtotime($title));
501 501
                         }
Please login to merge, or discard this patch.
Upper-Lower-Casing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -83,9 +83,9 @@  discard block
 block discarded – undo
83 83
         switch ($type) {
84 84
             case 'newspaper':
85 85
             case 'ephemera':
86
-                return $this->redirect('years', null, null, $this->requestData);
86
+                return $this->redirect('years', NULL, NULL, $this->requestData);
87 87
             case 'year':
88
-                return $this->redirect('calendar', null, null, $this->requestData);
88
+                return $this->redirect('calendar', NULL, NULL, $this->requestData);
89 89
             case 'issue':
90 90
             default:
91 91
                 break;
@@ -446,7 +446,7 @@  discard block
 block discarded – undo
446 446
 
447 447
         foreach ($this->getIssues() as $issue) {
448 448
             $dateTimestamp = strtotime($issue['year']);
449
-            if ($dateTimestamp !== false) {
449
+            if ($dateTimestamp !== FALSE) {
450 450
                 $_year = date('Y', $dateTimestamp);
451 451
                 $_month = date('n', $dateTimestamp);
452 452
                 $_day = date('j', $dateTimestamp);
@@ -496,7 +496,7 @@  discard block
 block discarded – undo
496 496
                 foreach ($month['children'] as $day) {
497 497
                     foreach ($day['children'] as $issue) {
498 498
                         $title = $issue['label'] ?: $issue['orderlabel'];
499
-                        if (strtotime($title) !== false) {
499
+                        if (strtotime($title) !== FALSE) {
500 500
                             $title = strftime('%x', strtotime($title));
501 501
                         }
502 502
 
@@ -529,7 +529,7 @@  discard block
 block discarded – undo
529 529
                 $title = $document->getTitle();
530 530
             } else {
531 531
                 $title = !empty($document->getMetsLabel()) ? $document->getMetsLabel() : $document->getMetsOrderlabel();
532
-                if (strtotime($title) !== false) {
532
+                if (strtotime($title) !== FALSE) {
533 533
                     $title = strftime('%x', strtotime($title));
534 534
                 }
535 535
             }
Please login to merge, or discard this patch.
Classes/Controller/BasketController.php 3 patches
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -33,8 +33,7 @@  discard block
 block discarded – undo
33 33
  *
34 34
  * @access public
35 35
  */
36
-class BasketController extends AbstractController
37
-{
36
+class BasketController extends AbstractController {
38 37
     /**
39 38
      * @access protected
40 39
      * @var BasketRepository
@@ -328,8 +327,7 @@  discard block
 block discarded – undo
328 327
      *
329 328
      * @return array|false download url or false
330 329
      */
331
-    protected function getDocumentData(int $id, array $data)
332
-    {
330
+    protected function getDocumentData(int $id, array $data) {
333 331
         // get document instance to load further information
334 332
         $this->loadDocument((int) $id);
335 333
         if (isset($this->document)) {
Please login to merge, or discard this patch.
Upper-Lower-Casing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
 
191 191
         $countDocs = 0;
192 192
         if ($basket->getDocIds()) {
193
-            $countDocs = count(json_decode($basket->getDocIds(), true));
193
+            $countDocs = count(json_decode($basket->getDocIds(), TRUE));
194 194
         }
195 195
         $this->view->assign('countDocs', $countDocs);
196 196
 
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
         }
254 254
 
255 255
         // session does not exist
256
-        if ($basket === null) {
256
+        if ($basket === NULL) {
257 257
             // create new basket in db
258 258
             $basket = GeneralUtility::makeInstance(Basket::class);
259 259
             $basket->setSessionId($userSession->getIdentifier());
@@ -388,7 +388,7 @@  discard block
 block discarded – undo
388 388
                 'record_id' => $this->document->getRecordId(),
389 389
             ];
390 390
         }
391
-        return false;
391
+        return FALSE;
392 392
     }
393 393
 
394 394
     /**
@@ -410,7 +410,7 @@  discard block
 block discarded – undo
410 410
         } else {
411 411
             $page = (int) $piVars['startpage'];
412 412
         }
413
-        if ($page != null || $piVars['addToBasket'] == 'list') {
413
+        if ($page != NULL || $piVars['addToBasket'] == 'list') {
414 414
             $documentItem = [
415 415
                 'id' => (int) $piVars['id'],
416 416
                 'startpage' => (int) $piVars['startpage'],
@@ -433,7 +433,7 @@  discard block
 block discarded – undo
433 433
             $this->loadDocument((int) $documentItem['id']);
434 434
             if ($this->isDocMissing()) {
435 435
                 // Quit without doing anything if required variables are not set.
436
-                return null;
436
+                return NULL;
437 437
             }
438 438
             // set endpage for toc and subentry based on logid
439 439
             if (($piVars['addToBasket'] == 'subentry') or ($piVars['addToBasket'] == 'toc')) {
@@ -487,7 +487,7 @@  discard block
 block discarded – undo
487 487
             }
488 488
 
489 489
             $basket->setDocIds(json_encode($items));
490
-            if ($basket->getUid() === null) {
490
+            if ($basket->getUid() === NULL) {
491 491
                 $this->basketRepository->add($basket);
492 492
             } else {
493 493
                 $this->basketRepository->update($basket);
Please login to merge, or discard this patch.
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
                 foreach ($this->requestData['selected'] as $docValue) {
135 135
                     if ($docValue['id']) {
136 136
                         $docData = $this->getDocumentData((int) $docValue['id'], $docValue);
137
-                        $pdfUrl .= $docData['urlParams'] . $this->settings['pdfparamseparator'];
137
+                        $pdfUrl .= $docData['urlParams'].$this->settings['pdfparamseparator'];
138 138
                         $this->redirectToUri($pdfUrl);
139 139
                     }
140 140
                 }
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
         if ($allMails->count() > 0) {
202 202
             $mailSelect[0] = htmlspecialchars(LocalizationUtility::translate('basket.chooseMail', 'dlf'));
203 203
             foreach ($allMails as $mail) {
204
-                $mailSelect[$mail->getUid()] = htmlspecialchars($mail->getName()) . ' (' . htmlspecialchars($mail->getMail()) . ')';
204
+                $mailSelect[$mail->getUid()] = htmlspecialchars($mail->getName()).' ('.htmlspecialchars($mail->getMail()).')';
205 205
             }
206 206
             $this->view->assign('mailSelect', $mailSelect);
207 207
         }
@@ -290,12 +290,12 @@  discard block
 block discarded – undo
290 290
 
291 291
         $docData = $this->getDocumentData((int) $id, $data);
292 292
 
293
-        $entryKey = $id . '_' . $startPage;
293
+        $entryKey = $id.'_'.$startPage;
294 294
         if (!empty($startX)) {
295
-            $entryKey .= '_' . $startX;
295
+            $entryKey .= '_'.$startX;
296 296
         }
297 297
         if (!empty($endX)) {
298
-            $entryKey .= '_' . $endX;
298
+            $entryKey .= '_'.$endX;
299 299
         }
300 300
 
301 301
         $entry = [
@@ -354,7 +354,7 @@  discard block
 block discarded – undo
354 354
             $urlParams = str_replace("##endy##", $data['endY'] === "" ? "" : (int) $data['endY'], $urlParams);
355 355
             $urlParams = str_replace("##rotation##", $data['rotation'] === "" ? "" : (int) $data['rotation'], $urlParams);
356 356
 
357
-            $downloadUrl = $this->settings['pdfgenerate'] . $urlParams;
357
+            $downloadUrl = $this->settings['pdfgenerate'].$urlParams;
358 358
 
359 359
             $title = $this->document->getTitle();
360 360
             if (empty($title)) {
@@ -365,15 +365,15 @@  discard block
 block discarded – undo
365 365
             $info = '';
366 366
             if ($data['startX'] != '' && $data['endX'] != '') {
367 367
                 // cutout
368
-                $info .= htmlspecialchars(LocalizationUtility::translate('basket.cutout', 'dlf')) . ' ';
368
+                $info .= htmlspecialchars(LocalizationUtility::translate('basket.cutout', 'dlf')).' ';
369 369
             }
370 370
             if ($data['startpage'] == $data['endpage']) {
371 371
                 // One page
372
-                $info .= htmlspecialchars(LocalizationUtility::translate('page', 'dlf')) . ' ' . $data['startpage'];
372
+                $info .= htmlspecialchars(LocalizationUtility::translate('page', 'dlf')).' '.$data['startpage'];
373 373
             } else {
374
-                $info .= htmlspecialchars(LocalizationUtility::translate('page', 'dlf')) . ' ' . $data['startpage'] . '-' . $data['endpage'];
374
+                $info .= htmlspecialchars(LocalizationUtility::translate('page', 'dlf')).' '.$data['startpage'].'-'.$data['endpage'];
375 375
             }
376
-            $downloadLink = '<a href="' . $downloadUrl . '" target="_blank">' . htmlspecialchars($title) . '</a> (' . $info . ')';
376
+            $downloadLink = '<a href="'.$downloadUrl.'" target="_blank">'.htmlspecialchars($title).'</a> ('.$info.')';
377 377
             if ($data['startpage'] == $data['endpage']) {
378 378
                 $pageNums = 1;
379 379
             } else {
@@ -446,12 +446,12 @@  discard block
 block discarded – undo
446 446
             if ($piVars['addToBasket'] == 'list') {
447 447
                 $documentItem['endpage'] = $this->document->getCurrentDocument()->numPages;
448 448
             }
449
-            $arrayKey = $documentItem['id'] . '_' . $page;
449
+            $arrayKey = $documentItem['id'].'_'.$page;
450 450
             if (!empty($documentItem['startX'])) {
451
-                $arrayKey .= '_' . $documentItem['startX'];
451
+                $arrayKey .= '_'.$documentItem['startX'];
452 452
             }
453 453
             if (!empty($documentItem['endX'])) {
454
-                $arrayKey .= '_' . $documentItem['endX'];
454
+                $arrayKey .= '_'.$documentItem['endX'];
455 455
             }
456 456
             // do not add more than one identical object
457 457
             if (!in_array($arrayKey, $items)) {
@@ -472,14 +472,14 @@  discard block
 block discarded – undo
472 472
                     // remove parameter endpage
473 473
                     $pdfParams = str_replace(",##endpage##", '', $pdfParams);
474 474
                 }
475
-                $pdfGenerateUrl = $this->settings['pdfgenerate'] . $pdfParams;
475
+                $pdfGenerateUrl = $this->settings['pdfgenerate'].$pdfParams;
476 476
                 if ($this->settings['pregeneration']) {
477 477
                     // send ajax request to webapp
478 478
                     $output .= '
479 479
      <script>
480 480
       $(document).ready(function(){
481 481
        $.ajax({
482
-         url: "' . $pdfGenerateUrl . '",
482
+         url: "' . $pdfGenerateUrl.'",
483 483
        }).done(function() {
484 484
        });
485 485
       });
@@ -517,12 +517,12 @@  discard block
 block discarded – undo
517 517
         }
518 518
         foreach ($piVars['selected'] as $value) {
519 519
             if (isset($value['id'])) {
520
-                $arrayKey = $value['id'] . '_' . $value['startpage'];
520
+                $arrayKey = $value['id'].'_'.$value['startpage'];
521 521
                 if (!empty($value['startX'])) {
522
-                    $arrayKey .= '_' . $value['startX'];
522
+                    $arrayKey .= '_'.$value['startX'];
523 523
                 }
524 524
                 if (!empty($value['endX'])) {
525
-                    $arrayKey .= '_' . $value['endX'];
525
+                    $arrayKey .= '_'.$value['endX'];
526 526
                 }
527 527
                 if (isset($items[$arrayKey])) {
528 528
                     unset($items[$arrayKey]);
@@ -555,7 +555,7 @@  discard block
 block discarded – undo
555 555
 
556 556
         $mailObject = $this->mailRepository->findByUid(intval($mailId))->getFirst();
557 557
 
558
-        $mailText = htmlspecialchars(LocalizationUtility::translate('basket.mailBody', 'dlf')) . "\n";
558
+        $mailText = htmlspecialchars(LocalizationUtility::translate('basket.mailBody', 'dlf'))."\n";
559 559
         $numberOfPages = 0;
560 560
         $pdfUrl = $this->settings['pdfdownload'];
561 561
         // prepare links
@@ -563,7 +563,7 @@  discard block
 block discarded – undo
563 563
             if ($docValue['id']) {
564 564
                 $explodeId = explode("_", $docValue['id']);
565 565
                 $docData = $this->getDocumentData((int) $explodeId[0], $docValue);
566
-                $pdfUrl .= $docData['urlParams'] . $this->settings['pdfparamseparator'];
566
+                $pdfUrl .= $docData['urlParams'].$this->settings['pdfparamseparator'];
567 567
                 $pages = (abs(intval($docValue['startpage']) - intval($docValue['endpage'])));
568 568
                 if ($pages === 0) {
569 569
                     $numberOfPages = $numberOfPages + 1;
@@ -574,7 +574,7 @@  discard block
 block discarded – undo
574 574
         }
575 575
         // Remove leading/tailing pdfparamseperator
576 576
         $pdfUrl = trim($pdfUrl, $this->settings['pdfparamseparator']);
577
-        $mailBody = $mailText . $pdfUrl;
577
+        $mailBody = $mailText.$pdfUrl;
578 578
         // Get hook objects.
579 579
         $hookObjects = Helper::getHookObjects('Classes/Controller/BasketController.php');
580 580
         // Hook for getting a customized mail body.
@@ -601,7 +601,7 @@  discard block
 block discarded – undo
601 601
         $newActionLog = GeneralUtility::makeInstance(ActionLog::class);
602 602
         $newActionLog->setFileName($pdfUrl);
603 603
         $newActionLog->setCountPages($numberOfPages);
604
-        $newActionLog->setLabel('Mail: ' . $mailObject->getMail());
604
+        $newActionLog->setLabel('Mail: '.$mailObject->getMail());
605 605
 
606 606
         if ($this->isUserLoggedIn()) {
607 607
             // internal user
@@ -630,7 +630,7 @@  discard block
 block discarded – undo
630 630
         foreach ($this->requestData['selected'] as $docId => $docValue) {
631 631
             if ($docValue['id']) {
632 632
                 $docData = $this->getDocumentData((int) $docValue['id'], $docValue);
633
-                $pdfUrl .= $docData['urlParams'] . $this->settings['pdfparamseparator'];
633
+                $pdfUrl .= $docData['urlParams'].$this->settings['pdfparamseparator'];
634 634
                 $numberOfPages += $docData['pageNums'];
635 635
             }
636 636
         }
@@ -648,7 +648,7 @@  discard block
 block discarded – undo
648 648
                 if ($docValue['id']) {
649 649
                     $explodeId = explode("_", $docId);
650 650
                     $docData = $this->getDocumentData((int) $explodeId[0], $docValue);
651
-                    $pdfUrl .= $docData['urlParams'] . $this->settings['pdfparamseparator'];
651
+                    $pdfUrl .= $docData['urlParams'].$this->settings['pdfparamseparator'];
652 652
                     $numberOfPages += $docData['pageNums'];
653 653
                 }
654 654
             }
@@ -665,12 +665,12 @@  discard block
 block discarded – undo
665 665
             // internal user
666 666
             $actionLog->setUserId($GLOBALS["TSFE"]->fe_user->user['uid']);
667 667
             $actionLog->setName($GLOBALS["TSFE"]->fe_user->user['username']);
668
-            $actionLog->setLabel('Print: ' . $printer->getLabel());
668
+            $actionLog->setLabel('Print: '.$printer->getLabel());
669 669
         } else {
670 670
             // external user
671 671
             $actionLog->setUserId(0);
672 672
             $actionLog->setName('n/a');
673
-            $actionLog->setLabel('Print: ' . $printer->getLabel());
673
+            $actionLog->setLabel('Print: '.$printer->getLabel());
674 674
         }
675 675
         // add action to protocol
676 676
         $this->actionLogRepository->add($actionLog);
Please login to merge, or discard this patch.
Classes/Controller/CollectionController.php 3 patches
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -28,8 +28,7 @@
 block discarded – undo
28 28
  *
29 29
  * @access public
30 30
  */
31
-class CollectionController extends AbstractController
32
-{
31
+class CollectionController extends AbstractController {
33 32
     /**
34 33
      * @access protected
35 34
      * @var CollectionRepository
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
             $simplePagination = new SimplePagination($solrPaginator);
169 169
 
170 170
             $pagination = $this->buildSimplePagination($simplePagination, $solrPaginator);
171
-            $this->view->assignMultiple([ 'pagination' => $pagination, 'paginator' => $solrPaginator ]);
171
+            $this->view->assignMultiple(['pagination' => $pagination, 'paginator' => $solrPaginator]);
172 172
         }
173 173
 
174 174
         $this->view->assign('viewData', $this->viewData);
@@ -220,9 +220,9 @@  discard block
 block discarded – undo
220 220
         foreach ($collections as $collection) {
221 221
             $solrQuery = '';
222 222
             if ($collection->getIndexSearch() != '') {
223
-                $solrQuery .= '(' . $collection->getIndexSearch() . ')';
223
+                $solrQuery .= '('.$collection->getIndexSearch().')';
224 224
             } else {
225
-                $solrQuery .= 'collection:("' . Solr::escapeQuery($collection->getIndexName()) . '")';
225
+                $solrQuery .= 'collection:("'.Solr::escapeQuery($collection->getIndexName()).'")';
226 226
             }
227 227
 
228 228
             // We only care about the UID and partOf in the results and want them sorted
@@ -236,11 +236,11 @@  discard block
 block discarded – undo
236 236
             if ($collection->getIndexSearch()) {
237 237
                 $params['query'] = $solrQuery;
238 238
             } else {
239
-                $params['query'] = $solrQuery . ' AND partof:0 AND toplevel:true';
239
+                $params['query'] = $solrQuery.' AND partof:0 AND toplevel:true';
240 240
             }
241 241
             $partOfNothing = $solr->searchRaw($params);
242 242
 
243
-            $params['query'] = $solrQuery . ' AND NOT partof:0 AND toplevel:true';
243
+            $params['query'] = $solrQuery.' AND NOT partof:0 AND toplevel:true';
244 244
             $partOfSomething = $solr->searchRaw($params);
245 245
 
246 246
             $collectionInfo = [];
Please login to merge, or discard this patch.
Upper-Lower-Casing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
         }
98 98
 
99 99
         if (count($collections) == 1 && empty($this->settings['dont_show_single']) && is_array($collections)) {
100
-            return $this->redirect('show', null, null, ['collection' => array_pop($collections)]);
100
+            return $this->redirect('show', NULL, NULL, ['collection' => array_pop($collections)]);
101 101
         }
102 102
 
103 103
         $processedCollections = $this->processCollections($collections, $solr);
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
         // If a targetPid is given, the results will be shown by ListView on the target page.
143 143
         if (!empty($this->settings['targetPid'])) {
144 144
             return $this->redirect(
145
-                'main', 'ListView', null,
145
+                'main', 'ListView', NULL,
146 146
                 [
147 147
                     'searchParameter' => $searchParams,
148 148
                     'page' => $currentPage
@@ -151,16 +151,16 @@  discard block
 block discarded – undo
151 151
         }
152 152
 
153 153
         // get all metadata records to be shown in results
154
-        $listedMetadata = $this->metadataRepository->findByIsListed(true);
154
+        $listedMetadata = $this->metadataRepository->findByIsListed(TRUE);
155 155
 
156 156
         // get all indexed metadata fields
157
-        $indexedMetadata = $this->metadataRepository->findByIndexIndexed(true);
157
+        $indexedMetadata = $this->metadataRepository->findByIndexIndexed(TRUE);
158 158
 
159 159
         // get all sortable metadata records
160
-        $sortableMetadata = $this->metadataRepository->findByIsSortable(true);
160
+        $sortableMetadata = $this->metadataRepository->findByIsSortable(TRUE);
161 161
 
162 162
         // get all documents of given collection
163
-        $solrResults = null;
163
+        $solrResults = NULL;
164 164
         if (is_array($searchParams) && !empty($searchParams)) {
165 165
             $solrResults = $this->documentRepository->findSolrByCollection($collection, $this->settings, $searchParams, $listedMetadata, $indexedMetadata);
166 166
 
@@ -198,13 +198,13 @@  discard block
 block discarded – undo
198 198
         // if search was triggered, get search parameters from POST variables
199 199
         $searchParams = $this->getParametersSafely('searchParameter');
200 200
 
201
-        $collection = null;
201
+        $collection = NULL;
202 202
         if ($searchParams['collection']['__identity'] && MathUtility::canBeInterpretedAsInteger($searchParams['collection']['__identity'])) {
203 203
             $collection = $this->collectionRepository->findByUid($searchParams['collection']['__identity']);
204 204
         }
205 205
 
206 206
         // output is done by show action
207
-        return $this->redirect('show', null, null, ['searchParameter' => $searchParams, 'collection' => $collection]);
207
+        return $this->redirect('show', NULL, NULL, ['searchParameter' => $searchParams, 'collection' => $collection]);
208 208
     }
209 209
 
210 210
     /**
Please login to merge, or discard this patch.
Classes/Controller/Backend/NewTenantController.php 3 patches
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -42,8 +42,7 @@
 block discarded – undo
42 42
  *
43 43
  * @access public
44 44
  */
45
-class NewTenantController extends AbstractController
46
-{
45
+class NewTenantController extends AbstractController {
47 46
     /**
48 47
      * @access protected
49 48
      * @var int
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -271,7 +271,7 @@  discard block
 block discarded – undo
271 271
 
272 272
             $data['tx_dlf_metadata'][uniqid('NEW')] = [
273 273
                 'pid' => $this->pid,
274
-                'label' => $this->getLLL('metadata.' . $indexName, $this->siteLanguages[0]->getTypo3Language(), $metadataLabels),
274
+                'label' => $this->getLLL('metadata.'.$indexName, $this->siteLanguages[0]->getTypo3Language(), $metadataLabels),
275 275
                 'index_name' => $indexName,
276 276
                 'format' => implode(',', $formatIds),
277 277
                 'default_value' => $values['default_value'],
@@ -310,7 +310,7 @@  discard block
 block discarded – undo
310 310
                     'pid' => $this->pid,
311 311
                     'sys_language_uid' => $siteLanguage->getLanguageId(),
312 312
                     'l18n_parent' => $id,
313
-                    'label' => $this->getLLL('metadata.' . $indexName, $siteLanguage->getTypo3Language(), $metadataLabels),
313
+                    'label' => $this->getLLL('metadata.'.$indexName, $siteLanguage->getTypo3Language(), $metadataLabels),
314 314
                 ];
315 315
             }
316 316
 
@@ -336,7 +336,7 @@  discard block
 block discarded – undo
336 336
 
337 337
         if ($this->solrCoreRepository->findOneByPid($this->pid) === null) {
338 338
             $newRecord = GeneralUtility::makeInstance(SolrCore::class);
339
-            $newRecord->setLabel($this->getLLL('flexform.solrcore', $this->siteLanguages[0]->getTypo3Language(), $beLabels). ' (PID ' . $this->pid . ')');
339
+            $newRecord->setLabel($this->getLLL('flexform.solrcore', $this->siteLanguages[0]->getTypo3Language(), $beLabels).' (PID '.$this->pid.')');
340 340
             $indexName = Solr::createCore('');
341 341
             if (!empty($indexName)) {
342 342
                 $newRecord->setIndexName($indexName);
@@ -376,7 +376,7 @@  discard block
 block discarded – undo
376 376
             $data['tx_dlf_structures'][uniqid('NEW')] = [
377 377
                 'pid' => $this->pid,
378 378
                 'toplevel' => $values['toplevel'],
379
-                'label' => $this->getLLL('structure.' . $indexName, $this->siteLanguages[0]->getTypo3Language(), $structureLabels),
379
+                'label' => $this->getLLL('structure.'.$indexName, $this->siteLanguages[0]->getTypo3Language(), $structureLabels),
380 380
                 'index_name' => $indexName,
381 381
                 'oai_name' => $values['oai_name'],
382 382
                 'thumbnail' => 0,
@@ -401,7 +401,7 @@  discard block
 block discarded – undo
401 401
                     'pid' => $this->pid,
402 402
                     'sys_language_uid' => $siteLanguage->getLanguageId(),
403 403
                     'l18n_parent' => $id,
404
-                    'label' => $this->getLLL('structure.' . $indexName, $siteLanguage->getTypo3Language(), $structureLabels),
404
+                    'label' => $this->getLLL('structure.'.$indexName, $siteLanguage->getTypo3Language(), $structureLabels),
405 405
                 ];
406 406
             }
407 407
 
@@ -478,7 +478,7 @@  discard block
 block discarded – undo
478 478
         } elseif (isset($langArray['default'][$index][0]['target'])) {
479 479
             return $langArray['default'][$index][0]['target'];
480 480
         } else {
481
-            return 'Missing translation for ' . $index;
481
+            return 'Missing translation for '.$index;
482 482
         }
483 483
     }
484 484
 
@@ -493,7 +493,7 @@  discard block
 block discarded – undo
493 493
      */
494 494
     private function getRecords(string $recordType): array
495 495
     {
496
-        $filePath = GeneralUtility::getFileAbsFileName('EXT:dlf/Resources/Private/Data/' . $recordType . 'Defaults.json');
496
+        $filePath = GeneralUtility::getFileAbsFileName('EXT:dlf/Resources/Private/Data/'.$recordType.'Defaults.json');
497 497
         if (file_exists($filePath)) {
498 498
             $fileContents = file_get_contents($filePath);
499 499
             $records = json_decode($fileContents, true);
Please login to merge, or discard this patch.
Upper-Lower-Casing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
      * 
153 153
      * @return ResponseInterface the response
154 154
      */
155
-    protected function htmlResponse(?string $html = null): ResponseInterface
155
+    protected function htmlResponse(?string $html = NULL): ResponseInterface
156 156
     {
157 157
         $flashMessageService = GeneralUtility::makeInstance(FlashMessageService::class);
158 158
         $messageQueue = $flashMessageService->getMessageQueueByIdentifier();
@@ -208,11 +208,11 @@  discard block
 block discarded – undo
208 208
         $frameworkConfiguration['persistence']['storagePid'] = 0;
209 209
         $this->configurationManager->setConfiguration($frameworkConfiguration);
210 210
 
211
-        $doPersist = false;
211
+        $doPersist = FALSE;
212 212
 
213 213
         foreach ($formatsDefaults as $type => $values) {
214 214
             // if default format record is not found, add it to the repository
215
-            if ($this->formatRepository->findOneByType($type) === null) {
215
+            if ($this->formatRepository->findOneByType($type) === NULL) {
216 216
                 $newRecord = GeneralUtility::makeInstance(Format::class);
217 217
                 $newRecord->setType($type);
218 218
                 $newRecord->setRoot($values['root']);
@@ -220,12 +220,12 @@  discard block
 block discarded – undo
220 220
                 $newRecord->setClass($values['class']);
221 221
                 $this->formatRepository->add($newRecord);
222 222
 
223
-                $doPersist = true;
223
+                $doPersist = TRUE;
224 224
             }
225 225
         }
226 226
 
227 227
         // We must persist here, if we changed anything.
228
-        if ($doPersist === true) {
228
+        if ($doPersist === TRUE) {
229 229
             $persistenceManager = GeneralUtility::makeInstance(PersistenceManager::class);
230 230
             $persistenceManager->persistAll();
231 231
         }
@@ -287,13 +287,13 @@  discard block
 block discarded – undo
287 287
             ];
288 288
         }
289 289
 
290
-        $metadataIds = Helper::processDatabaseAsAdmin($data, [], true);
290
+        $metadataIds = Helper::processDatabaseAsAdmin($data, [], TRUE);
291 291
 
292 292
         $insertedMetadata = [];
293 293
         foreach ($metadataIds as $id => $uid) {
294 294
             $metadata = $this->metadataRepository->findByUid($uid);
295 295
             // id array contains also ids of formats
296
-            if ($metadata != null) {
296
+            if ($metadata != NULL) {
297 297
                 $insertedMetadata[$uid] = $metadata->getIndexName();
298 298
             }
299 299
         }
@@ -329,12 +329,12 @@  discard block
 block discarded – undo
329 329
      */
330 330
     public function addSolrCoreAction(): ResponseInterface
331 331
     {
332
-        $doPersist = false;
332
+        $doPersist = FALSE;
333 333
 
334 334
         // load language file in own array
335 335
         $beLabels = $this->languageFactory->getParsedData('EXT:dlf/Resources/Private/Language/locallang_be.xlf', $this->siteLanguages[0]->getTypo3Language());
336 336
 
337
-        if ($this->solrCoreRepository->findOneByPid($this->pid) === null) {
337
+        if ($this->solrCoreRepository->findOneByPid($this->pid) === NULL) {
338 338
             $newRecord = GeneralUtility::makeInstance(SolrCore::class);
339 339
             $newRecord->setLabel($this->getLLL('flexform.solrcore', $this->siteLanguages[0]->getTypo3Language(), $beLabels). ' (PID ' . $this->pid . ')');
340 340
             $indexName = Solr::createCore('');
@@ -343,12 +343,12 @@  discard block
 block discarded – undo
343 343
 
344 344
                 $this->solrCoreRepository->add($newRecord);
345 345
 
346
-                $doPersist = true;
346
+                $doPersist = TRUE;
347 347
             }
348 348
         }
349 349
 
350 350
         // We must persist here, if we changed anything.
351
-        if ($doPersist === true) {
351
+        if ($doPersist === TRUE) {
352 352
             $persistenceManager = GeneralUtility::makeInstance(PersistenceManager::class);
353 353
             $persistenceManager->persistAll();
354 354
         }
@@ -382,7 +382,7 @@  discard block
 block discarded – undo
382 382
                 'thumbnail' => 0,
383 383
             ];
384 384
         }
385
-        $structureIds = Helper::processDatabaseAsAdmin($data, [], true);
385
+        $structureIds = Helper::processDatabaseAsAdmin($data, [], TRUE);
386 386
 
387 387
         $insertedStructures = [];
388 388
         foreach ($structureIds as $id => $uid) {
@@ -496,7 +496,7 @@  discard block
 block discarded – undo
496 496
         $filePath = GeneralUtility::getFileAbsFileName('EXT:dlf/Resources/Private/Data/' . $recordType . 'Defaults.json');
497 497
         if (file_exists($filePath)) {
498 498
             $fileContents = file_get_contents($filePath);
499
-            $records = json_decode($fileContents, true);
499
+            $records = json_decode($fileContents, TRUE);
500 500
 
501 501
             if (json_last_error() === JSON_ERROR_NONE) {
502 502
                 return $records;
Please login to merge, or discard this patch.
Classes/Controller/SearchController.php 3 patches
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -33,8 +33,7 @@
 block discarded – undo
33 33
  *
34 34
  * @access public
35 35
  */
36
-class SearchController extends AbstractController
37
-{
36
+class SearchController extends AbstractController {
38 37
     /**
39 38
      * @access protected
40 39
      * @var CollectionRepository
Please login to merge, or discard this patch.
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
         }
123 123
 
124 124
         if (isset($listRequestData['searchParameter']) && is_array($listRequestData['searchParameter'])) {
125
-            $this->searchParams = array_merge($this->searchParams ?: [], $listRequestData['searchParameter']);
125
+            $this->searchParams = array_merge($this->searchParams ? : [], $listRequestData['searchParameter']);
126 126
             $listViewSearch = true;
127 127
             $GLOBALS['TSFE']->fe_user->setKey('ses', 'search', $this->searchParams);
128 128
         }
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
                 $simplePagination = new SimplePagination($solrPaginator);
184 184
 
185 185
                 $pagination = $this->buildSimplePagination($simplePagination, $solrPaginator);
186
-                $this->view->assignMultiple([ 'pagination' => $pagination, 'paginator' => $solrPaginator ]);
186
+                $this->view->assignMultiple(['pagination' => $pagination, 'paginator' => $solrPaginator]);
187 187
             }
188 188
 
189 189
             $this->view->assign('documents', !empty($solrResults) ? $solrResults : []);
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
 
209 209
         // Add uHash parameter to suggest parameter to make a basic protection of this form.
210 210
         if ($this->settings['suggest']) {
211
-            $this->view->assign('uHash', GeneralUtility::hmac((string) (new Typo3Version()) . Environment::getExtensionsPath(), 'SearchSuggest'));
211
+            $this->view->assign('uHash', GeneralUtility::hmac((string) (new Typo3Version()).Environment::getExtensionsPath(), 'SearchSuggest'));
212 212
         }
213 213
 
214 214
         $this->view->assign('viewData', $this->viewData);
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
         // Get facets from plugin configuration.
230 230
         $facets = [];
231 231
         foreach (GeneralUtility::trimExplode(',', $this->settings['facets'], true) as $facet) {
232
-            $facets[$facet . '_faceting'] = Helper::translate($facet, 'tx_dlf_metadata', $this->settings['storagePid']);
232
+            $facets[$facet.'_faceting'] = Helper::translate($facet, 'tx_dlf_metadata', $this->settings['storagePid']);
233 233
         }
234 234
 
235 235
         $this->view->assign('facetsMenu', $this->makeFacetsMenuArray($facets));
@@ -265,13 +265,13 @@  discard block
 block discarded – undo
265 265
         $searchParams = $this->searchParams;
266 266
         if (
267 267
             (!empty($searchParams['fulltext']))
268
-            || preg_match('/' . $fields['fulltext'] . ':\((.*)\)/', trim($searchParams['query']), $matches)
268
+            || preg_match('/'.$fields['fulltext'].':\((.*)\)/', trim($searchParams['query']), $matches)
269 269
         ) {
270 270
             // If the query already is a fulltext query e.g using the facets
271 271
             $searchParams['query'] = empty($matches[1]) ? $searchParams['query'] : $matches[1];
272 272
             // Search in fulltext field if applicable. Query must not be empty!
273 273
             if (!empty($searchParams['query'])) {
274
-                $search['query'] = $fields['fulltext'] . ':(' . Solr::escapeQuery(trim($searchParams['query'])) . ')';
274
+                $search['query'] = $fields['fulltext'].':('.Solr::escapeQuery(trim($searchParams['query'])).')';
275 275
             }
276 276
         } else {
277 277
             // Retain given search field if valid.
@@ -288,7 +288,7 @@  discard block
 block discarded – undo
288 288
         // add filter query for date search
289 289
         if (!empty($this->searchParams['dateFrom']) && !empty($this->searchParams['dateTo'])) {
290 290
             // combine dateFrom and dateTo into filterquery as range search
291
-            $search['params']['filterquery'][]['query'] = '{!join from=' . $fields['uid'] . ' to=' . $fields['uid'] . '}' . $fields['date'] . ':[' . $this->searchParams['dateFrom'] . ' TO ' . $this->searchParams['dateTo'] . ']';
291
+            $search['params']['filterquery'][]['query'] = '{!join from='.$fields['uid'].' to='.$fields['uid'].'}'.$fields['date'].':['.$this->searchParams['dateFrom'].' TO '.$this->searchParams['dateTo'].']';
292 292
         }
293 293
 
294 294
         // Add extended search query.
@@ -306,9 +306,9 @@  discard block
 block discarded – undo
306 306
                         in_array($searchParams['extOperator'][$i], $allowedOperators)
307 307
                     ) {
308 308
                         if (!empty($search['query'])) {
309
-                            $search['query'] .= ' ' . $searchParams['extOperator'][$i] . ' ';
309
+                            $search['query'] .= ' '.$searchParams['extOperator'][$i].' ';
310 310
                         }
311
-                        $search['query'] .= Indexer::getIndexFieldName($searchParams['extField'][$i], $this->settings['storagePid']) . ':(' . Solr::escapeQuery($searchParams['extQuery'][$i]) . ')';
311
+                        $search['query'] .= Indexer::getIndexFieldName($searchParams['extField'][$i], $this->settings['storagePid']).':('.Solr::escapeQuery($searchParams['extQuery'][$i]).')';
312 312
                     }
313 313
                 }
314 314
             }
@@ -397,24 +397,24 @@  discard block
 block discarded – undo
397 397
             foreach ($collections as $collectionEntry) {
398 398
                 // check for virtual collections query string
399 399
                 if ($collectionEntry->getIndexSearch()) {
400
-                    $virtualCollectionsQueryString .= empty($virtualCollectionsQueryString) ? '(' . $collectionEntry->getIndexSearch() . ')' : ' OR (' . $collectionEntry->getIndexSearch() . ')';
400
+                    $virtualCollectionsQueryString .= empty($virtualCollectionsQueryString) ? '('.$collectionEntry->getIndexSearch().')' : ' OR ('.$collectionEntry->getIndexSearch().')';
401 401
                 } else {
402
-                    $collectionsQueryString .= empty($collectionsQueryString) ? '"' . $collectionEntry->getIndexName() . '"' : ' OR "' . $collectionEntry->getIndexName() . '"';
402
+                    $collectionsQueryString .= empty($collectionsQueryString) ? '"'.$collectionEntry->getIndexName().'"' : ' OR "'.$collectionEntry->getIndexName().'"';
403 403
                 }
404 404
             }
405 405
 
406 406
             // distinguish between simple collection browsing and actual searching within the collection(s)
407 407
             if (!empty($collectionsQueryString)) {
408 408
                 if (empty($query)) {
409
-                    $collectionsQueryString = '(collection_faceting:(' . $collectionsQueryString . ') AND toplevel:true AND partof:0)';
409
+                    $collectionsQueryString = '(collection_faceting:('.$collectionsQueryString.') AND toplevel:true AND partof:0)';
410 410
                 } else {
411
-                    $collectionsQueryString = '(collection_faceting:(' . $collectionsQueryString . '))';
411
+                    $collectionsQueryString = '(collection_faceting:('.$collectionsQueryString.'))';
412 412
                 }
413 413
             }
414 414
 
415 415
             // virtual collections might query documents that are neither toplevel:true nor partof:0 and need to be searched separately
416 416
             if (!empty($virtualCollectionsQueryString)) {
417
-                $virtualCollectionsQueryString = '(' . $virtualCollectionsQueryString . ')';
417
+                $virtualCollectionsQueryString = '('.$virtualCollectionsQueryString.')';
418 418
             }
419 419
 
420 420
             // combine both querystrings into a single filterquery via OR if both are given, otherwise pass either of those
@@ -444,7 +444,7 @@  discard block
 block discarded – undo
444 444
         $entryArray['doNotLinkIt'] = 0;
445 445
         // Check if facet is already selected.
446 446
         $queryColumn = array_column($search['params']['filterquery'], 'query');
447
-        $index = array_search($field . ':("' . Solr::escapeQuery($value) . '")', $queryColumn);
447
+        $index = array_search($field.':("'.Solr::escapeQuery($value).'")', $queryColumn);
448 448
         if ($index !== false) {
449 449
             // Facet is selected, thus remove it from filter.
450 450
             unset($queryColumn[$index]);
@@ -458,7 +458,7 @@  discard block
 block discarded – undo
458 458
             }
459 459
         } else {
460 460
             // Facet is not selected, thus add it to filter.
461
-            $queryColumn[] = $field . ':("' . Solr::escapeQuery($value) . '")';
461
+            $queryColumn[] = $field.':("'.Solr::escapeQuery($value).'")';
462 462
             $entryArray['ITEM_STATE'] = 'NO';
463 463
         }
464 464
         $entryArray['queryColumn'] = $queryColumn;
Please login to merge, or discard this patch.
Upper-Lower-Casing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
         $this->searchParams = $this->getParametersSafely('searchParameter');
93 93
 
94 94
         // output is done by main action
95
-        return $this->redirect('main', null, null, ['searchParameter' => $this->searchParams]);
95
+        return $this->redirect('main', NULL, NULL, ['searchParameter' => $this->searchParams]);
96 96
     }
97 97
 
98 98
     /**
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
      */
107 107
     public function mainAction(): ResponseInterface
108 108
     {
109
-        $listViewSearch = false;
109
+        $listViewSearch = FALSE;
110 110
         // Quit without doing anything if required variables are not set.
111 111
         if (empty($this->settings['solrcore'])) {
112 112
             $this->logger->warning('Incomplete plugin configuration');
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
 
127 127
         if (isset($listRequestData['searchParameter']) && is_array($listRequestData['searchParameter'])) {
128 128
             $this->searchParams = array_merge($this->searchParams ?: [], $listRequestData['searchParameter']);
129
-            $listViewSearch = true;
129
+            $listViewSearch = TRUE;
130 130
             $GLOBALS['TSFE']->fe_user->setKey('ses', 'search', $this->searchParams);
131 131
         }
132 132
 
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
             return $this->redirect(
159 159
                 'main',
160 160
                 'ListView',
161
-                null,
161
+                NULL,
162 162
                 [
163 163
                     'searchParameter' => $this->searchParams,
164 164
                     'page' => $currentPage
@@ -170,15 +170,15 @@  discard block
 block discarded – undo
170 170
         // An empty form will be shown.
171 171
         if (is_array($this->searchParams) && !empty($this->searchParams)) {
172 172
             // get all sortable metadata records
173
-            $sortableMetadata = $this->metadataRepository->findByIsSortable(true);
173
+            $sortableMetadata = $this->metadataRepository->findByIsSortable(TRUE);
174 174
 
175 175
             // get all metadata records to be shown in results
176
-            $listedMetadata = $this->metadataRepository->findByIsListed(true);
176
+            $listedMetadata = $this->metadataRepository->findByIsListed(TRUE);
177 177
 
178 178
             // get all indexed metadata fields
179
-            $indexedMetadata = $this->metadataRepository->findByIndexIndexed(true);
179
+            $indexedMetadata = $this->metadataRepository->findByIndexIndexed(TRUE);
180 180
 
181
-            $solrResults = null;
181
+            $solrResults = NULL;
182 182
             $numResults = 0;
183 183
             // Do not execute the Solr search if used together with ListView plugin.
184 184
             if (!$listViewSearch) {
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
 
241 241
         // Get facets from plugin configuration.
242 242
         $facets = [];
243
-        foreach (GeneralUtility::trimExplode(',', $this->settings['facets'], true) as $facet) {
243
+        foreach (GeneralUtility::trimExplode(',', $this->settings['facets'], TRUE) as $facet) {
244 244
             $facets[$facet . '_faceting'] = Helper::translate($facet, 'tx_dlf_metadata', $this->settings['storagePid']);
245 245
         }
246 246
 
@@ -397,7 +397,7 @@  discard block
 block discarded – undo
397 397
     {
398 398
         // if collections are given, we prepare the collections query string
399 399
         // extract collections from collection parameter
400
-        $collections = null;
400
+        $collections = NULL;
401 401
         if (array_key_exists('collection', $this->searchParams)) {
402 402
             foreach (explode(',', $this->searchParams['collection']) as $collectionEntry) {
403 403
                 if (!empty($collectionEntry)) {
@@ -459,7 +459,7 @@  discard block
 block discarded – undo
459 459
         // Check if facet is already selected.
460 460
         $queryColumn = array_column($search['params']['filterquery'], 'query');
461 461
         $index = array_search($field . ':("' . Solr::escapeQuery($value) . '")', $queryColumn);
462
-        if ($index !== false) {
462
+        if ($index !== FALSE) {
463 463
             // Facet is selected, thus remove it from filter.
464 464
             unset($queryColumn[$index]);
465 465
             $queryColumn = array_values($queryColumn);
@@ -467,7 +467,7 @@  discard block
 block discarded – undo
467 467
             $state = 'ACTIFSUB';
468 468
             // Reset facets
469 469
             if ($this->settings['resetFacets']) {
470
-                $entryArray['resetFacet'] = true;
470
+                $entryArray['resetFacet'] = TRUE;
471 471
                 $entryArray['queryColumn'] = $queryColumn;
472 472
             }
473 473
         } else {
@@ -578,7 +578,7 @@  discard block
 block discarded – undo
578 578
         }
579 579
 
580 580
         // Get field selector options.
581
-        $searchFields = GeneralUtility::trimExplode(',', $this->settings['extendedFields'], true);
581
+        $searchFields = GeneralUtility::trimExplode(',', $this->settings['extendedFields'], TRUE);
582 582
 
583 583
         $slotCountArray = [];
584 584
         for ($i = 0; $i < $this->settings['extendedSlotCount']; $i++) {
Please login to merge, or discard this patch.