Passed
Pull Request — master (#123)
by
unknown
05:28 queued 29s
created
Configuration/TCA/Overrides/tt_content.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -16,67 +16,67 @@
 block discarded – undo
16 16
 // Plugin "audioplayer".
17 17
 $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['dlf_audioplayer'] = 'layout,select_key,pages,recursive';
18 18
 $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['dlf_audioplayer'] = 'pi_flexform';
19
-\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_audioplayer', 'FILE:EXT:' . 'dlf/Configuration/FlexForms/AudioPlayer.xml');
19
+\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_audioplayer', 'FILE:EXT:'.'dlf/Configuration/FlexForms/AudioPlayer.xml');
20 20
 // Plugin "basket".
21 21
 $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['dlf_basket'] = 'layout,select_key,pages,recursive';
22 22
 $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['dlf_basket'] = 'pi_flexform';
23
-\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_basket', 'FILE:EXT:' . 'dlf/Configuration/FlexForms/Basket.xml');
23
+\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_basket', 'FILE:EXT:'.'dlf/Configuration/FlexForms/Basket.xml');
24 24
 // Plugin "calendar".
25 25
 $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['dlf_calendar'] = 'layout,select_key,pages,recursive';
26 26
 $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['dlf_calendar'] = 'pi_flexform';
27
-\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_calendar', 'FILE:EXT:' . 'dlf/Configuration/FlexForms/Calendar.xml');
27
+\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_calendar', 'FILE:EXT:'.'dlf/Configuration/FlexForms/Calendar.xml');
28 28
 // Plugin "collection".
29 29
 $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['dlf_collection'] = 'layout,select_key,pages,recursive';
30 30
 $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['dlf_collection'] = 'pi_flexform';
31
-\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_collection', 'FILE:EXT:' . 'dlf/Configuration/FlexForms/Collection.xml');
31
+\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_collection', 'FILE:EXT:'.'dlf/Configuration/FlexForms/Collection.xml');
32 32
 // Plugin "feeds".
33 33
 $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['dlf_feeds'] = 'layout,select_key,pages,recursive';
34 34
 $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['dlf_feeds'] = 'pi_flexform';
35
-\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_feeds', 'FILE:EXT:' . 'dlf/Configuration/FlexForms/Feeds.xml');
35
+\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_feeds', 'FILE:EXT:'.'dlf/Configuration/FlexForms/Feeds.xml');
36 36
 // Plugin "listview".
37 37
 $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['dlf_listview'] = 'layout,select_key,pages,recursive';
38 38
 $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['dlf_listview'] = 'pi_flexform';
39
-\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_listview', 'FILE:EXT:' . 'dlf/Configuration/FlexForms/ListView.xml');
39
+\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_listview', 'FILE:EXT:'.'dlf/Configuration/FlexForms/ListView.xml');
40 40
 // Plugin "metadata".
41 41
 $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['dlf_metadata'] = 'layout,select_key,pages,recursive';
42 42
 $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['dlf_metadata'] = 'pi_flexform';
43
-\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_metadata', 'FILE:EXT:' . 'dlf/Configuration/FlexForms/Metadata.xml');
43
+\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_metadata', 'FILE:EXT:'.'dlf/Configuration/FlexForms/Metadata.xml');
44 44
 // Plugin "navigation".
45 45
 $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['dlf_navigation'] = 'layout,select_key,pages,recursive';
46 46
 $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['dlf_navigation'] = 'pi_flexform';
47
-\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_navigation', 'FILE:EXT:' . 'dlf/Configuration/FlexForms/Navigation.xml');
47
+\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_navigation', 'FILE:EXT:'.'dlf/Configuration/FlexForms/Navigation.xml');
48 48
 // Plugin "oaipmh".
49 49
 $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['dlf_oaipmh'] = 'layout,select_key,pages,recursive';
50 50
 $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['dlf_oaipmh'] = 'pi_flexform';
51
-\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_oaipmh', 'FILE:EXT:' . 'dlf/Configuration/FlexForms/OaiPmh.xml');
51
+\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_oaipmh', 'FILE:EXT:'.'dlf/Configuration/FlexForms/OaiPmh.xml');
52 52
 // Plugin "pagegrid".
53 53
 $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['dlf_pagegrid'] = 'layout,select_key,pages,recursive';
54 54
 $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['dlf_pagegrid'] = 'pi_flexform';
55
-\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_pagegrid', 'FILE:EXT:' . 'dlf/Configuration/FlexForms/PageGrid.xml');
55
+\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_pagegrid', 'FILE:EXT:'.'dlf/Configuration/FlexForms/PageGrid.xml');
56 56
 // Plugin "pageview".
57 57
 $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['dlf_pageview'] = 'layout,select_key,pages,recursive';
58 58
 $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['dlf_pageview'] = 'pi_flexform';
59
-\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_pageview', 'FILE:EXT:' . 'dlf/Configuration/FlexForms/PageView.xml');
59
+\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_pageview', 'FILE:EXT:'.'dlf/Configuration/FlexForms/PageView.xml');
60 60
 // Plugin "search".
61 61
 $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['dlf_search'] = 'layout,select_key,pages,recursive';
62 62
 $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['dlf_search'] = 'pi_flexform';
63
-\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_search', 'FILE:EXT:' . 'dlf/Configuration/FlexForms/Search.xml');
63
+\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_search', 'FILE:EXT:'.'dlf/Configuration/FlexForms/Search.xml');
64 64
 // Plugin "statistics".
65 65
 $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['dlf_statistics'] = 'layout,select_key,pages,recursive';
66 66
 $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['dlf_statistics'] = 'pi_flexform';
67
-\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_statistics', 'FILE:EXT:' . 'dlf/Configuration/FlexForms/Statistics.xml');
67
+\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_statistics', 'FILE:EXT:'.'dlf/Configuration/FlexForms/Statistics.xml');
68 68
 // Plugin "tableofcontents".
69 69
 $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['dlf_tableofcontents'] = 'layout,select_key,pages,recursive';
70 70
 $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['dlf_tableofcontents'] = 'pi_flexform';
71
-\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_tableofcontents', 'FILE:EXT:' . 'dlf/Configuration/FlexForms/TableOfContents.xml');
71
+\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_tableofcontents', 'FILE:EXT:'.'dlf/Configuration/FlexForms/TableOfContents.xml');
72 72
 // Plugin "toolbox".
73 73
 $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['dlf_toolbox'] = 'layout,select_key,pages,recursive';
74 74
 $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['dlf_toolbox'] = 'pi_flexform';
75
-\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_toolbox', 'FILE:EXT:' . 'dlf/Configuration/FlexForms/Toolbox.xml');
75
+\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_toolbox', 'FILE:EXT:'.'dlf/Configuration/FlexForms/Toolbox.xml');
76 76
 // Plugin "view3d".
77 77
 $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['dlf_view3d'] = 'layout,select_key,pages,recursive';
78 78
 $GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['dlf_view3d'] = 'pi_flexform';
79
-\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_view3d', 'FILE:EXT:' . 'dlf/Configuration/FlexForms/View3D.xml');
79
+\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('dlf_view3d', 'FILE:EXT:'.'dlf/Configuration/FlexForms/View3D.xml');
80 80
 
81 81
 \TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin(
82 82
     'Dlf',
Please login to merge, or discard this patch.
Classes/Common/Helper.php 3 patches
Braces   +9 added lines, -18 removed lines patch added patch discarded remove patch
@@ -38,8 +38,7 @@  discard block
 block discarded – undo
38 38
  *
39 39
  * @access public
40 40
  */
41
-class Helper
42
-{
41
+class Helper {
43 42
     /**
44 43
      * @access public
45 44
      * @static
@@ -199,8 +198,7 @@  discard block
 block discarded – undo
199 198
      *
200 199
      * @return mixed The decrypted value or false on error
201 200
      */
202
-    public static function decrypt(string $encrypted)
203
-    {
201
+    public static function decrypt(string $encrypted) {
204 202
         if (
205 203
             !in_array(self::$cipherAlgorithm, openssl_get_cipher_methods(true))
206 204
             || !in_array(self::$hashAlgorithm, openssl_get_md_methods(true))
@@ -240,8 +238,7 @@  discard block
 block discarded – undo
240 238
      *
241 239
      * @return \SimpleXMLElement|false
242 240
      */
243
-    public static function getXmlFileAsString($content)
244
-    {
241
+    public static function getXmlFileAsString($content) {
245 242
         // Don't make simplexml_load_string throw (when $content is an array
246 243
         // or object)
247 244
         if (!is_string($content)) {
@@ -313,8 +310,7 @@  discard block
 block discarded – undo
313 310
      *
314 311
      * @return mixed Hashed string or false on error
315 312
      */
316
-    public static function digest(string $string)
317
-    {
313
+    public static function digest(string $string) {
318 314
         if (!in_array(self::$hashAlgorithm, openssl_get_md_methods(true))) {
319 315
             self::log('OpenSSL library doesn\'t support hash algorithm', LOG_SEVERITY_ERROR);
320 316
             return false;
@@ -334,8 +330,7 @@  discard block
 block discarded – undo
334 330
      *
335 331
      * @return mixed Encrypted string or false on error
336 332
      */
337
-    public static function encrypt(string $string)
338
-    {
333
+    public static function encrypt(string $string) {
339 334
         if (
340 335
             !in_array(self::$cipherAlgorithm, openssl_get_cipher_methods(true))
341 336
             || !in_array(self::$hashAlgorithm, openssl_get_md_methods(true))
@@ -705,8 +700,7 @@  discard block
 block discarded – undo
705 700
      *
706 701
      * @return array Array of substituted "NEW..." identifiers and their actual UIDs.
707 702
      */
708
-    public static function processDatabaseAsAdmin(array $data = [], array $cmd = [], $reverseOrder = false, $cmdFirst = false)
709
-    {
703
+    public static function processDatabaseAsAdmin(array $data = [], array $cmd = [], $reverseOrder = false, $cmdFirst = false) {
710 704
         $context = GeneralUtility::makeInstance(Context::class);
711 705
 
712 706
         if (
@@ -945,8 +939,7 @@  discard block
 block discarded – undo
945 939
      *
946 940
      * @return void
947 941
      */
948
-    private function __construct()
949
-    {
942
+    private function __construct() {
950 943
         // This is a static class, thus no instances should be created.
951 944
     }
952 945
 
@@ -977,8 +970,7 @@  discard block
 block discarded – undo
977 970
      *
978 971
      * @return string|bool
979 972
      */
980
-    public static function getUrl(string $url)
981
-    {
973
+    public static function getUrl(string $url) {
982 974
         if (!Helper::isValidHttpUrl($url)) {
983 975
             return false;
984 976
         }
@@ -1059,8 +1051,7 @@  discard block
 block discarded – undo
1059 1051
      *
1060 1052
      * @return mixed
1061 1053
      */
1062
-    private static function getLocalConfigurationByPath(string $path)
1063
-    {
1054
+    private static function getLocalConfigurationByPath(string $path) {
1064 1055
         $configurationManager = GeneralUtility::makeInstance(ConfigurationManager::class);
1065 1056
         return $configurationManager->getLocalConfigurationValueByPath($path);
1066 1057
     }
Please login to merge, or discard this patch.
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
                 } elseif ($checksum == 10) {
149 149
                     //TODO: Binary operation "+" between string and 1 results in an error.
150 150
                     // @phpstan-ignore-next-line
151
-                    return self::checkIdentifier(($digits + 1) . substr($id, -2, 2), 'SWD');
151
+                    return self::checkIdentifier(($digits + 1).substr($id, -2, 2), 'SWD');
152 152
                 } elseif (substr($id, -1, 1) != $checksum) {
153 153
                     return false;
154 154
                 }
@@ -354,7 +354,7 @@  discard block
 block discarded – undo
354 354
         $encrypted = openssl_encrypt($string, self::$cipherAlgorithm, $key, OPENSSL_RAW_DATA, $iv);
355 355
         // Merge initialization vector and encrypted data.
356 356
         if ($encrypted !== false) {
357
-            $encrypted = base64_encode($iv . $encrypted);
357
+            $encrypted = base64_encode($iv.$encrypted);
358 358
         }
359 359
         return $encrypted;
360 360
     }
@@ -396,8 +396,8 @@  discard block
 block discarded – undo
396 396
     public static function getHookObjects(string $scriptRelPath): array
397 397
     {
398 398
         $hookObjects = [];
399
-        if (is_array(self::getOptions()[self::$extKey . '/' . $scriptRelPath]['hookClass'])) {
400
-            foreach (self::getOptions()[self::$extKey . '/' . $scriptRelPath]['hookClass'] as $classRef) {
399
+        if (is_array(self::getOptions()[self::$extKey.'/'.$scriptRelPath]['hookClass'])) {
400
+            foreach (self::getOptions()[self::$extKey.'/'.$scriptRelPath]['hookClass'] as $classRef) {
401 401
                 $hookObjects[] = GeneralUtility::makeInstance($classRef);
402 402
             }
403 403
         }
@@ -426,12 +426,12 @@  discard block
 block discarded – undo
426 426
             // NOTE: Only use tables that don't have too many entries!
427 427
             || !in_array($table, ['tx_dlf_collections', 'tx_dlf_libraries', 'tx_dlf_metadata', 'tx_dlf_structures', 'tx_dlf_solrcores'])
428 428
         ) {
429
-            self::log('Invalid UID "' . $uid . '" or table "' . $table . '"', LOG_SEVERITY_ERROR);
429
+            self::log('Invalid UID "'.$uid.'" or table "'.$table.'"', LOG_SEVERITY_ERROR);
430 430
             return '';
431 431
         }
432 432
 
433
-        $makeCacheKey = function ($pid, $uid) {
434
-            return $pid . '.' . $uid;
433
+        $makeCacheKey = function($pid, $uid) {
434
+            return $pid.'.'.$uid;
435 435
         };
436 436
 
437 437
         static $cache = [];
@@ -441,9 +441,9 @@  discard block
 block discarded – undo
441 441
 
442 442
             $result = $queryBuilder
443 443
                 ->select(
444
-                    $table . '.index_name AS index_name',
445
-                    $table . '.uid AS uid',
446
-                    $table . '.pid AS pid',
444
+                    $table.'.index_name AS index_name',
445
+                    $table.'.uid AS uid',
446
+                    $table.'.pid AS pid',
447 447
                 )
448 448
                 ->from($table)
449 449
                 ->execute();
@@ -461,7 +461,7 @@  discard block
 block discarded – undo
461 461
         $result = $cache[$table][$cacheKey] ?? '';
462 462
 
463 463
         if ($result === '') {
464
-            self::log('No "index_name" with UID ' . $uid . ' and PID ' . $pid . ' found in table "' . $table . '"', LOG_SEVERITY_WARNING);
464
+            self::log('No "index_name" with UID '.$uid.' and PID '.$pid.' found in table "'.$table.'"', LOG_SEVERITY_WARNING);
465 465
         }
466 466
 
467 467
         return $result;
@@ -490,11 +490,11 @@  discard block
 block discarded – undo
490 490
             // No ISO code, return unchanged.
491 491
             return $code;
492 492
         }
493
-        $lang = LocalizationUtility::translate('LLL:' . $file . ':' . $code);
493
+        $lang = LocalizationUtility::translate('LLL:'.$file.':'.$code);
494 494
         if (!empty($lang)) {
495 495
             return $lang;
496 496
         } else {
497
-            self::log('Language code "' . $code . '" not found in ISO-639 table', LOG_SEVERITY_NOTICE);
497
+            self::log('Language code "'.$code.'" not found in ISO-639 table', LOG_SEVERITY_NOTICE);
498 498
             return $code;
499 499
         }
500 500
     }
@@ -658,7 +658,7 @@  discard block
 block discarded – undo
658 658
         // Sanitize input.
659 659
         $pid = max((int) $pid, 0);
660 660
         if (!$pid) {
661
-            self::log('Invalid PID ' . $pid . ' for translation', LOG_SEVERITY_WARNING);
661
+            self::log('Invalid PID '.$pid.' for translation', LOG_SEVERITY_WARNING);
662 662
             return $indexName;
663 663
         }
664 664
         /** @var PageRepository $pageRepository */
@@ -681,13 +681,13 @@  discard block
 block discarded – undo
681 681
         // First fetch the uid of the received index_name
682 682
         $result = $queryBuilder
683 683
             ->select(
684
-                $table . '.uid AS uid',
685
-                $table . '.l18n_parent AS l18n_parent'
684
+                $table.'.uid AS uid',
685
+                $table.'.l18n_parent AS l18n_parent'
686 686
             )
687 687
             ->from($table)
688 688
             ->where(
689
-                $queryBuilder->expr()->eq($table . '.pid', $pid),
690
-                $queryBuilder->expr()->eq($table . '.index_name', $queryBuilder->expr()->literal($indexName)),
689
+                $queryBuilder->expr()->eq($table.'.pid', $pid),
690
+                $queryBuilder->expr()->eq($table.'.index_name', $queryBuilder->expr()->literal($indexName)),
691 691
                 self::whereExpression($table, true)
692 692
             )
693 693
             ->setMaxResults(1)
@@ -698,12 +698,12 @@  discard block
 block discarded – undo
698 698
         if ($row) {
699 699
             // Now we use the uid of the l18_parent to fetch the index_name of the translated content element.
700 700
             $result = $queryBuilder
701
-                ->select($table . '.index_name AS index_name')
701
+                ->select($table.'.index_name AS index_name')
702 702
                 ->from($table)
703 703
                 ->where(
704
-                    $queryBuilder->expr()->eq($table . '.pid', $pid),
705
-                    $queryBuilder->expr()->eq($table . '.uid', $row['l18n_parent']),
706
-                    $queryBuilder->expr()->eq($table . '.sys_language_uid', (int) $languageContentId),
704
+                    $queryBuilder->expr()->eq($table.'.pid', $pid),
705
+                    $queryBuilder->expr()->eq($table.'.uid', $row['l18n_parent']),
706
+                    $queryBuilder->expr()->eq($table.'.sys_language_uid', (int) $languageContentId),
707 707
                     self::whereExpression($table, true)
708 708
                 )
709 709
                 ->setMaxResults(1)
@@ -721,14 +721,14 @@  discard block
 block discarded – undo
721 721
         if (empty($labels[$table][$pid][$languageContentId][$indexName])) {
722 722
             // Check if this table is allowed for translation.
723 723
             if (in_array($table, ['tx_dlf_collections', 'tx_dlf_libraries', 'tx_dlf_metadata', 'tx_dlf_structures'])) {
724
-                $additionalWhere = $queryBuilder->expr()->in($table . '.sys_language_uid', [-1, 0]);
724
+                $additionalWhere = $queryBuilder->expr()->in($table.'.sys_language_uid', [-1, 0]);
725 725
                 if ($languageContentId > 0) {
726 726
                     $additionalWhere = $queryBuilder->expr()->andX(
727 727
                         $queryBuilder->expr()->orX(
728
-                            $queryBuilder->expr()->in($table . '.sys_language_uid', [-1, 0]),
729
-                            $queryBuilder->expr()->eq($table . '.sys_language_uid', (int) $languageContentId)
728
+                            $queryBuilder->expr()->in($table.'.sys_language_uid', [-1, 0]),
729
+                            $queryBuilder->expr()->eq($table.'.sys_language_uid', (int) $languageContentId)
730 730
                         ),
731
-                        $queryBuilder->expr()->eq($table . '.l18n_parent', 0)
731
+                        $queryBuilder->expr()->eq($table.'.l18n_parent', 0)
732 732
                     );
733 733
                 }
734 734
 
@@ -737,7 +737,7 @@  discard block
 block discarded – undo
737 737
                     ->select('*')
738 738
                     ->from($table)
739 739
                     ->where(
740
-                        $queryBuilder->expr()->eq($table . '.pid', $pid),
740
+                        $queryBuilder->expr()->eq($table.'.pid', $pid),
741 741
                         $additionalWhere,
742 742
                         self::whereExpression($table, true)
743 743
                     )
@@ -755,10 +755,10 @@  discard block
 block discarded – undo
755 755
                         }
756 756
                     }
757 757
                 } else {
758
-                    self::log('No translation with PID ' . $pid . ' available in table "' . $table . '" or translation not accessible', LOG_SEVERITY_NOTICE);
758
+                    self::log('No translation with PID '.$pid.' available in table "'.$table.'" or translation not accessible', LOG_SEVERITY_NOTICE);
759 759
                 }
760 760
             } else {
761
-                self::log('No translations available for table "' . $table . '"', LOG_SEVERITY_WARNING);
761
+                self::log('No translations available for table "'.$table.'"', LOG_SEVERITY_WARNING);
762 762
             }
763 763
         }
764 764
 
@@ -804,7 +804,7 @@  discard block
 block discarded – undo
804 804
             return GeneralUtility::makeInstance(ConnectionPool::class)
805 805
                 ->getQueryBuilderForTable($table)
806 806
                 ->expr()
807
-                ->eq($table . '.' . $GLOBALS['TCA'][$table]['ctrl']['delete'], 0);
807
+                ->eq($table.'.'.$GLOBALS['TCA'][$table]['ctrl']['delete'], 0);
808 808
         } else {
809 809
             self::log('Unexpected TYPO3_MODE', LOG_SEVERITY_ERROR);
810 810
             return '1=-1';
@@ -870,7 +870,7 @@  discard block
 block discarded – undo
870 870
         try {
871 871
             $response = $requestFactory->request($url, 'GET', $configuration);
872 872
         } catch (\Exception $e) {
873
-            self::log('Could not fetch data from URL "' . $url . '". Error: ' . $e->getMessage() . '.', LOG_SEVERITY_WARNING);
873
+            self::log('Could not fetch data from URL "'.$url.'". Error: '.$e->getMessage().'.', LOG_SEVERITY_WARNING);
874 874
             return false;
875 875
         }
876 876
         return $response->getBody()->getContents();
Please login to merge, or discard this patch.
Upper-Lower-Casing   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
      *
88 88
      * @return FlashMessageQueue The queue the message was added to
89 89
      */
90
-    public static function addMessage(string $message, string $title, int $severity, bool $session = false, string $queue = 'kitodo.default.flashMessages'): FlashMessageQueue
90
+    public static function addMessage(string $message, string $title, int $severity, bool $session = FALSE, string $queue = 'kitodo.default.flashMessages'): FlashMessageQueue
91 91
     {
92 92
         $flashMessageService = GeneralUtility::makeInstance(FlashMessageService::class);
93 93
         $flashMessageQueue = $flashMessageService->getMessageQueueByIdentifier($queue);
@@ -126,9 +126,9 @@  discard block
 block discarded – undo
126 126
                     $checksum = 'X';
127 127
                 }
128 128
                 if (!preg_match('/\d{8}[\dX]{1}/i', $id)) {
129
-                    return false;
129
+                    return FALSE;
130 130
                 } elseif (strtoupper(substr($id, -1, 1)) != $checksum) {
131
-                    return false;
131
+                    return FALSE;
132 132
                 }
133 133
                 break;
134 134
             case 'ZDB':
@@ -136,21 +136,21 @@  discard block
 block discarded – undo
136 136
                     $checksum = 'X';
137 137
                 }
138 138
                 if (!preg_match('/\d{8}-[\dX]{1}/i', $id)) {
139
-                    return false;
139
+                    return FALSE;
140 140
                 } elseif (strtoupper(substr($id, -1, 1)) != $checksum) {
141
-                    return false;
141
+                    return FALSE;
142 142
                 }
143 143
                 break;
144 144
             case 'SWD':
145 145
                 $checksum = 11 - $checksum;
146 146
                 if (!preg_match('/\d{8}-\d{1}/i', $id)) {
147
-                    return false;
147
+                    return FALSE;
148 148
                 } elseif ($checksum == 10) {
149 149
                     //TODO: Binary operation "+" between string and 1 results in an error.
150 150
                     // @phpstan-ignore-next-line
151 151
                     return self::checkIdentifier(($digits + 1) . substr($id, -2, 2), 'SWD');
152 152
                 } elseif (substr($id, -1, 1) != $checksum) {
153
-                    return false;
153
+                    return FALSE;
154 154
                 }
155 155
                 break;
156 156
             case 'GKD':
@@ -159,13 +159,13 @@  discard block
 block discarded – undo
159 159
                     $checksum = 'X';
160 160
                 }
161 161
                 if (!preg_match('/\d{8}-[\dX]{1}/i', $id)) {
162
-                    return false;
162
+                    return FALSE;
163 163
                 } elseif (strtoupper(substr($id, -1, 1)) != $checksum) {
164
-                    return false;
164
+                    return FALSE;
165 165
                 }
166 166
                 break;
167 167
         }
168
-        return true;
168
+        return TRUE;
169 169
     }
170 170
 
171 171
     /**
@@ -202,28 +202,28 @@  discard block
 block discarded – undo
202 202
     public static function decrypt(string $encrypted)
203 203
     {
204 204
         if (
205
-            !in_array(self::$cipherAlgorithm, openssl_get_cipher_methods(true))
206
-            || !in_array(self::$hashAlgorithm, openssl_get_md_methods(true))
205
+            !in_array(self::$cipherAlgorithm, openssl_get_cipher_methods(TRUE))
206
+            || !in_array(self::$hashAlgorithm, openssl_get_md_methods(TRUE))
207 207
         ) {
208 208
             self::log('OpenSSL library doesn\'t support cipher and/or hash algorithm', LOG_SEVERITY_ERROR);
209
-            return false;
209
+            return FALSE;
210 210
         }
211 211
         if (empty(self::getEncryptionKey())) {
212 212
             self::log('No encryption key set in TYPO3 configuration', LOG_SEVERITY_ERROR);
213
-            return false;
213
+            return FALSE;
214 214
         }
215 215
         if (
216 216
             empty($encrypted)
217 217
             || strlen($encrypted) < openssl_cipher_iv_length(self::$cipherAlgorithm)
218 218
         ) {
219 219
             self::log('Invalid parameters given for decryption', LOG_SEVERITY_ERROR);
220
-            return false;
220
+            return FALSE;
221 221
         }
222 222
         // Split initialisation vector and encrypted data.
223 223
         $binary = base64_decode($encrypted);
224 224
         $iv = substr($binary, 0, openssl_cipher_iv_length(self::$cipherAlgorithm));
225 225
         $data = substr($binary, openssl_cipher_iv_length(self::$cipherAlgorithm));
226
-        $key = openssl_digest(self::getEncryptionKey(), self::$hashAlgorithm, true);
226
+        $key = openssl_digest(self::getEncryptionKey(), self::$hashAlgorithm, TRUE);
227 227
         // Decrypt data.
228 228
         return openssl_decrypt($data, self::$cipherAlgorithm, $key, OPENSSL_RAW_DATA, $iv);
229 229
     }
@@ -245,15 +245,15 @@  discard block
 block discarded – undo
245 245
         // Don't make simplexml_load_string throw (when $content is an array
246 246
         // or object)
247 247
         if (!is_string($content)) {
248
-            return false;
248
+            return FALSE;
249 249
         }
250 250
 
251 251
         // Turn off libxml's error logging.
252
-        $libxmlErrors = libxml_use_internal_errors(true);
252
+        $libxmlErrors = libxml_use_internal_errors(TRUE);
253 253
 
254 254
         if (\PHP_VERSION_ID < 80000) {
255 255
             // Disables the functionality to allow external entities to be loaded when parsing the XML, must be kept
256
-            $previousValueOfEntityLoader = libxml_disable_entity_loader(true);
256
+            $previousValueOfEntityLoader = libxml_disable_entity_loader(TRUE);
257 257
         }
258 258
 
259 259
         // Try to load XML from file.
@@ -315,9 +315,9 @@  discard block
 block discarded – undo
315 315
      */
316 316
     public static function digest(string $string)
317 317
     {
318
-        if (!in_array(self::$hashAlgorithm, openssl_get_md_methods(true))) {
318
+        if (!in_array(self::$hashAlgorithm, openssl_get_md_methods(TRUE))) {
319 319
             self::log('OpenSSL library doesn\'t support hash algorithm', LOG_SEVERITY_ERROR);
320
-            return false;
320
+            return FALSE;
321 321
         }
322 322
         // Hash string.
323 323
         return openssl_digest($string, self::$hashAlgorithm);
@@ -337,23 +337,23 @@  discard block
 block discarded – undo
337 337
     public static function encrypt(string $string)
338 338
     {
339 339
         if (
340
-            !in_array(self::$cipherAlgorithm, openssl_get_cipher_methods(true))
341
-            || !in_array(self::$hashAlgorithm, openssl_get_md_methods(true))
340
+            !in_array(self::$cipherAlgorithm, openssl_get_cipher_methods(TRUE))
341
+            || !in_array(self::$hashAlgorithm, openssl_get_md_methods(TRUE))
342 342
         ) {
343 343
             self::log('OpenSSL library doesn\'t support cipher and/or hash algorithm', LOG_SEVERITY_ERROR);
344
-            return false;
344
+            return FALSE;
345 345
         }
346 346
         if (empty(self::getEncryptionKey())) {
347 347
             self::log('No encryption key set in TYPO3 configuration', LOG_SEVERITY_ERROR);
348
-            return false;
348
+            return FALSE;
349 349
         }
350 350
         // Generate random initialization vector.
351 351
         $iv = openssl_random_pseudo_bytes(openssl_cipher_iv_length(self::$cipherAlgorithm));
352
-        $key = openssl_digest(self::getEncryptionKey(), self::$hashAlgorithm, true);
352
+        $key = openssl_digest(self::getEncryptionKey(), self::$hashAlgorithm, TRUE);
353 353
         // Encrypt data.
354 354
         $encrypted = openssl_encrypt($string, self::$cipherAlgorithm, $key, OPENSSL_RAW_DATA, $iv);
355 355
         // Merge initialization vector and encrypted data.
356
-        if ($encrypted !== false) {
356
+        if ($encrypted !== FALSE) {
357 357
             $encrypted = base64_encode($iv . $encrypted);
358 358
         }
359 359
         return $encrypted;
@@ -554,7 +554,7 @@  discard block
 block discarded – undo
554 554
     public static function isValidHttpUrl(string $url): bool
555 555
     {
556 556
         if (!GeneralUtility::isValidUrl($url)) {
557
-            return false;
557
+            return FALSE;
558 558
         }
559 559
 
560 560
         try {
@@ -562,7 +562,7 @@  discard block
 block discarded – undo
562 562
             return !empty($uri->getScheme());
563 563
         } catch (\InvalidArgumentException $e) {
564 564
             self::log($e->getMessage(), LOG_SEVERITY_ERROR);
565
-            return false;
565
+            return FALSE;
566 566
         }
567 567
     }
568 568
 
@@ -578,7 +578,7 @@  discard block
 block discarded – undo
578 578
      *
579 579
      * @return array Array of substituted "NEW..." identifiers and their actual UIDs.
580 580
      */
581
-    public static function processDatabaseAsAdmin(array $data = [], array $cmd = [], $reverseOrder = false, $cmdFirst = false)
581
+    public static function processDatabaseAsAdmin(array $data = [], array $cmd = [], $reverseOrder = FALSE, $cmdFirst = FALSE)
582 582
     {
583 583
         $context = GeneralUtility::makeInstance(Context::class);
584 584
 
@@ -589,7 +589,7 @@  discard block
 block discarded – undo
589 589
             // Instantiate TYPO3 core engine.
590 590
             $dataHandler = GeneralUtility::makeInstance(DataHandler::class);
591 591
             // We do not use workspaces and have to bypass restrictions in DataHandler.
592
-            $dataHandler->bypassWorkspaceRestrictions = true;
592
+            $dataHandler->bypassWorkspaceRestrictions = TRUE;
593 593
             // Load data and command arrays.
594 594
             $dataHandler->start($data, $cmd);
595 595
             // Process command map first if default order is reversed.
@@ -688,7 +688,7 @@  discard block
 block discarded – undo
688 688
             ->where(
689 689
                 $queryBuilder->expr()->eq($table . '.pid', $pid),
690 690
                 $queryBuilder->expr()->eq($table . '.index_name', $queryBuilder->expr()->literal($indexName)),
691
-                self::whereExpression($table, true)
691
+                self::whereExpression($table, TRUE)
692 692
             )
693 693
             ->setMaxResults(1)
694 694
             ->execute();
@@ -704,7 +704,7 @@  discard block
 block discarded – undo
704 704
                     $queryBuilder->expr()->eq($table . '.pid', $pid),
705 705
                     $queryBuilder->expr()->eq($table . '.uid', $row['l18n_parent']),
706 706
                     $queryBuilder->expr()->eq($table . '.sys_language_uid', (int) $languageContentId),
707
-                    self::whereExpression($table, true)
707
+                    self::whereExpression($table, TRUE)
708 708
                 )
709 709
                 ->setMaxResults(1)
710 710
                 ->execute();
@@ -739,7 +739,7 @@  discard block
 block discarded – undo
739 739
                     ->where(
740 740
                         $queryBuilder->expr()->eq($table . '.pid', $pid),
741 741
                         $additionalWhere,
742
-                        self::whereExpression($table, true)
742
+                        self::whereExpression($table, TRUE)
743 743
                     )
744 744
                     ->setMaxResults(10000)
745 745
                     ->execute();
@@ -781,7 +781,7 @@  discard block
 block discarded – undo
781 781
      *
782 782
      * @return string Additional WHERE expression
783 783
      */
784
-    public static function whereExpression(string $table, bool $showHidden = false): string
784
+    public static function whereExpression(string $table, bool $showHidden = FALSE): string
785 785
     {
786 786
         // TODO: Check with applicationType; TYPO3_MODE is removed in v12
787 787
         if (\TYPO3_MODE === 'FE') {
@@ -853,7 +853,7 @@  discard block
 block discarded – undo
853 853
     public static function getUrl(string $url)
854 854
     {
855 855
         if (!Helper::isValidHttpUrl($url)) {
856
-            return false;
856
+            return FALSE;
857 857
         }
858 858
 
859 859
         // Get extension configuration.
@@ -871,7 +871,7 @@  discard block
 block discarded – undo
871 871
             $response = $requestFactory->request($url, 'GET', $configuration);
872 872
         } catch (\Exception $e) {
873 873
             self::log('Could not fetch data from URL "' . $url . '". Error: ' . $e->getMessage() . '.', LOG_SEVERITY_WARNING);
874
-            return false;
874
+            return FALSE;
875 875
         }
876 876
         return $response->getBody()->getContents();
877 877
     }
Please login to merge, or discard this patch.