Passed
Pull Request — master (#123)
by
unknown
04:15
created
Classes/Updates/MigrateSettings.php 1 patch
Upper-Lower-Casing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -108,11 +108,11 @@  discard block
 block discarded – undo
108 108
 
109 109
             // exit if at least one update statement is not successful
110 110
             if (!((bool) $updateResult)) {
111
-                return false;
111
+                return FALSE;
112 112
             }
113 113
         }
114 114
 
115
-        return true;
115
+        return TRUE;
116 116
     }
117 117
 
118 118
     /**
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
      */
127 127
     public function updateNecessary(): bool
128 128
     {
129
-        $oldSettingsFound = false;
129
+        $oldSettingsFound = FALSE;
130 130
 
131 131
         $connection = GeneralUtility::makeInstance(ConnectionPool::class)->getConnectionForTable('tt_content');
132 132
 
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
         // Update the found record sets
145 145
         while ($record = $statement->fetchAssociative()) {
146 146
             $oldSettingsFound = $this->checkForOldSettings($record['pi_flexform']);
147
-            if ($oldSettingsFound === true) {
147
+            if ($oldSettingsFound === TRUE) {
148 148
                 // We found at least one field to be updated --> break here
149 149
                 break;
150 150
             }
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
 
188 188
         foreach ($fields as $field) {
189 189
             // change the index attribute if it doesn't start with 'settings.' yet
190
-            if (strpos($field['index'], 'settings.') === false) {
190
+            if (strpos($field['index'], 'settings.') === FALSE) {
191 191
                 $field['index'] = 'settings.' . $field['index'];
192 192
             }
193 193
         }
Please login to merge, or discard this patch.
Classes/Updates/FileLocationUpdater.php 1 patch
Upper-Lower-Casing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -105,11 +105,11 @@  discard block
 block discarded – undo
105 105
     public function updateNecessary(): bool
106 106
     {
107 107
         /** @var int */
108
-        $numRecords = $this->getRecordsFromTable(true);
108
+        $numRecords = $this->getRecordsFromTable(TRUE);
109 109
         if ($numRecords > 0) {
110
-            return true;
110
+            return TRUE;
111 111
         }
112
-        return false;
112
+        return FALSE;
113 113
     }
114 114
 
115 115
     /**
@@ -145,16 +145,16 @@  discard block
 block discarded – undo
145 145
      */
146 146
     public function executeUpdate(): bool
147 147
     {
148
-        $result = true;
148
+        $result = TRUE;
149 149
         try {
150 150
             /** @var int */
151
-            $numRecords = $this->getRecordsFromTable(true);
151
+            $numRecords = $this->getRecordsFromTable(TRUE);
152 152
             if ($numRecords > 0) {
153 153
                 $this->performUpdate();
154 154
             }
155 155
         } catch (\Exception $e) {
156 156
             // If something goes wrong, migrateField() logs an error
157
-            $result = false;
157
+            $result = FALSE;
158 158
         }
159 159
         return $result;
160 160
     }
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
      *
172 172
      * @throws \RuntimeException
173 173
      */
174
-    protected function getRecordsFromTable(bool $countOnly = false)
174
+    protected function getRecordsFromTable(bool $countOnly = FALSE)
175 175
     {
176 176
         $connectionPool = GeneralUtility::makeInstance(ConnectionPool::class);
177 177
         $allResults = [];
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
                     ->orderBy('uid')
199 199
                     ->execute()
200 200
                     ->fetchAllAssociative();
201
-                if ($countOnly === true) {
201
+                if ($countOnly === TRUE) {
202 202
                     $numResults += count($result);
203 203
                 } else {
204 204
                     $allResults[$table] = $result;
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
             }
212 212
         }
213 213
 
214
-        if ($countOnly === true) {
214
+        if ($countOnly === TRUE) {
215 215
             return $numResults;
216 216
         } else {
217 217
             return $allResults;
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
      */
229 229
     protected function performUpdate(): bool
230 230
     {
231
-        $result = true;
231
+        $result = TRUE;
232 232
 
233 233
         try {
234 234
             $storages = GeneralUtility::makeInstance(StorageRepository::class)->findAll();
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
                 }
242 242
             }
243 243
         } catch (\Exception $e) {
244
-            $result = false;
244
+            $result = FALSE;
245 245
         }
246 246
 
247 247
         return $result;
@@ -270,7 +270,7 @@  discard block
 block discarded – undo
270 270
         $storageUid = (int) $this->storage->getUid();
271 271
         $connectionPool = GeneralUtility::makeInstance(ConnectionPool::class);
272 272
 
273
-        $fileUid = null;
273
+        $fileUid = NULL;
274 274
         $sourcePath = Environment::getPublicPath() . '/' . $fieldItem;
275 275
 
276 276
         // maybe the file was already moved, so check if the original file still exists
Please login to merge, or discard this patch.
Classes/Pagination/PageGridPagination.php 1 patch
Upper-Lower-Casing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -36,12 +36,12 @@  discard block
 block discarded – undo
36 36
         $previousPage = (int) (($this->paginator->getCurrentPageNumber() - 1) * $this->paginator->getPublicItemsPerPage()) - ($this->paginator->getPublicItemsPerPage() - 1);
37 37
 
38 38
         if ($previousPage > $this->paginator->getNumberOfPages()) {
39
-            return null;
39
+            return NULL;
40 40
         }
41 41
 
42 42
         return $previousPage >= $this->getFirstPageNumber()
43 43
             ? $previousPage
44
-            : null
44
+            : NULL
45 45
             ;
46 46
     }
47 47
 
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
 
52 52
         return $nextPage <= $this->paginator->getNumberOfPages()
53 53
             ? $nextPage
54
-            : null
54
+            : NULL
55 55
             ;
56 56
     }
57 57
 
Please login to merge, or discard this patch.
Classes/Controller/OaiPmhController.php 1 patch
Upper-Lower-Casing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
      */
242 242
     protected function getMetsData(array $record)
243 243
     {
244
-        $mets = null;
244
+        $mets = NULL;
245 245
         // Load METS file.
246 246
         $xml = new \DOMDocument();
247 247
         if ($xml->load($record['location'])) {
@@ -322,7 +322,7 @@  discard block
 block discarded – undo
322 322
         } else {
323 323
             // No resumption token found or resumption token expired.
324 324
             $this->error = 'badResumptionToken';
325
-            return null;
325
+            return NULL;
326 326
         }
327 327
     }
328 328
 
@@ -583,7 +583,7 @@  discard block
 block discarded – undo
583 583
     protected function verbListSets()
584 584
     {
585 585
         // It is required to set a oai_name inside the collection record to be shown in oai-pmh plugin.
586
-        $this->settings['hideEmptyOaiNames'] = true;
586
+        $this->settings['hideEmptyOaiNames'] = TRUE;
587 587
 
588 588
         $oaiSets = $this->collectionRepository->findCollectionsBySettings($this->settings);
589 589
 
@@ -844,7 +844,7 @@  discard block
 block discarded – undo
844 844
         $currentCursor = $documentListSet['metadata']['cursor'];
845 845
 
846 846
         if (count($documentListSet['elements']) !== 0) {
847
-            $resumptionToken = uniqid('', false);
847
+            $resumptionToken = uniqid('', FALSE);
848 848
 
849 849
             $documentListSet['metadata']['cursor'] += $numShownDocuments;
850 850
 
Please login to merge, or discard this patch.
Classes/Controller/MetadataController.php 1 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.
Classes/Controller/TableOfContentsController.php 1 patch
Upper-Lower-Casing   +6 added lines, -6 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
 
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
         }
176 176
         // Build sub-menu if available and called recursively.
177 177
         if (
178
-            $recursive === true
178
+            $recursive === TRUE
179 179
             && !empty($entry['children'])
180 180
         ) {
181 181
             // Build sub-menu only if one of the following conditions apply:
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
                     if (in_array($child['id'], $this->activeEntries)) {
194 194
                         $entryArray['ITEM_STATE'] = 'ACT';
195 195
                     }
196
-                    $entryArray['_SUB_MENU'][] = $this->getMenuEntry($child, true);
196
+                    $entryArray['_SUB_MENU'][] = $this->getMenuEntry($child, TRUE);
197 197
                 }
198 198
             }
199 199
             // Append "IFSUB" to "ITEM_STATE" if this entry has sub-entries.
Please login to merge, or discard this patch.
Classes/Controller/FeedsController.php 1 patch
Upper-Lower-Casing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
             || GeneralUtility::inList($this->settings['collections'], $requestData['collection'])
85 85
         ) {
86 86
 
87
-            $documents = $this->documentRepository->findAllByCollectionsLimited(GeneralUtility::intExplode(',', $requestData['collection'], true), $this->settings['limit']);
87
+            $documents = $this->documentRepository->findAllByCollectionsLimited(GeneralUtility::intExplode(',', $requestData['collection'], TRUE), $this->settings['limit']);
88 88
 
89 89
             foreach ($documents as $document) {
90 90
 
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
                 if ((empty($document->getTitle()) || !empty($this->settings['prependSuperiorTitle']))
94 94
                     && !empty($document->getPartof())
95 95
                 ) {
96
-                    $superiorTitle = AbstractDocument::getTitle($document->getPartof(), true);
96
+                    $superiorTitle = AbstractDocument::getTitle($document->getPartof(), TRUE);
97 97
                     if (!empty($superiorTitle)) {
98 98
                         $title .= '[' . $superiorTitle . ']';
99 99
                     }
Please login to merge, or discard this patch.
Classes/Controller/CalendarController.php 1 patch
Upper-Lower-Casing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -82,9 +82,9 @@  discard block
 block discarded – undo
82 82
         switch ($type) {
83 83
             case 'newspaper':
84 84
             case 'ephemera':
85
-                $this->forward('years', null, null, $this->requestData);
85
+                $this->forward('years', NULL, NULL, $this->requestData);
86 86
             case 'year':
87
-                $this->forward('calendar', null, null, $this->requestData);
87
+                $this->forward('calendar', NULL, NULL, $this->requestData);
88 88
             case 'issue':
89 89
             default:
90 90
                 break;
@@ -440,7 +440,7 @@  discard block
 block discarded – undo
440 440
 
441 441
         foreach ($this->getIssues() as $issue) {
442 442
             $dateTimestamp = strtotime($issue['year']);
443
-            if ($dateTimestamp !== false) {
443
+            if ($dateTimestamp !== FALSE) {
444 444
                 $_year = date('Y', $dateTimestamp);
445 445
                 $_month = date('n', $dateTimestamp);
446 446
                 $_day = date('j', $dateTimestamp);
@@ -490,7 +490,7 @@  discard block
 block discarded – undo
490 490
                 foreach ($month['children'] as $day) {
491 491
                     foreach ($day['children'] as $issue) {
492 492
                         $title = $issue['label'] ?: $issue['orderlabel'];
493
-                        if (strtotime($title) !== false) {
493
+                        if (strtotime($title) !== FALSE) {
494 494
                             $title = strftime('%x', strtotime($title));
495 495
                         }
496 496
 
@@ -523,7 +523,7 @@  discard block
 block discarded – undo
523 523
                 $title = $document->getTitle();
524 524
             } else {
525 525
                 $title = !empty($document->getMetsLabel()) ? $document->getMetsLabel() : $document->getMetsOrderlabel();
526
-                if (strtotime($title) !== false) {
526
+                if (strtotime($title) !== FALSE) {
527 527
                     $title = strftime('%x', strtotime($title));
528 528
                 }
529 529
             }
Please login to merge, or discard this patch.
Classes/Controller/BasketController.php 1 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.