Completed
Push — master ( dcd410...c82f36 )
by
unknown
17s queued 13s
created
Classes/Common/Helper.php 1 patch
Upper-Lower-Casing   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
      *
81 81
      * @return \TYPO3\CMS\Core\Messaging\FlashMessageQueue The queue the message was added to
82 82
      */
83
-    public static function addMessage($message, $title, $severity, $session = false, $queue = 'kitodo.default.flashMessages')
83
+    public static function addMessage($message, $title, $severity, $session = FALSE, $queue = 'kitodo.default.flashMessages')
84 84
     {
85 85
         $flashMessageService = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Messaging\FlashMessageService::class);
86 86
         $flashMessageQueue = $flashMessageService->getMessageQueueByIdentifier($queue);
@@ -122,9 +122,9 @@  discard block
 block discarded – undo
122 122
                     $checksum = 'X';
123 123
                 }
124 124
                 if (!preg_match('/[0-9]{8}[0-9X]{1}/i', $id)) {
125
-                    return false;
125
+                    return FALSE;
126 126
                 } elseif (strtoupper(substr($id, -1, 1)) != $checksum) {
127
-                    return false;
127
+                    return FALSE;
128 128
                 }
129 129
                 break;
130 130
             case 'ZDB':
@@ -132,19 +132,19 @@  discard block
 block discarded – undo
132 132
                     $checksum = 'X';
133 133
                 }
134 134
                 if (!preg_match('/[0-9]{8}-[0-9X]{1}/i', $id)) {
135
-                    return false;
135
+                    return FALSE;
136 136
                 } elseif (strtoupper(substr($id, -1, 1)) != $checksum) {
137
-                    return false;
137
+                    return FALSE;
138 138
                 }
139 139
                 break;
140 140
             case 'SWD':
141 141
                 $checksum = 11 - $checksum;
142 142
                 if (!preg_match('/[0-9]{8}-[0-9]{1}/i', $id)) {
143
-                    return false;
143
+                    return FALSE;
144 144
                 } elseif ($checksum == 10) {
145 145
                     return self::checkIdentifier(($digits + 1) . substr($id, -2, 2), 'SWD');
146 146
                 } elseif (substr($id, -1, 1) != $checksum) {
147
-                    return false;
147
+                    return FALSE;
148 148
                 }
149 149
                 break;
150 150
             case 'GKD':
@@ -153,13 +153,13 @@  discard block
 block discarded – undo
153 153
                     $checksum = 'X';
154 154
                 }
155 155
                 if (!preg_match('/[0-9]{8}-[0-9X]{1}/i', $id)) {
156
-                    return false;
156
+                    return FALSE;
157 157
                 } elseif (strtoupper(substr($id, -1, 1)) != $checksum) {
158
-                    return false;
158
+                    return FALSE;
159 159
                 }
160 160
                 break;
161 161
         }
162
-        return true;
162
+        return TRUE;
163 163
     }
164 164
 
165 165
     /**
@@ -174,28 +174,28 @@  discard block
 block discarded – undo
174 174
     public static function decrypt($encrypted)
175 175
     {
176 176
         if (
177
-            !in_array(self::$cipherAlgorithm, openssl_get_cipher_methods(true))
178
-            || !in_array(self::$hashAlgorithm, openssl_get_md_methods(true))
177
+            !in_array(self::$cipherAlgorithm, openssl_get_cipher_methods(TRUE))
178
+            || !in_array(self::$hashAlgorithm, openssl_get_md_methods(TRUE))
179 179
         ) {
180 180
             self::log('OpenSSL library doesn\'t support cipher and/or hash algorithm', LOG_SEVERITY_ERROR);
181
-            return false;
181
+            return FALSE;
182 182
         }
183 183
         if (empty($GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey'])) {
184 184
             self::log('No encryption key set in TYPO3 configuration', LOG_SEVERITY_ERROR);
185
-            return false;
185
+            return FALSE;
186 186
         }
187 187
         if (
188 188
             empty($encrypted)
189 189
             || strlen($encrypted) < openssl_cipher_iv_length(self::$cipherAlgorithm)
190 190
         ) {
191 191
             self::log('Invalid parameters given for decryption', LOG_SEVERITY_ERROR);
192
-            return false;
192
+            return FALSE;
193 193
         }
194 194
         // Split initialisation vector and encrypted data.
195 195
         $binary = base64_decode($encrypted);
196 196
         $iv = substr($binary, 0, openssl_cipher_iv_length(self::$cipherAlgorithm));
197 197
         $data = substr($binary, openssl_cipher_iv_length(self::$cipherAlgorithm));
198
-        $key = openssl_digest($GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey'], self::$hashAlgorithm, true);
198
+        $key = openssl_digest($GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey'], self::$hashAlgorithm, TRUE);
199 199
         // Decrypt data.
200 200
         $decrypted = openssl_decrypt($data, self::$cipherAlgorithm, $key, OPENSSL_RAW_DATA, $iv);
201 201
         return $decrypted;
@@ -216,13 +216,13 @@  discard block
 block discarded – undo
216 216
         // Don't make simplexml_load_string throw (when $content is an array
217 217
         // or object)
218 218
         if (!is_string($content)) {
219
-            return false;
219
+            return FALSE;
220 220
         }
221 221
 
222 222
         // Turn off libxml's error logging.
223
-        $libxmlErrors = libxml_use_internal_errors(true);
223
+        $libxmlErrors = libxml_use_internal_errors(TRUE);
224 224
         // Disables the functionality to allow external entities to be loaded when parsing the XML, must be kept
225
-        $previousValueOfEntityLoader = libxml_disable_entity_loader(true);
225
+        $previousValueOfEntityLoader = libxml_disable_entity_loader(TRUE);
226 226
         // Try to load XML from file.
227 227
         $xml = simplexml_load_string($content);
228 228
         // reset entity loader setting
@@ -276,9 +276,9 @@  discard block
 block discarded – undo
276 276
      */
277 277
     public static function digest($string)
278 278
     {
279
-        if (!in_array(self::$hashAlgorithm, openssl_get_md_methods(true))) {
279
+        if (!in_array(self::$hashAlgorithm, openssl_get_md_methods(TRUE))) {
280 280
             self::log('OpenSSL library doesn\'t support hash algorithm', LOG_SEVERITY_ERROR);
281
-            return false;
281
+            return FALSE;
282 282
         }
283 283
         // Hash string.
284 284
         $hashed = openssl_digest($string, self::$hashAlgorithm);
@@ -297,23 +297,23 @@  discard block
 block discarded – undo
297 297
     public static function encrypt($string)
298 298
     {
299 299
         if (
300
-            !in_array(self::$cipherAlgorithm, openssl_get_cipher_methods(true))
301
-            || !in_array(self::$hashAlgorithm, openssl_get_md_methods(true))
300
+            !in_array(self::$cipherAlgorithm, openssl_get_cipher_methods(TRUE))
301
+            || !in_array(self::$hashAlgorithm, openssl_get_md_methods(TRUE))
302 302
         ) {
303 303
             self::log('OpenSSL library doesn\'t support cipher and/or hash algorithm', LOG_SEVERITY_ERROR);
304
-            return false;
304
+            return FALSE;
305 305
         }
306 306
         if (empty($GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey'])) {
307 307
             self::log('No encryption key set in TYPO3 configuration', LOG_SEVERITY_ERROR);
308
-            return false;
308
+            return FALSE;
309 309
         }
310 310
         // Generate random initialisation vector.
311 311
         $iv = openssl_random_pseudo_bytes(openssl_cipher_iv_length(self::$cipherAlgorithm));
312
-        $key = openssl_digest($GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey'], self::$hashAlgorithm, true);
312
+        $key = openssl_digest($GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey'], self::$hashAlgorithm, TRUE);
313 313
         // Encrypt data.
314 314
         $encrypted = openssl_encrypt($string, self::$cipherAlgorithm, $key, OPENSSL_RAW_DATA, $iv);
315 315
         // Merge initialisation vector and encrypted data.
316
-        if ($encrypted !== false) {
316
+        if ($encrypted !== FALSE) {
317 317
             $encrypted = base64_encode($iv . $encrypted);
318 318
         }
319 319
         return $encrypted;
@@ -458,7 +458,7 @@  discard block
 block discarded – undo
458 458
                 $lang = $languageService->getLLL($isoCode, $iso639);
459 459
             }
460 460
         } elseif (\TYPO3_MODE === 'BE') {
461
-            $iso639 = $languageService->includeLLFile($file, false, true);
461
+            $iso639 = $languageService->includeLLFile($file, FALSE, TRUE);
462 462
             if (!empty($iso639['default'][$isoCode])) {
463 463
                 $lang = $languageService->getLLL($isoCode, $iso639);
464 464
             }
@@ -605,7 +605,7 @@  discard block
 block discarded – undo
605 605
     public static function isValidHttpUrl($url)
606 606
     {
607 607
         if (!GeneralUtility::isValidUrl($url)) {
608
-            return false;
608
+            return FALSE;
609 609
         }
610 610
 
611 611
         $parsed = parse_url($url);
@@ -629,7 +629,7 @@  discard block
 block discarded – undo
629 629
      *
630 630
      * @return array Merged array
631 631
      */
632
-    public static function mergeRecursiveWithOverrule(array $original, array $overrule, $addKeys = true, $includeEmptyValues = true, $enableUnsetFeature = true)
632
+    public static function mergeRecursiveWithOverrule(array $original, array $overrule, $addKeys = TRUE, $includeEmptyValues = TRUE, $enableUnsetFeature = TRUE)
633 633
     {
634 634
         \TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule($original, $overrule, $addKeys, $includeEmptyValues, $enableUnsetFeature);
635 635
         return $original;
@@ -701,7 +701,7 @@  discard block
 block discarded – undo
701 701
             ->where(
702 702
                 $queryBuilder->expr()->eq($table . '.pid', $pid),
703 703
                 $queryBuilder->expr()->eq($table . '.index_name', $queryBuilder->expr()->literal($index_name)),
704
-                self::whereExpression($table, true)
704
+                self::whereExpression($table, TRUE)
705 705
             )
706 706
             ->setMaxResults(1)
707 707
             ->execute();
@@ -719,7 +719,7 @@  discard block
 block discarded – undo
719 719
                     $queryBuilder->expr()->eq($table . '.pid', $pid),
720 720
                     $queryBuilder->expr()->eq($table . '.uid', $resArray['l18n_parent']),
721 721
                     $queryBuilder->expr()->eq($table . '.sys_language_uid', intval($languageAspect->getContentId())),
722
-                    self::whereExpression($table, true)
722
+                    self::whereExpression($table, TRUE)
723 723
                 )
724 724
                 ->setMaxResults(1)
725 725
                 ->execute();
@@ -754,7 +754,7 @@  discard block
 block discarded – undo
754 754
                     ->where(
755 755
                         $queryBuilder->expr()->eq($table . '.pid', $pid),
756 756
                         $additionalWhere,
757
-                        self::whereExpression($table, true)
757
+                        self::whereExpression($table, TRUE)
758 758
                     )
759 759
                     ->setMaxResults(10000)
760 760
                     ->execute();
@@ -794,7 +794,7 @@  discard block
 block discarded – undo
794 794
      *
795 795
      * @return string Additional WHERE expression
796 796
      */
797
-    public static function whereExpression($table, $showHidden = false)
797
+    public static function whereExpression($table, $showHidden = FALSE)
798 798
     {
799 799
         if (\TYPO3_MODE === 'FE') {
800 800
             // Should we ignore the record's hidden flag?
@@ -863,13 +863,13 @@  discard block
 block discarded – undo
863 863
         $frameworkConfiguration = $configurationManager->getConfiguration(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK);
864 864
 
865 865
         $extbaseClassmap = &$frameworkConfiguration['persistence']['classes'];
866
-        if ($extbaseClassmap === null) {
866
+        if ($extbaseClassmap === NULL) {
867 867
             $extbaseClassmap = [];
868 868
         }
869 869
 
870 870
         foreach ($classes as $className => $classConfig) {
871 871
             $extbaseClass = &$extbaseClassmap[$className];
872
-            if ($extbaseClass === null) {
872
+            if ($extbaseClass === NULL) {
873 873
                 $extbaseClass = [];
874 874
             }
875 875
             if (!isset($extbaseClass['mapping'])) {
@@ -895,7 +895,7 @@  discard block
 block discarded – undo
895 895
     public static function getUrl(string $url)
896 896
     {
897 897
         if (!Helper::isValidHttpUrl($url)) {
898
-            return false;
898
+            return FALSE;
899 899
         }
900 900
 
901 901
         // Get extension configuration.
@@ -913,7 +913,7 @@  discard block
 block discarded – undo
913 913
             $response = $requestFactory->request($url, 'GET', $configuration);
914 914
         } catch (\Exception $e) {
915 915
             self::log('Could not fetch data from URL "' . $url . '". Error: ' . $e->getMessage() . '.', LOG_SEVERITY_WARNING);
916
-            return false;
916
+            return FALSE;
917 917
         }
918 918
         $content  = $response->getBody()->getContents();
919 919
 
Please login to merge, or discard this patch.