Passed
Pull Request — master (#123)
by Sebastian
04:18
created
Classes/Api/Orcid/Client.php 1 patch
Upper-Lower-Casing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -60,14 +60,14 @@  discard block
 block discarded – undo
60 60
      *
61 61
      * @var string
62 62
      **/
63
-    private $orcid = null;
63
+    private $orcid = NULL;
64 64
 
65 65
     /**
66 66
      * The request object
67 67
      *
68 68
      * @var RequestFactoryInterface
69 69
      **/
70
-    private $requestFactory = null;
70
+    private $requestFactory = NULL;
71 71
 
72 72
     /**
73 73
      * Constructs a new instance
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
             $response = $this->requestFactory->request($url);
103 103
         } catch (\Exception $e) {
104 104
             $this->logger->warning('Could not fetch data from URL "' . $url . '". Error: ' . $e->getMessage() . '.');
105
-            return false;
105
+            return FALSE;
106 106
         }
107 107
         return $response->getBody()->getContents();
108 108
     }
Please login to merge, or discard this patch.
Classes/Common/Indexer.php 1 patch
Upper-Lower-Casing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
      * @var bool
67 67
      * @access protected
68 68
      */
69
-    protected static $fieldsLoaded = false;
69
+    protected static $fieldsLoaded = FALSE;
70 70
 
71 71
     /**
72 72
      * List of already processed documents
@@ -96,9 +96,9 @@  discard block
 block discarded – undo
96 96
     public static function add(Document $document)
97 97
     {
98 98
         if (in_array($document->getUid(), self::$processedDocs)) {
99
-            return true;
99
+            return TRUE;
100 100
         } elseif (self::solrConnect($document->getSolrcore(), $document->getPid())) {
101
-            $success = true;
101
+            $success = TRUE;
102 102
             Helper::getLanguageService()->includeLLFile('EXT:dlf/Resources/Private/Language/locallang_be.xlf');
103 103
             // Handle multi-volume documents.
104 104
             if ($parentId = $document->getPartof()) {
@@ -110,13 +110,13 @@  discard block
 block discarded – undo
110 110
                 $parent = $documentRepository->findByUid($parentId);
111 111
                 if ($parent) {
112 112
                     // get XML document of parent
113
-                    $doc = Doc::getInstance($parent->getLocation(), ['storagePid' => $parent->getPid()], true);
114
-                    if ($doc !== null) {
113
+                    $doc = Doc::getInstance($parent->getLocation(), ['storagePid' => $parent->getPid()], TRUE);
114
+                    if ($doc !== NULL) {
115 115
                         $parent->setDoc($doc);
116 116
                         $success = self::add($parent);
117 117
                     } else {
118 118
                         Helper::log('Could not load parent document with UID ' . $document->getDoc()->parentId, LOG_SEVERITY_ERROR);
119
-                        return false;
119
+                        return FALSE;
120 120
                     }
121 121
                 }
122 122
             }
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
                             sprintf(Helper::getLanguageService()->getLL('flash.documentIndexed'), $document->getTitle(), $document->getUid()),
158 158
                             Helper::getLanguageService()->getLL('flash.done'),
159 159
                             FlashMessage::OK,
160
-                            true,
160
+                            TRUE,
161 161
                             'core.template.flashMessages'
162 162
                         );
163 163
                     } else {
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
                             sprintf(Helper::getLanguageService()->getLL('flash.documentNotIndexed'), $document->getTitle(), $document->getUid()),
166 166
                             Helper::getLanguageService()->getLL('flash.error'),
167 167
                             FlashMessage::ERROR,
168
-                            true,
168
+                            TRUE,
169 169
                             'core.template.flashMessages'
170 170
                         );
171 171
                     }
@@ -177,12 +177,12 @@  discard block
 block discarded – undo
177 177
                         Helper::getLanguageService()->getLL('flash.solrException') . ' ' . htmlspecialchars($e->getMessage()),
178 178
                         Helper::getLanguageService()->getLL('flash.error'),
179 179
                         FlashMessage::ERROR,
180
-                        true,
180
+                        TRUE,
181 181
                         'core.template.flashMessages'
182 182
                     );
183 183
                 }
184 184
                 Helper::log('Apache Solr threw exception: "' . $e->getMessage() . '"', LOG_SEVERITY_ERROR);
185
-                return false;
185
+                return FALSE;
186 186
             }
187 187
         } else {
188 188
             if (!(\TYPO3_REQUESTTYPE & \TYPO3_REQUESTTYPE_CLI)) {
@@ -190,12 +190,12 @@  discard block
 block discarded – undo
190 190
                     Helper::getLanguageService()->getLL('flash.solrNoConnection'),
191 191
                     Helper::getLanguageService()->getLL('flash.warning'),
192 192
                     FlashMessage::WARNING,
193
-                    true,
193
+                    TRUE,
194 194
                     'core.template.flashMessages'
195 195
                 );
196 196
             }
197 197
             Helper::log('Could not connect to Apache Solr server', LOG_SEVERITY_ERROR);
198
-            return false;
198
+            return FALSE;
199 199
         }
200 200
     }
201 201
 
@@ -290,10 +290,10 @@  discard block
 block discarded – undo
290 290
                 if ($indexing['index_boost'] > 0.0) {
291 291
                     self::$fields['fieldboost'][$indexing['index_name']] = floatval($indexing['index_boost']);
292 292
                 } else {
293
-                    self::$fields['fieldboost'][$indexing['index_name']] = false;
293
+                    self::$fields['fieldboost'][$indexing['index_name']] = FALSE;
294 294
                 }
295 295
             }
296
-            self::$fieldsLoaded = true;
296
+            self::$fieldsLoaded = TRUE;
297 297
         }
298 298
     }
299 299
 
@@ -309,7 +309,7 @@  discard block
 block discarded – undo
309 309
      */
310 310
     protected static function processLogical(Document $document, array $logicalUnit)
311 311
     {
312
-        $success = true;
312
+        $success = TRUE;
313 313
         $doc = $document->getDoc();
314 314
         $doc->cPid = $document->getPid();
315 315
         // Get metadata for logical unit.
@@ -333,7 +333,7 @@  discard block
 block discarded – undo
333 333
                 $solrDoc->setField('thumbnail', $doc->getFileLocation($logicalUnit['thumbnailId']));
334 334
             }
335 335
             // There can be only one toplevel unit per UID, independently of backend configuration
336
-            $solrDoc->setField('toplevel', $logicalUnit['id'] == $doc->toplevelId ? true : false);
336
+            $solrDoc->setField('toplevel', $logicalUnit['id'] == $doc->toplevelId ? TRUE : FALSE);
337 337
             $solrDoc->setField('title', $metadata['title'][0], self::$fields['fieldboost']['title']);
338 338
             $solrDoc->setField('volume', $metadata['volume'][0], self::$fields['fieldboost']['volume']);
339 339
             // verify date formatting
@@ -406,12 +406,12 @@  discard block
 block discarded – undo
406 406
                         Helper::getLanguageService()->getLL('flash.solrException') . '<br />' . htmlspecialchars($e->getMessage()),
407 407
                         Helper::getLanguageService()->getLL('flash.error'),
408 408
                         FlashMessage::ERROR,
409
-                        true,
409
+                        TRUE,
410 410
                         'core.template.flashMessages'
411 411
                     );
412 412
                 }
413 413
                 Helper::log('Apache Solr threw exception: "' . $e->getMessage() . '"', LOG_SEVERITY_ERROR);
414
-                return false;
414
+                return FALSE;
415 415
             }
416 416
         }
417 417
         // Check for child elements...
@@ -457,7 +457,7 @@  discard block
 block discarded – undo
457 457
                     break;
458 458
                 }
459 459
             }
460
-            $solrDoc->setField('toplevel', false);
460
+            $solrDoc->setField('toplevel', FALSE);
461 461
             $solrDoc->setField('type', $physicalUnit['type'], self::$fields['fieldboost']['type']);
462 462
             $solrDoc->setField('collection', $doc->metadataArray[$doc->toplevelId]['collection']);
463 463
 
@@ -497,15 +497,15 @@  discard block
 block discarded – undo
497 497
                         Helper::getLanguageService()->getLL('flash.solrException') . '<br />' . htmlspecialchars($e->getMessage()),
498 498
                         Helper::getLanguageService()->getLL('flash.error'),
499 499
                         FlashMessage::ERROR,
500
-                        true,
500
+                        TRUE,
501 501
                         'core.template.flashMessages'
502 502
                     );
503 503
                 }
504 504
                 Helper::log('Apache Solr threw exception: "' . $e->getMessage() . '"', LOG_SEVERITY_ERROR);
505
-                return false;
505
+                return FALSE;
506 506
             }
507 507
         }
508
-        return true;
508
+        return TRUE;
509 509
     }
510 510
 
511 511
     /**
@@ -531,10 +531,10 @@  discard block
 block discarded – undo
531 531
                     self::loadIndexConf($pid);
532 532
                 }
533 533
             } else {
534
-                return false;
534
+                return FALSE;
535 535
             }
536 536
         }
537
-        return true;
537
+        return TRUE;
538 538
     }
539 539
 
540 540
     /**
Please login to merge, or discard this patch.
Classes/Common/Helper.php 1 patch
Upper-Lower-Casing   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
      *
82 82
      * @return \TYPO3\CMS\Core\Messaging\FlashMessageQueue The queue the message was added to
83 83
      */
84
-    public static function addMessage($message, $title, $severity, $session = false, $queue = 'kitodo.default.flashMessages')
84
+    public static function addMessage($message, $title, $severity, $session = FALSE, $queue = 'kitodo.default.flashMessages')
85 85
     {
86 86
         $flashMessageService = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Messaging\FlashMessageService::class);
87 87
         $flashMessageQueue = $flashMessageService->getMessageQueueByIdentifier($queue);
@@ -123,9 +123,9 @@  discard block
 block discarded – undo
123 123
                     $checksum = 'X';
124 124
                 }
125 125
                 if (!preg_match('/\d{8}[\dX]{1}/i', $id)) {
126
-                    return false;
126
+                    return FALSE;
127 127
                 } elseif (strtoupper(substr($id, -1, 1)) != $checksum) {
128
-                    return false;
128
+                    return FALSE;
129 129
                 }
130 130
                 break;
131 131
             case 'ZDB':
@@ -133,19 +133,19 @@  discard block
 block discarded – undo
133 133
                     $checksum = 'X';
134 134
                 }
135 135
                 if (!preg_match('/\d{8}-[\dX]{1}/i', $id)) {
136
-                    return false;
136
+                    return FALSE;
137 137
                 } elseif (strtoupper(substr($id, -1, 1)) != $checksum) {
138
-                    return false;
138
+                    return FALSE;
139 139
                 }
140 140
                 break;
141 141
             case 'SWD':
142 142
                 $checksum = 11 - $checksum;
143 143
                 if (!preg_match('/\d{8}-\d{1}/i', $id)) {
144
-                    return false;
144
+                    return FALSE;
145 145
                 } elseif ($checksum == 10) {
146 146
                     return self::checkIdentifier(($digits + 1) . substr($id, -2, 2), 'SWD');
147 147
                 } elseif (substr($id, -1, 1) != $checksum) {
148
-                    return false;
148
+                    return FALSE;
149 149
                 }
150 150
                 break;
151 151
             case 'GKD':
@@ -154,13 +154,13 @@  discard block
 block discarded – undo
154 154
                     $checksum = 'X';
155 155
                 }
156 156
                 if (!preg_match('/\d{8}-[\dX]{1}/i', $id)) {
157
-                    return false;
157
+                    return FALSE;
158 158
                 } elseif (strtoupper(substr($id, -1, 1)) != $checksum) {
159
-                    return false;
159
+                    return FALSE;
160 160
                 }
161 161
                 break;
162 162
         }
163
-        return true;
163
+        return TRUE;
164 164
     }
165 165
 
166 166
     /**
@@ -175,28 +175,28 @@  discard block
 block discarded – undo
175 175
     public static function decrypt($encrypted)
176 176
     {
177 177
         if (
178
-            !in_array(self::$cipherAlgorithm, openssl_get_cipher_methods(true))
179
-            || !in_array(self::$hashAlgorithm, openssl_get_md_methods(true))
178
+            !in_array(self::$cipherAlgorithm, openssl_get_cipher_methods(TRUE))
179
+            || !in_array(self::$hashAlgorithm, openssl_get_md_methods(TRUE))
180 180
         ) {
181 181
             self::log('OpenSSL library doesn\'t support cipher and/or hash algorithm', LOG_SEVERITY_ERROR);
182
-            return false;
182
+            return FALSE;
183 183
         }
184 184
         if (empty($GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey'])) {
185 185
             self::log('No encryption key set in TYPO3 configuration', LOG_SEVERITY_ERROR);
186
-            return false;
186
+            return FALSE;
187 187
         }
188 188
         if (
189 189
             empty($encrypted)
190 190
             || strlen($encrypted) < openssl_cipher_iv_length(self::$cipherAlgorithm)
191 191
         ) {
192 192
             self::log('Invalid parameters given for decryption', LOG_SEVERITY_ERROR);
193
-            return false;
193
+            return FALSE;
194 194
         }
195 195
         // Split initialisation vector and encrypted data.
196 196
         $binary = base64_decode($encrypted);
197 197
         $iv = substr($binary, 0, openssl_cipher_iv_length(self::$cipherAlgorithm));
198 198
         $data = substr($binary, openssl_cipher_iv_length(self::$cipherAlgorithm));
199
-        $key = openssl_digest($GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey'], self::$hashAlgorithm, true);
199
+        $key = openssl_digest($GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey'], self::$hashAlgorithm, TRUE);
200 200
         // Decrypt data.
201 201
         $decrypted = openssl_decrypt($data, self::$cipherAlgorithm, $key, OPENSSL_RAW_DATA, $iv);
202 202
         return $decrypted;
@@ -217,13 +217,13 @@  discard block
 block discarded – undo
217 217
         // Don't make simplexml_load_string throw (when $content is an array
218 218
         // or object)
219 219
         if (!is_string($content)) {
220
-            return false;
220
+            return FALSE;
221 221
         }
222 222
 
223 223
         // Turn off libxml's error logging.
224
-        $libxmlErrors = libxml_use_internal_errors(true);
224
+        $libxmlErrors = libxml_use_internal_errors(TRUE);
225 225
         // Disables the functionality to allow external entities to be loaded when parsing the XML, must be kept
226
-        $previousValueOfEntityLoader = libxml_disable_entity_loader(true);
226
+        $previousValueOfEntityLoader = libxml_disable_entity_loader(TRUE);
227 227
         // Try to load XML from file.
228 228
         $xml = simplexml_load_string($content);
229 229
         // reset entity loader setting
@@ -277,9 +277,9 @@  discard block
 block discarded – undo
277 277
      */
278 278
     public static function digest($string)
279 279
     {
280
-        if (!in_array(self::$hashAlgorithm, openssl_get_md_methods(true))) {
280
+        if (!in_array(self::$hashAlgorithm, openssl_get_md_methods(TRUE))) {
281 281
             self::log('OpenSSL library doesn\'t support hash algorithm', LOG_SEVERITY_ERROR);
282
-            return false;
282
+            return FALSE;
283 283
         }
284 284
         // Hash string.
285 285
         $hashed = openssl_digest($string, self::$hashAlgorithm);
@@ -298,23 +298,23 @@  discard block
 block discarded – undo
298 298
     public static function encrypt($string)
299 299
     {
300 300
         if (
301
-            !in_array(self::$cipherAlgorithm, openssl_get_cipher_methods(true))
302
-            || !in_array(self::$hashAlgorithm, openssl_get_md_methods(true))
301
+            !in_array(self::$cipherAlgorithm, openssl_get_cipher_methods(TRUE))
302
+            || !in_array(self::$hashAlgorithm, openssl_get_md_methods(TRUE))
303 303
         ) {
304 304
             self::log('OpenSSL library doesn\'t support cipher and/or hash algorithm', LOG_SEVERITY_ERROR);
305
-            return false;
305
+            return FALSE;
306 306
         }
307 307
         if (empty($GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey'])) {
308 308
             self::log('No encryption key set in TYPO3 configuration', LOG_SEVERITY_ERROR);
309
-            return false;
309
+            return FALSE;
310 310
         }
311 311
         // Generate random initialisation vector.
312 312
         $iv = openssl_random_pseudo_bytes(openssl_cipher_iv_length(self::$cipherAlgorithm));
313
-        $key = openssl_digest($GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey'], self::$hashAlgorithm, true);
313
+        $key = openssl_digest($GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey'], self::$hashAlgorithm, TRUE);
314 314
         // Encrypt data.
315 315
         $encrypted = openssl_encrypt($string, self::$cipherAlgorithm, $key, OPENSSL_RAW_DATA, $iv);
316 316
         // Merge initialisation vector and encrypted data.
317
-        if ($encrypted !== false) {
317
+        if ($encrypted !== FALSE) {
318 318
             $encrypted = base64_encode($iv . $encrypted);
319 319
         }
320 320
         return $encrypted;
@@ -601,7 +601,7 @@  discard block
 block discarded – undo
601 601
     public static function isValidHttpUrl($url)
602 602
     {
603 603
         if (!GeneralUtility::isValidUrl($url)) {
604
-            return false;
604
+            return FALSE;
605 605
         }
606 606
 
607 607
         $parsed = parse_url($url);
@@ -625,7 +625,7 @@  discard block
 block discarded – undo
625 625
      *
626 626
      * @return array Merged array
627 627
      */
628
-    public static function mergeRecursiveWithOverrule(array $original, array $overrule, $addKeys = true, $includeEmptyValues = true, $enableUnsetFeature = true)
628
+    public static function mergeRecursiveWithOverrule(array $original, array $overrule, $addKeys = TRUE, $includeEmptyValues = TRUE, $enableUnsetFeature = TRUE)
629 629
     {
630 630
         \TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule($original, $overrule, $addKeys, $includeEmptyValues, $enableUnsetFeature);
631 631
         return $original;
@@ -697,7 +697,7 @@  discard block
 block discarded – undo
697 697
             ->where(
698 698
                 $queryBuilder->expr()->eq($table . '.pid', $pid),
699 699
                 $queryBuilder->expr()->eq($table . '.index_name', $queryBuilder->expr()->literal($index_name)),
700
-                self::whereExpression($table, true)
700
+                self::whereExpression($table, TRUE)
701 701
             )
702 702
             ->setMaxResults(1)
703 703
             ->execute();
@@ -715,7 +715,7 @@  discard block
 block discarded – undo
715 715
                     $queryBuilder->expr()->eq($table . '.pid', $pid),
716 716
                     $queryBuilder->expr()->eq($table . '.uid', $resArray['l18n_parent']),
717 717
                     $queryBuilder->expr()->eq($table . '.sys_language_uid', intval($languageAspect->getContentId())),
718
-                    self::whereExpression($table, true)
718
+                    self::whereExpression($table, TRUE)
719 719
                 )
720 720
                 ->setMaxResults(1)
721 721
                 ->execute();
@@ -750,7 +750,7 @@  discard block
 block discarded – undo
750 750
                     ->where(
751 751
                         $queryBuilder->expr()->eq($table . '.pid', $pid),
752 752
                         $additionalWhere,
753
-                        self::whereExpression($table, true)
753
+                        self::whereExpression($table, TRUE)
754 754
                     )
755 755
                     ->setMaxResults(10000)
756 756
                     ->execute();
@@ -790,7 +790,7 @@  discard block
 block discarded – undo
790 790
      *
791 791
      * @return string Additional WHERE expression
792 792
      */
793
-    public static function whereExpression($table, $showHidden = false)
793
+    public static function whereExpression($table, $showHidden = FALSE)
794 794
     {
795 795
         if (\TYPO3_MODE === 'FE') {
796 796
             // Should we ignore the record's hidden flag?
@@ -859,13 +859,13 @@  discard block
 block discarded – undo
859 859
         $frameworkConfiguration = $configurationManager->getConfiguration(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK);
860 860
 
861 861
         $extbaseClassmap = &$frameworkConfiguration['persistence']['classes'];
862
-        if ($extbaseClassmap === null) {
862
+        if ($extbaseClassmap === NULL) {
863 863
             $extbaseClassmap = [];
864 864
         }
865 865
 
866 866
         foreach ($classes as $className => $classConfig) {
867 867
             $extbaseClass = &$extbaseClassmap[$className];
868
-            if ($extbaseClass === null) {
868
+            if ($extbaseClass === NULL) {
869 869
                 $extbaseClass = [];
870 870
             }
871 871
             if (!isset($extbaseClass['mapping'])) {
@@ -891,7 +891,7 @@  discard block
 block discarded – undo
891 891
     public static function getUrl(string $url)
892 892
     {
893 893
         if (!Helper::isValidHttpUrl($url)) {
894
-            return false;
894
+            return FALSE;
895 895
         }
896 896
 
897 897
         // Get extension configuration.
@@ -909,7 +909,7 @@  discard block
 block discarded – undo
909 909
             $response = $requestFactory->request($url, 'GET', $configuration);
910 910
         } catch (\Exception $e) {
911 911
             self::log('Could not fetch data from URL "' . $url . '". Error: ' . $e->getMessage() . '.', LOG_SEVERITY_WARNING);
912
-            return false;
912
+            return FALSE;
913 913
         }
914 914
         $content  = $response->getBody()->getContents();
915 915
 
Please login to merge, or discard this patch.
Classes/Common/SolrSearch.php 1 patch
Upper-Lower-Casing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
      * @param array $searchParams
35 35
      * @param QueryResult $listedMetadata
36 36
      */
37
-    public function __construct($documentRepository, $collection, $settings, $searchParams, $listedMetadata = null)
37
+    public function __construct($documentRepository, $collection, $settings, $searchParams, $listedMetadata = NULL)
38 38
     {
39 39
         $this->documentRepository = $documentRepository;
40 40
         $this->collection = $collection;
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
 
51 51
     public function count()
52 52
     {
53
-        if ($this->result === null) {
53
+        if ($this->result === NULL) {
54 54
             return 0;
55 55
         }
56 56
 
@@ -91,9 +91,9 @@  discard block
 block discarded – undo
91 91
     public function offsetGet($offset)
92 92
     {
93 93
         $idx = $this->result['document_keys'][$offset];
94
-        $document = $this->result['documents'][$idx] ?? null;
94
+        $document = $this->result['documents'][$idx] ?? NULL;
95 95
 
96
-        if ($document !== null) {
96
+        if ($document !== NULL) {
97 97
             // It may happen that a Solr group only includes non-toplevel results,
98 98
             // in which case metadata of toplevel entry isn't yet filled.
99 99
             if (empty($document['metadata'])) {
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
 
108 108
             // get title of parent/grandparent/... if empty
109 109
             if (empty($document['title']) && $document['partOf'] > 0) {
110
-                $superiorTitle = Doc::getTitle($document['partOf'], true);
110
+                $superiorTitle = Doc::getTitle($document['partOf'], TRUE);
111 111
                 if (!empty($superiorTitle)) {
112 112
                     $document['title'] = '[' . $superiorTitle . ']';
113 113
                 }
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
             if (!empty($this->searchParams['query'])) {
181 181
                 $query = $fields['fulltext'] . ':(' . Solr::escapeQuery(trim($this->searchParams['query'])) . ')';
182 182
             }
183
-            $params['fulltext'] = true;
183
+            $params['fulltext'] = TRUE;
184 184
         } else {
185 185
             // Retain given search field if valid.
186 186
             if (!empty($this->searchParams['query'])) {
@@ -289,17 +289,17 @@  discard block
 block discarded – undo
289 289
         $this->params = $params;
290 290
 
291 291
         // Send off query to get total number of search results in advance
292
-        $this->submit(0, 1, false);
292
+        $this->submit(0, 1, FALSE);
293 293
     }
294 294
 
295
-    public function submit($start, $rows, $processResults = true)
295
+    public function submit($start, $rows, $processResults = TRUE)
296 296
     {
297 297
         $params = $this->params;
298 298
         $params['start'] = $start;
299 299
         $params['rows'] = $rows;
300 300
 
301 301
         // Perform search.
302
-        $result = $this->searchSolr($params, true);
302
+        $result = $this->searchSolr($params, TRUE);
303 303
 
304 304
         // Initialize values
305 305
         $documents = [];
@@ -329,7 +329,7 @@  discard block
 block discarded – undo
329 329
                             $doc['metadata']['language'][$indexName] = Helper::getLanguageName($doc['metadata']['language'][$indexName]);
330 330
                         }
331 331
                     }
332
-                    if ($doc['toplevel'] === false) {
332
+                    if ($doc['toplevel'] === FALSE) {
333 333
                         // this maybe a chapter, article, ..., year
334 334
                         if ($doc['type'] === 'year') {
335 335
                             continue;
@@ -353,7 +353,7 @@  discard block
 block discarded – undo
353 353
                             }
354 354
                             $documents[$doc['uid']]['searchResults'][] = $searchResult;
355 355
                         }
356
-                    } else if ($doc['toplevel'] === true) {
356
+                    } else if ($doc['toplevel'] === TRUE) {
357 357
                         foreach ($params['listMetadataRecords'] as $indexName => $solrField) {
358 358
                             if (isset($doc['metadata'][$indexName])) {
359 359
                                 $documents[$doc['uid']]['metadata'][$indexName] = $doc['metadata'][$indexName];
@@ -421,7 +421,7 @@  discard block
 block discarded – undo
421 421
         $params['filterquery'][] = ['query' => 'toplevel:true'];
422 422
 
423 423
         // Perform search.
424
-        $result = $this->searchSolr($params, true);
424
+        $result = $this->searchSolr($params, TRUE);
425 425
 
426 426
         foreach ($result['documents'] as $doc) {
427 427
             // translate language code if applicable
@@ -446,7 +446,7 @@  discard block
 block discarded – undo
446 446
      *
447 447
      * @return array The Apache Solr Documents that were fetched
448 448
      */
449
-    protected function searchSolr($parameters = [], $enableCache = true)
449
+    protected function searchSolr($parameters = [], $enableCache = TRUE)
450 450
     {
451 451
         // Set query.
452 452
         $parameters['query'] = isset($parameters['query']) ? $parameters['query'] : '*';
@@ -465,10 +465,10 @@  discard block
 block discarded – undo
465 465
         }
466 466
 
467 467
         $cacheIdentifier = '';
468
-        $cache = null;
468
+        $cache = NULL;
469 469
         // Calculate cache identifier.
470
-        if ($enableCache === true) {
471
-            $cacheIdentifier = Helper::digest($solr->core . print_r($parameters, true));
470
+        if ($enableCache === TRUE) {
471
+            $cacheIdentifier = Helper::digest($solr->core . print_r($parameters, TRUE));
472 472
             $cache = GeneralUtility::makeInstance(CacheManager::class)->getCache('tx_dlf_solr');
473 473
         }
474 474
         $resultSet = [
@@ -476,22 +476,22 @@  discard block
 block discarded – undo
476 476
             'numberOfToplevels' => 0,
477 477
             'numFound' => 0,
478 478
         ];
479
-        if ($enableCache === false || ($entry = $cache->get($cacheIdentifier)) === false) {
479
+        if ($enableCache === FALSE || ($entry = $cache->get($cacheIdentifier)) === FALSE) {
480 480
             $selectQuery = $solr->service->createSelect($parameters);
481 481
 
482 482
             $grouping = $selectQuery->getGrouping();
483 483
             $grouping->addField('uid');
484 484
             $grouping->setLimit(100); // Results in group (TODO: check)
485
-            $grouping->setNumberOfGroups(true);
485
+            $grouping->setNumberOfGroups(TRUE);
486 486
 
487
-            if ($parameters['fulltext'] === true) {
487
+            if ($parameters['fulltext'] === TRUE) {
488 488
                 // get highlighting component and apply settings
489 489
                 $selectQuery->getHighlighting();
490 490
             }
491 491
 
492 492
             $solrRequest = $solr->service->createRequest($selectQuery);
493 493
 
494
-            if ($parameters['fulltext'] === true) {
494
+            if ($parameters['fulltext'] === TRUE) {
495 495
                 // If it is a fulltext search, enable highlighting.
496 496
                 // field for which highlighting is going to be performed,
497 497
                 // is required if you want to have OCR highlighting
@@ -512,7 +512,7 @@  discard block
 block discarded – undo
512 512
             $resultSet['numberOfToplevels'] = $uidGroup->getNumberOfGroups();
513 513
             $resultSet['numFound'] = $uidGroup->getMatches();
514 514
             $highlighting = [];
515
-            if ($parameters['fulltext'] === true) {
515
+            if ($parameters['fulltext'] === TRUE) {
516 516
                 $data = $result->getData();
517 517
                 $highlighting = $data['ocrHighlighting'];
518 518
             }
@@ -543,7 +543,7 @@  discard block
 block discarded – undo
543 543
             }
544 544
 
545 545
             // Save value in cache.
546
-            if (!empty($resultSet) && $enableCache === true) {
546
+            if (!empty($resultSet) && $enableCache === TRUE) {
547 547
                 $cache->set($cacheIdentifier, $resultSet);
548 548
             }
549 549
         } else {
Please login to merge, or discard this patch.
Classes/Api/Viaf/Client.php 1 patch
Upper-Lower-Casing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -47,14 +47,14 @@  discard block
 block discarded – undo
47 47
      *
48 48
      * @var string
49 49
      **/
50
-    private $viafUrl = null;
50
+    private $viafUrl = NULL;
51 51
 
52 52
     /**
53 53
      * The request object
54 54
      *
55 55
      * @var RequestFactoryInterface
56 56
      **/
57
-    private $requestFactory = null;
57
+    private $requestFactory = NULL;
58 58
 
59 59
     /**
60 60
      * Constructs a new instance
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
             $response = $this->requestFactory->request($url);
94 94
         } catch (\Exception $e) {
95 95
             $this->logger->warning('Could not fetch data from URL "' . $url . '". Error: ' . $e->getMessage() . '.');
96
-            return false;
96
+            return FALSE;
97 97
         }
98 98
         return $response->getBody()->getContents();
99 99
     }
Please login to merge, or discard this patch.
Classes/Api/Orcid/Profile.php 1 patch
Upper-Lower-Casing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
      *
49 49
      * @var \SimpleXmlElement|false
50 50
      **/
51
-    private $raw = null;
51
+    private $raw = NULL;
52 52
 
53 53
     /**
54 54
      * Constructs client instance
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
             return $data;
80 80
         } else {
81 81
             $this->logger->warning('No data found for given ORCID');
82
-            return false;
82
+            return FALSE;
83 83
         }
84 84
     }
85 85
 
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
             return (string) $this->raw->xpath('./address:address/address:country')[0];
97 97
         } else {
98 98
             $this->logger->warning('No address found for given ORCID');
99
-            return false;
99
+            return FALSE;
100 100
         }
101 101
     }
102 102
 
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
             return (string) $this->raw->xpath('./email:email/email:email')[0];
114 114
         } else {
115 115
             $this->logger->warning('No email found for given ORCID');
116
-            return false;
116
+            return FALSE;
117 117
         }
118 118
     }
119 119
 
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
             return (string) $givenNames[0] . ' ' . (string) $familyName[0];
133 133
         } else {
134 134
             $this->logger->warning('No name found for given ORCID');
135
-            return false;
135
+            return FALSE;
136 136
         }
137 137
     }
138 138
 
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
     {
148 148
         $this->client->setEndpoint($endpoint);
149 149
         $data = $this->client->getData();
150
-        if (!isset($this->raw) && $data != false) {
150
+        if (!isset($this->raw) && $data != FALSE) {
151 151
             $this->raw = Helper::getXmlFileAsString($data);
152 152
         }
153 153
     }
Please login to merge, or discard this patch.
Classes/Api/Viaf/Profile.php 1 patch
Upper-Lower-Casing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
      *
49 49
      * @var \SimpleXmlElement|false
50 50
      **/
51
-    private $raw = null;
51
+    private $raw = NULL;
52 52
 
53 53
     /**
54 54
      * Constructs client instance
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
             return $data;
79 79
         } else {
80 80
             $this->logger->warning('No data found for given VIAF URL');
81
-            return false;
81
+            return FALSE;
82 82
         }
83 83
     }
84 84
 
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
             return (string) $this->raw->xpath('./ns1:nationalityOfEntity/ns1:data/ns1:text')[0];
95 95
         } else {
96 96
             $this->logger->warning('No address found for given VIAF URL');
97
-            return false;
97
+            return FALSE;
98 98
         }
99 99
     }
100 100
 
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
             return $name;
114 114
         } else {
115 115
             $this->logger->warning('No name found for given VIAF URL');
116
-            return false;
116
+            return FALSE;
117 117
         }
118 118
     }
119 119
 
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
     protected function getRaw()
126 126
     {
127 127
         $data = $this->client->getData();
128
-        if (!isset($this->raw) && $data != false) {
128
+        if (!isset($this->raw) && $data != FALSE) {
129 129
             $this->raw = Helper::getXmlFileAsString($data);
130 130
             $this->raw->registerXPathNamespace('ns1', 'http://viaf.org/viaf/terms#');
131 131
         }
Please login to merge, or discard this patch.
Classes/Controller/MetadataController.php 1 patch
Upper-Lower-Casing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -80,8 +80,8 @@  discard block
 block discarded – undo
80 80
         // Load current document.
81 81
         $this->loadDocument($this->requestData);
82 82
         if (
83
-            $this->document === null
84
-            || $this->document->getDoc() === null
83
+            $this->document === NULL
84
+            || $this->document->getDoc() === NULL
85 85
         ) {
86 86
             // Quit without doing anything if required variables are not set.
87 87
             return '';
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
      *
131 131
      * @return string The metadata array ready for output
132 132
      */
133
-    protected function printMetadata(array $metadata, $useOriginalIiifManifestMetadata = false)
133
+    protected function printMetadata(array $metadata, $useOriginalIiifManifestMetadata = FALSE)
134 134
     {
135 135
         if ($useOriginalIiifManifestMetadata) {
136 136
             $iiifData = [];
@@ -148,14 +148,14 @@  discard block
 block discarded – undo
148 148
                             $iiifData[$key] = [
149 149
                                 'label' => $key,
150 150
                                 'value' => $group,
151
-                                'buildUrl' => true,
151
+                                'buildUrl' => TRUE,
152 152
                             ];
153 153
                         } else {
154 154
                             // Data output
155 155
                             $iiifData[$key] = [
156 156
                                 'label' => $key,
157 157
                                 'value' => $group,
158
-                                'buildUrl' => false,
158
+                                'buildUrl' => FALSE,
159 159
                             ];
160 160
                         }
161 161
                     } else {
@@ -172,18 +172,18 @@  discard block
 block discarded – undo
172 172
                                 $iiifData[$key]['data'][] = [
173 173
                                     'label' => $nolabel ? '' : $label,
174 174
                                     'value' => $value,
175
-                                    'buildUrl' => true,
175
+                                    'buildUrl' => TRUE,
176 176
                                 ];
177 177
                             } else {
178 178
                                 $iiifData[$key]['data'][] = [
179 179
                                     'label' => $label,
180 180
                                     'value' => $value,
181
-                                    'buildUrl' => false,
181
+                                    'buildUrl' => FALSE,
182 182
                                 ];
183 183
                             }
184 184
                         }
185 185
                     }
186
-                    $this->view->assign('useIiif', true);
186
+                    $this->view->assign('useIiif', TRUE);
187 187
                     $this->view->assign('iiifData', $iiifData);
188 188
                 }
189 189
             }
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
                     if ($name == 'title') {
214 214
                         // Get title of parent document if needed.
215 215
                         if (empty(implode('', $value)) && $this->settings['getTitle'] && $this->document->getPartof()) {
216
-                            $superiorTitle = Doc::getTitle($this->document->getPartof(), true);
216
+                            $superiorTitle = Doc::getTitle($this->document->getPartof(), TRUE);
217 217
                             if (!empty($superiorTitle)) {
218 218
                                 $metadata[$i][$name] = ['[' . $superiorTitle . ']'];
219 219
                             }
Please login to merge, or discard this patch.
Classes/Controller/TableOfContentsController.php 1 patch
Upper-Lower-Casing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -44,8 +44,8 @@  discard block
 block discarded – undo
44 44
         // Load current document.
45 45
         $this->loadDocument($this->requestData);
46 46
         if (
47
-            $this->document === null
48
-            || $this->document->getDoc() === null
47
+            $this->document === NULL
48
+            || $this->document->getDoc() === NULL
49 49
         ) {
50 50
             // Quit without doing anything if required variables are not set.
51 51
             return;
@@ -102,12 +102,12 @@  discard block
 block discarded – undo
102 102
             }
103 103
             // Go through table of contents and create all menu entries.
104 104
             foreach ($this->document->getDoc()->tableOfContents as $entry) {
105
-                $menuArray[] = $this->getMenuEntry($entry, true);
105
+                $menuArray[] = $this->getMenuEntry($entry, TRUE);
106 106
             }
107 107
         } else {
108 108
             // Go through table of contents and create top-level menu entries.
109 109
             foreach ($this->document->getDoc()->tableOfContents as $entry) {
110
-                $menuArray[] = $this->getMenuEntry($entry, false);
110
+                $menuArray[] = $this->getMenuEntry($entry, FALSE);
111 111
             }
112 112
             // Build table of contents from database.
113 113
             $result = $this->documentRepository->getTableOfContentsFromDb($this->document->getUid(), $this->document->getPid(), $this->settings);
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
                         'pagination' => '',
127 127
                         'targetUid' => $resArray['uid']
128 128
                     ];
129
-                    $menuArray[0]['_SUB_MENU'][] = $this->getMenuEntry($entry, false);
129
+                    $menuArray[0]['_SUB_MENU'][] = $this->getMenuEntry($entry, FALSE);
130 130
                 }
131 131
             }
132 132
         }
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
      *
144 144
      * @return array HMENU array for menu entry
145 145
      */
146
-    protected function getMenuEntry(array $entry, $recursive = false)
146
+    protected function getMenuEntry(array $entry, $recursive = FALSE)
147 147
     {
148 148
         $entry = $this->resolveMenuEntry($entry);
149 149
 
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
         }
202 202
         // Build sub-menu if available and called recursively.
203 203
         if (
204
-            $recursive === true
204
+            $recursive === TRUE
205 205
             && !empty($entry['children'])
206 206
         ) {
207 207
             // Build sub-menu only if one of the following conditions apply:
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
                     if (in_array($child['id'], $this->activeEntries)) {
220 220
                         $entryArray['ITEM_STATE'] = 'ACT';
221 221
                     }
222
-                    $entryArray['_SUB_MENU'][] = $this->getMenuEntry($child, true);
222
+                    $entryArray['_SUB_MENU'][] = $this->getMenuEntry($child, TRUE);
223 223
                 }
224 224
             }
225 225
             // Append "IFSUB" to "ITEM_STATE" if this entry has sub-entries.
Please login to merge, or discard this patch.