Passed
Pull Request — master (#123)
by
unknown
04:32
created
Classes/Eid/PageViewProxy.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -34,8 +34,7 @@  discard block
 block discarded – undo
34 34
  *
35 35
  * @access public
36 36
  */
37
-class PageViewProxy
38
-{
37
+class PageViewProxy {
39 38
     /**
40 39
      * @access protected
41 40
      * @var RequestFactory
@@ -55,8 +54,7 @@  discard block
 block discarded – undo
55 54
      *
56 55
      * @return void
57 56
      */
58
-    public function __construct()
59
-    {
57
+    public function __construct() {
60 58
         $this->requestFactory = GeneralUtility::makeInstance(RequestFactory::class);
61 59
         $this->extConf = GeneralUtility::makeInstance(ExtensionConfiguration::class)->get('dlf', 'general');
62 60
     }
Please login to merge, or discard this patch.
Tests/Functional/Common/MetsDocumentTest.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -21,14 +21,14 @@
 block discarded – undo
21 21
     {
22 22
         parent::setUp();
23 23
 
24
-        $this->importCSVDataSet(__DIR__ . '/../../Fixtures/Common/documents_1.csv');
25
-        $this->importCSVDataSet(__DIR__ . '/../../Fixtures/Common/metadata.csv');
26
-        $this->importCSVDataSet(__DIR__ . '/../../Fixtures/MetsDocument/metadata_mets.csv');
24
+        $this->importCSVDataSet(__DIR__.'/../../Fixtures/Common/documents_1.csv');
25
+        $this->importCSVDataSet(__DIR__.'/../../Fixtures/Common/metadata.csv');
26
+        $this->importCSVDataSet(__DIR__.'/../../Fixtures/MetsDocument/metadata_mets.csv');
27 27
     }
28 28
 
29 29
     protected function doc(string $file)
30 30
     {
31
-        $url = 'http://web:8001/Tests/Fixtures/MetsDocument/' . $file;
31
+        $url = 'http://web:8001/Tests/Fixtures/MetsDocument/'.$file;
32 32
         $doc = AbstractDocument::getInstance($url, ['general' => ['useExternalApisForMetadata' => 0]]);
33 33
         self::assertNotNull($doc);
34 34
         return $doc;
Please login to merge, or discard this patch.
Braces   +14 added lines, -28 removed lines patch added patch discarded remove patch
@@ -15,8 +15,7 @@  discard block
 block discarded – undo
15 15
 use Kitodo\Dlf\Common\AbstractDocument;
16 16
 use Kitodo\Dlf\Tests\Functional\FunctionalTestCase;
17 17
 
18
-class MetsDocumentTest extends FunctionalTestCase
19
-{
18
+class MetsDocumentTest extends FunctionalTestCase {
20 19
     public function setUp(): void
21 20
     {
22 21
         parent::setUp();
@@ -26,8 +25,7 @@  discard block
 block discarded – undo
26 25
         $this->importCSVDataSet(__DIR__ . '/../../Fixtures/MetsDocument/metadata_mets.csv');
27 26
     }
28 27
 
29
-    protected function doc(string $file)
30
-    {
28
+    protected function doc(string $file) {
31 29
         $url = 'http://web:8001/Tests/Fixtures/MetsDocument/' . $file;
32 30
         $doc = AbstractDocument::getInstance($url, ['general' => ['useExternalApisForMetadata' => 0]]);
33 31
         self::assertNotNull($doc);
@@ -37,8 +35,7 @@  discard block
 block discarded – undo
37 35
     /**
38 36
      * @test
39 37
      */
40
-    public function canParseDmdAndAmdSec()
41
-    {
38
+    public function canParseDmdAndAmdSec() {
42 39
         $doc = $this->doc('av_beispiel.xml');
43 40
 
44 41
         $toplevelMetadata = $doc->getToplevelMetadata(20000);
@@ -56,8 +53,7 @@  discard block
 block discarded – undo
56 53
     /**
57 54
      * @test
58 55
      */
59
-    public function canReadFileMetadata()
60
-    {
56
+    public function canReadFileMetadata() {
61 57
         $doc = $this->doc('av_beispiel.xml');
62 58
 
63 59
         $thumbsMeta = $doc->getMetadata('FILE_0000_THUMBS', 20000);
@@ -72,8 +68,7 @@  discard block
 block discarded – undo
72 68
     /**
73 69
      * @test
74 70
      */
75
-    public function canGetLogicalStructure()
76
-    {
71
+    public function canGetLogicalStructure() {
77 72
         $doc = $this->doc('av_beispiel.xml');
78 73
 
79 74
         $toc = $doc->tableOfContents[0] ?? [];
@@ -109,8 +104,7 @@  discard block
 block discarded – undo
109 104
     /**
110 105
      * @test
111 106
      */
112
-    public function doesNotOverwriteFirstDmdSec()
113
-    {
107
+    public function doesNotOverwriteFirstDmdSec() {
114 108
         $doc = $this->doc('two_dmdsec.xml');
115 109
 
116 110
         $toplevelMetadata = $doc->getToplevelMetadata(20000);
@@ -123,8 +117,7 @@  discard block
 block discarded – undo
123 117
     /**
124 118
      * @test
125 119
      */
126
-    public function returnsEmptyMetadataWhenNoDmdSec()
127
-    {
120
+    public function returnsEmptyMetadataWhenNoDmdSec() {
128 121
         $doc = $this->doc('two_dmdsec.xml');
129 122
 
130 123
         // DMD and AMD works
@@ -143,8 +136,7 @@  discard block
 block discarded – undo
143 136
     /**
144 137
      * @test
145 138
      */
146
-    public function canGetDownloadLocation()
147
-    {
139
+    public function canGetDownloadLocation() {
148 140
         $doc = $this->doc('two_dmdsec.xml');
149 141
 
150 142
         $correct = $doc->getDownloadLocation('FILE_0000_DOWNLOAD');
@@ -162,8 +154,7 @@  discard block
 block discarded – undo
162 154
     /**
163 155
      * @test
164 156
      */
165
-    public function canGetFileLocation()
166
-    {
157
+    public function canGetFileLocation() {
167 158
         $doc = $this->doc('two_dmdsec.xml');
168 159
 
169 160
         $correct = $doc->getFileLocation('FILE_0000_DEFAULT');
@@ -176,8 +167,7 @@  discard block
 block discarded – undo
176 167
     /**
177 168
      * @test
178 169
      */
179
-    public function canGetFileMimeType()
180
-    {
170
+    public function canGetFileMimeType() {
181 171
         $doc = $this->doc('two_dmdsec.xml');
182 172
 
183 173
         $correct = $doc->getFileMimeType('FILE_0000_DEFAULT');
@@ -191,8 +181,7 @@  discard block
 block discarded – undo
191 181
     /**
192 182
      * @test
193 183
      */
194
-    public function canGetPhysicalPage()
195
-    {
184
+    public function canGetPhysicalPage() {
196 185
         $doc = $this->doc('mets_with_pages.xml');
197 186
 
198 187
         // pass orderlabel and retrieve order
@@ -203,8 +192,7 @@  discard block
 block discarded – undo
203 192
     /**
204 193
      * @test
205 194
      */
206
-    public function canGetTitle()
207
-    {
195
+    public function canGetTitle() {
208 196
         $doc = $this->doc('mets_with_pages.xml');
209 197
 
210 198
         $correct = $doc->getTitle(1001);
@@ -217,8 +205,7 @@  discard block
 block discarded – undo
217 205
     /**
218 206
      * @test
219 207
      */
220
-    public function canGetFullText()
221
-    {
208
+    public function canGetFullText() {
222 209
         $doc = $this->doc('mets_with_pages.xml');
223 210
 
224 211
         $fulltext = $doc->getFullText('PHYS_0003');
@@ -234,8 +221,7 @@  discard block
 block discarded – undo
234 221
     /**
235 222
      * @test
236 223
      */
237
-    public function canGetStructureDepth()
238
-    {
224
+    public function canGetStructureDepth() {
239 225
         $doc = $this->doc('mets_with_pages.xml');
240 226
 
241 227
         $correct = $doc->getStructureDepth('LOG_0001');
Please login to merge, or discard this patch.
Classes/Validation/DocumentValidator.php 4 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -29,10 +29,10 @@
 block discarded – undo
29 29
  */
30 30
 class DocumentValidator
31 31
 {
32
-     /**
33
-     * @access protected
34
-     * @var Logger This holds the logger
35
-     */
32
+        /**
33
+         * @access protected
34
+         * @var Logger This holds the logger
35
+         */
36 36
     protected Logger $logger;
37 37
 
38 38
     /**
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
     {
83 83
         foreach ($this->requiredMetadataFields as $requiredMetadataField) {
84 84
             if (empty($this->metadata[$requiredMetadataField][0])) {
85
-                $this->logger->error('Missing required metadata field "' . $requiredMetadataField . '".');
85
+                $this->logger->error('Missing required metadata field "'.$requiredMetadataField.'".');
86 86
                 return false;
87 87
             }
88 88
         }
@@ -100,14 +100,14 @@  discard block
 block discarded – undo
100 100
      */
101 101
     public function hasCorrectLogicalStructure(string $type): bool
102 102
     {
103
-        $expectedNodes = $this->xml->xpath('./mets:structMap[@TYPE="LOGICAL"]/mets:div[@TYPE="' . $type . '"]');
103
+        $expectedNodes = $this->xml->xpath('./mets:structMap[@TYPE="LOGICAL"]/mets:div[@TYPE="'.$type.'"]');
104 104
         if ($expectedNodes) {
105 105
             return true;
106 106
         }
107 107
 
108 108
         $existingNodes = $this->xml->xpath('./mets:structMap[@TYPE="LOGICAL"]/mets:div');
109 109
         if ($existingNodes) {
110
-            $this->logger->error('Document contains logical structure but @TYPE="' . $type . '" is missing.');
110
+            $this->logger->error('Document contains logical structure but @TYPE="'.$type.'" is missing.');
111 111
             return false;
112 112
         }
113 113
 
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -27,8 +27,7 @@  discard block
 block discarded – undo
27 27
  *
28 28
  * @access public
29 29
  */
30
-class DocumentValidator
31
-{
30
+class DocumentValidator {
32 31
      /**
33 32
      * @access protected
34 33
      * @var Logger This holds the logger
@@ -63,8 +62,7 @@  discard block
 block discarded – undo
63 62
      *
64 63
      * @return void
65 64
      */
66
-    public function __construct(array $metadata = [], array $requiredMetadataFields = [], ?\SimpleXMLElement $xml = null)
67
-    {
65
+    public function __construct(array $metadata = [], array $requiredMetadataFields = [], ?\SimpleXMLElement $xml = null) {
68 66
         $this->logger = GeneralUtility::makeInstance(LogManager::class)->getLogger(static::class);
69 67
         $this->metadata = $metadata;
70 68
         $this->requiredMetadataFields = $requiredMetadataFields;
Please login to merge, or discard this patch.
Upper-Lower-Casing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
      *
64 64
      * @return void
65 65
      */
66
-    public function __construct(array $metadata = [], array $requiredMetadataFields = [], ?\SimpleXMLElement $xml = null)
66
+    public function __construct(array $metadata = [], array $requiredMetadataFields = [], ?\SimpleXMLElement $xml = NULL)
67 67
     {
68 68
         $this->logger = GeneralUtility::makeInstance(LogManager::class)->getLogger(static::class);
69 69
         $this->metadata = $metadata;
@@ -83,10 +83,10 @@  discard block
 block discarded – undo
83 83
         foreach ($this->requiredMetadataFields as $requiredMetadataField) {
84 84
             if (empty($this->metadata[$requiredMetadataField][0])) {
85 85
                 $this->logger->error('Missing required metadata field "' . $requiredMetadataField . '".');
86
-                return false;
86
+                return FALSE;
87 87
             }
88 88
         }
89
-        return true;
89
+        return TRUE;
90 90
     }
91 91
 
92 92
     /**
@@ -102,17 +102,17 @@  discard block
 block discarded – undo
102 102
     {
103 103
         $expectedNodes = $this->xml->xpath('./mets:structMap[@TYPE="LOGICAL"]/mets:div[@TYPE="' . $type . '"]');
104 104
         if ($expectedNodes) {
105
-            return true;
105
+            return TRUE;
106 106
         }
107 107
 
108 108
         $existingNodes = $this->xml->xpath('./mets:structMap[@TYPE="LOGICAL"]/mets:div');
109 109
         if ($existingNodes) {
110 110
             $this->logger->error('Document contains logical structure but @TYPE="' . $type . '" is missing.');
111
-            return false;
111
+            return FALSE;
112 112
         }
113 113
 
114 114
         $this->logger->error('Document does not contain logical structure.');
115
-        return false;
115
+        return FALSE;
116 116
     }
117 117
 
118 118
     /**
@@ -126,16 +126,16 @@  discard block
 block discarded – undo
126 126
     {
127 127
         $physSequenceNodes = $this->xml->xpath('./mets:structMap[@TYPE="PHYSICAL"]/mets:div[@TYPE="physSequence"]');
128 128
         if ($physSequenceNodes) {
129
-            return true;
129
+            return TRUE;
130 130
         }
131 131
 
132 132
         $physicalStructureNodes = $this->xml->xpath('./mets:structMap[@TYPE="PHYSICAL"]/mets:div');
133 133
         if ($physicalStructureNodes) {
134 134
             $this->logger->error('Document contains physical structure but @TYPE="physSequence" is missing.');
135
-            return false;
135
+            return FALSE;
136 136
         }
137 137
 
138 138
         $this->logger->error('Document does not contain physical structure.');
139
-        return false;
139
+        return FALSE;
140 140
     }
141 141
 }
Please login to merge, or discard this patch.
Tests/Unit/Validation/DocumentValidatorTest.php 3 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -105,7 +105,7 @@
 block discarded – undo
105 105
 
106 106
     private function getXml(string $file): SimpleXMLElement
107 107
     {
108
-        $xml = simplexml_load_file(__DIR__ . '/../../Fixtures/MetsDocument/' . $file);
108
+        $xml = simplexml_load_file(__DIR__.'/../../Fixtures/MetsDocument/'.$file);
109 109
         self::assertNotFalse($xml);
110 110
         return $xml;
111 111
     }
Please login to merge, or discard this patch.
Braces   +7 added lines, -14 removed lines patch added patch discarded remove patch
@@ -15,8 +15,7 @@  discard block
 block discarded – undo
15 15
 use SimpleXMLElement;
16 16
 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
17 17
 
18
-class DocumentValidatorTest extends UnitTestCase
19
-{
18
+class DocumentValidatorTest extends UnitTestCase {
20 19
     public function setUp(): void
21 20
     {
22 21
         parent::setUp();
@@ -27,8 +26,7 @@  discard block
 block discarded – undo
27 26
     /**
28 27
      * @test
29 28
      */
30
-    public function passesHasAllMandatoryMetadataFields()
31
-    {
29
+    public function passesHasAllMandatoryMetadataFields() {
32 30
         $metadata = [
33 31
             'record_id' => [
34 32
                 'xyz'
@@ -41,8 +39,7 @@  discard block
 block discarded – undo
41 39
     /**
42 40
      * @test
43 41
      */
44
-    public function notPassesHasAllMandatoryMetadataFields()
45
-    {
42
+    public function notPassesHasAllMandatoryMetadataFields() {
46 43
         $metadata = [
47 44
             'document_format' => [
48 45
                 'METS'
@@ -55,8 +52,7 @@  discard block
 block discarded – undo
55 52
     /**
56 53
      * @test
57 54
      */
58
-    public function passesHasCorrectLogicalStructure()
59
-    {
55
+    public function passesHasCorrectLogicalStructure() {
60 56
         $xml = $this->getXml('av_beispiel.xml');
61 57
 
62 58
         $documentValidator = new DocumentValidator([], [], $xml);
@@ -66,8 +62,7 @@  discard block
 block discarded – undo
66 62
     /**
67 63
      * @test
68 64
      */
69
-    public function notPassesHasCorrectLogicalStructure()
70
-    {
65
+    public function notPassesHasCorrectLogicalStructure() {
71 66
         $xml = $this->getXml('av_beispiel.xml');
72 67
 
73 68
         $documentValidator = new DocumentValidator([], [], $xml);
@@ -77,8 +72,7 @@  discard block
 block discarded – undo
77 72
     /**
78 73
      * @test
79 74
      */
80
-    public function passesHasCorrectPhysicalStructure()
81
-    {
75
+    public function passesHasCorrectPhysicalStructure() {
82 76
         $xml = $this->getXml('av_beispiel.xml');
83 77
 
84 78
         $documentValidator = new DocumentValidator([], [], $xml);
@@ -88,8 +82,7 @@  discard block
 block discarded – undo
88 82
     /**
89 83
      * @test
90 84
      */
91
-    public function notPassesHasCorrectPhysicalStructure()
92
-    {
85
+    public function notPassesHasCorrectPhysicalStructure() {
93 86
         $xml = $this->getXml('two_dmdsec.xml');
94 87
 
95 88
         $documentValidator = new DocumentValidator([], [], $xml);
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
21 21
     {
22 22
         parent::setUp();
23 23
 
24
-        $this->resetSingletonInstances = true;
24
+        $this->resetSingletonInstances = TRUE;
25 25
     }
26 26
 
27 27
     /**
Please login to merge, or discard this patch.
Classes/Common/Solr/SearchResult/Region.php 2 patches
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -20,8 +20,7 @@  discard block
 block discarded – undo
20 20
  *
21 21
  * @access public
22 22
  */
23
-class Region
24
-{
23
+class Region {
25 24
 
26 25
     /**
27 26
      * @access private
@@ -87,8 +86,7 @@  discard block
 block discarded – undo
87 86
      *
88 87
      * @return void
89 88
      */
90
-    public function __construct(int $id, array $region)
91
-    {
89
+    public function __construct(int $id, array $region) {
92 90
         $this->id = $id;
93 91
         $this->pageId = $region['pageIdx'] ?? null;
94 92
         $this->xBeginPosition = $region['ulx'];
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -90,7 +90,7 @@
 block discarded – undo
90 90
     public function __construct(int $id, array $region)
91 91
     {
92 92
         $this->id = $id;
93
-        $this->pageId = $region['pageIdx'] ?? null;
93
+        $this->pageId = $region['pageIdx'] ?? NULL;
94 94
         $this->xBeginPosition = $region['ulx'];
95 95
         $this->xEndPosition = $region['lrx'];
96 96
         $this->yBeginPosition = $region['uly'];
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))
@@ -578,8 +573,7 @@  discard block
 block discarded – undo
578 573
      *
579 574
      * @return array Array of substituted "NEW..." identifiers and their actual UIDs.
580 575
      */
581
-    public static function processDatabaseAsAdmin(array $data = [], array $cmd = [], $reverseOrder = false, $cmdFirst = false)
582
-    {
576
+    public static function processDatabaseAsAdmin(array $data = [], array $cmd = [], $reverseOrder = false, $cmdFirst = false) {
583 577
         $context = GeneralUtility::makeInstance(Context::class);
584 578
 
585 579
         if (
@@ -818,8 +812,7 @@  discard block
 block discarded – undo
818 812
      *
819 813
      * @return void
820 814
      */
821
-    private function __construct()
822
-    {
815
+    private function __construct() {
823 816
         // This is a static class, thus no instances should be created.
824 817
     }
825 818
 
@@ -850,8 +843,7 @@  discard block
 block discarded – undo
850 843
      *
851 844
      * @return string|bool
852 845
      */
853
-    public static function getUrl(string $url)
854
-    {
846
+    public static function getUrl(string $url) {
855 847
         if (!Helper::isValidHttpUrl($url)) {
856 848
             return false;
857 849
         }
@@ -932,8 +924,7 @@  discard block
 block discarded – undo
932 924
      *
933 925
      * @return mixed
934 926
      */
935
-    private static function getLocalConfigurationByPath(string $path)
936
-    {
927
+    private static function getLocalConfigurationByPath(string $path) {
937 928
         $configurationManager = GeneralUtility::makeInstance(ConfigurationManager::class);
938 929
 
939 930
         if (array_key_exists(strtok($path, '/'), $configurationManager->getLocalConfiguration())) {
Please login to merge, or discard this patch.
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
                 } elseif ($checksum == 10) {
151 151
                     //TODO: Binary operation "+" between string and 1 results in an error.
152 152
                     // @phpstan-ignore-next-line
153
-                    return self::checkIdentifier(($digits + 1) . substr($id, -2, 2), 'SWD');
153
+                    return self::checkIdentifier(($digits + 1).substr($id, -2, 2), 'SWD');
154 154
                 } elseif (substr($id, -1, 1) != $checksum) {
155 155
                     return false;
156 156
                 }
@@ -356,7 +356,7 @@  discard block
 block discarded – undo
356 356
         $encrypted = openssl_encrypt($string, self::$cipherAlgorithm, $key, OPENSSL_RAW_DATA, $iv);
357 357
         // Merge initialization vector and encrypted data.
358 358
         if ($encrypted !== false) {
359
-            $encrypted = base64_encode($iv . $encrypted);
359
+            $encrypted = base64_encode($iv.$encrypted);
360 360
         }
361 361
         return $encrypted;
362 362
     }
@@ -398,8 +398,8 @@  discard block
 block discarded – undo
398 398
     public static function getHookObjects(string $scriptRelPath): array
399 399
     {
400 400
         $hookObjects = [];
401
-        if (is_array(self::getOptions()[self::$extKey . '/' . $scriptRelPath]['hookClass'])) {
402
-            foreach (self::getOptions()[self::$extKey . '/' . $scriptRelPath]['hookClass'] as $classRef) {
401
+        if (is_array(self::getOptions()[self::$extKey.'/'.$scriptRelPath]['hookClass'])) {
402
+            foreach (self::getOptions()[self::$extKey.'/'.$scriptRelPath]['hookClass'] as $classRef) {
403 403
                 $hookObjects[] = GeneralUtility::makeInstance($classRef);
404 404
             }
405 405
         }
@@ -428,12 +428,12 @@  discard block
 block discarded – undo
428 428
             // NOTE: Only use tables that don't have too many entries!
429 429
             || !in_array($table, ['tx_dlf_collections', 'tx_dlf_libraries', 'tx_dlf_metadata', 'tx_dlf_metadatasubentries', 'tx_dlf_structures', 'tx_dlf_solrcores'])
430 430
         ) {
431
-            self::log('Invalid UID "' . $uid . '" or table "' . $table . '"', LOG_SEVERITY_ERROR);
431
+            self::log('Invalid UID "'.$uid.'" or table "'.$table.'"', LOG_SEVERITY_ERROR);
432 432
             return '';
433 433
         }
434 434
 
435
-        $makeCacheKey = function ($pid, $uid) {
436
-            return $pid . '.' . $uid;
435
+        $makeCacheKey = function($pid, $uid) {
436
+            return $pid.'.'.$uid;
437 437
         };
438 438
 
439 439
         static $cache = [];
@@ -443,9 +443,9 @@  discard block
 block discarded – undo
443 443
 
444 444
             $result = $queryBuilder
445 445
                 ->select(
446
-                    $table . '.index_name AS index_name',
447
-                    $table . '.uid AS uid',
448
-                    $table . '.pid AS pid',
446
+                    $table.'.index_name AS index_name',
447
+                    $table.'.uid AS uid',
448
+                    $table.'.pid AS pid',
449 449
                 )
450 450
                 ->from($table)
451 451
                 ->execute();
@@ -463,7 +463,7 @@  discard block
 block discarded – undo
463 463
         $result = $cache[$table][$cacheKey] ?? '';
464 464
 
465 465
         if ($result === '') {
466
-            self::log('No "index_name" with UID ' . $uid . ' and PID ' . $pid . ' found in table "' . $table . '"', LOG_SEVERITY_WARNING);
466
+            self::log('No "index_name" with UID '.$uid.' and PID '.$pid.' found in table "'.$table.'"', LOG_SEVERITY_WARNING);
467 467
         }
468 468
 
469 469
         return $result;
@@ -492,11 +492,11 @@  discard block
 block discarded – undo
492 492
             // No ISO code, return unchanged.
493 493
             return $code;
494 494
         }
495
-        $lang = LocalizationUtility::translate('LLL:' . $file . ':' . $code);
495
+        $lang = LocalizationUtility::translate('LLL:'.$file.':'.$code);
496 496
         if (!empty($lang)) {
497 497
             return $lang;
498 498
         } else {
499
-            self::log('Language code "' . $code . '" not found in ISO-639 table', LOG_SEVERITY_NOTICE);
499
+            self::log('Language code "'.$code.'" not found in ISO-639 table', LOG_SEVERITY_NOTICE);
500 500
             return $code;
501 501
         }
502 502
     }
@@ -660,7 +660,7 @@  discard block
 block discarded – undo
660 660
         // Sanitize input.
661 661
         $pid = max((int) $pid, 0);
662 662
         if (!$pid) {
663
-            self::log('Invalid PID ' . $pid . ' for translation', LOG_SEVERITY_WARNING);
663
+            self::log('Invalid PID '.$pid.' for translation', LOG_SEVERITY_WARNING);
664 664
             return $indexName;
665 665
         }
666 666
         /** @var PageRepository $pageRepository */
@@ -683,13 +683,13 @@  discard block
 block discarded – undo
683 683
         // First fetch the uid of the received index_name
684 684
         $result = $queryBuilder
685 685
             ->select(
686
-                $table . '.uid AS uid',
687
-                $table . '.l18n_parent AS l18n_parent'
686
+                $table.'.uid AS uid',
687
+                $table.'.l18n_parent AS l18n_parent'
688 688
             )
689 689
             ->from($table)
690 690
             ->where(
691
-                $queryBuilder->expr()->eq($table . '.pid', $pid),
692
-                $queryBuilder->expr()->eq($table . '.index_name', $queryBuilder->expr()->literal($indexName)),
691
+                $queryBuilder->expr()->eq($table.'.pid', $pid),
692
+                $queryBuilder->expr()->eq($table.'.index_name', $queryBuilder->expr()->literal($indexName)),
693 693
                 self::whereExpression($table, true)
694 694
             )
695 695
             ->setMaxResults(1)
@@ -700,12 +700,12 @@  discard block
 block discarded – undo
700 700
         if ($row) {
701 701
             // Now we use the uid of the l18_parent to fetch the index_name of the translated content element.
702 702
             $result = $queryBuilder
703
-                ->select($table . '.index_name AS index_name')
703
+                ->select($table.'.index_name AS index_name')
704 704
                 ->from($table)
705 705
                 ->where(
706
-                    $queryBuilder->expr()->eq($table . '.pid', $pid),
707
-                    $queryBuilder->expr()->eq($table . '.uid', $row['l18n_parent']),
708
-                    $queryBuilder->expr()->eq($table . '.sys_language_uid', (int) $languageContentId),
706
+                    $queryBuilder->expr()->eq($table.'.pid', $pid),
707
+                    $queryBuilder->expr()->eq($table.'.uid', $row['l18n_parent']),
708
+                    $queryBuilder->expr()->eq($table.'.sys_language_uid', (int) $languageContentId),
709 709
                     self::whereExpression($table, true)
710 710
                 )
711 711
                 ->setMaxResults(1)
@@ -723,14 +723,14 @@  discard block
 block discarded – undo
723 723
         if (empty($labels[$table][$pid][$languageContentId][$indexName])) {
724 724
             // Check if this table is allowed for translation.
725 725
             if (in_array($table, ['tx_dlf_collections', 'tx_dlf_libraries', 'tx_dlf_metadata', 'tx_dlf_metadatasubentries', 'tx_dlf_structures'])) {
726
-                $additionalWhere = $queryBuilder->expr()->in($table . '.sys_language_uid', [-1, 0]);
726
+                $additionalWhere = $queryBuilder->expr()->in($table.'.sys_language_uid', [-1, 0]);
727 727
                 if ($languageContentId > 0) {
728 728
                     $additionalWhere = $queryBuilder->expr()->andX(
729 729
                         $queryBuilder->expr()->orX(
730
-                            $queryBuilder->expr()->in($table . '.sys_language_uid', [-1, 0]),
731
-                            $queryBuilder->expr()->eq($table . '.sys_language_uid', (int) $languageContentId)
730
+                            $queryBuilder->expr()->in($table.'.sys_language_uid', [-1, 0]),
731
+                            $queryBuilder->expr()->eq($table.'.sys_language_uid', (int) $languageContentId)
732 732
                         ),
733
-                        $queryBuilder->expr()->eq($table . '.l18n_parent', 0)
733
+                        $queryBuilder->expr()->eq($table.'.l18n_parent', 0)
734 734
                     );
735 735
                 }
736 736
 
@@ -739,7 +739,7 @@  discard block
 block discarded – undo
739 739
                     ->select('*')
740 740
                     ->from($table)
741 741
                     ->where(
742
-                        $queryBuilder->expr()->eq($table . '.pid', $pid),
742
+                        $queryBuilder->expr()->eq($table.'.pid', $pid),
743 743
                         $additionalWhere,
744 744
                         self::whereExpression($table, true)
745 745
                     )
@@ -757,10 +757,10 @@  discard block
 block discarded – undo
757 757
                         }
758 758
                     }
759 759
                 } else {
760
-                    self::log('No translation with PID ' . $pid . ' available in table "' . $table . '" or translation not accessible', LOG_SEVERITY_NOTICE);
760
+                    self::log('No translation with PID '.$pid.' available in table "'.$table.'" or translation not accessible', LOG_SEVERITY_NOTICE);
761 761
                 }
762 762
             } else {
763
-                self::log('No translations available for table "' . $table . '"', LOG_SEVERITY_WARNING);
763
+                self::log('No translations available for table "'.$table.'"', LOG_SEVERITY_WARNING);
764 764
             }
765 765
         }
766 766
 
@@ -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 application type (neither frontend or backend)', 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
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
      *
90 90
      * @return FlashMessageQueue The queue the message was added to
91 91
      */
92
-    public static function addMessage(string $message, string $title, int $severity, bool $session = false, string $queue = 'kitodo.default.flashMessages'): FlashMessageQueue
92
+    public static function addMessage(string $message, string $title, int $severity, bool $session = FALSE, string $queue = 'kitodo.default.flashMessages'): FlashMessageQueue
93 93
     {
94 94
         $flashMessageService = GeneralUtility::makeInstance(FlashMessageService::class);
95 95
         $flashMessageQueue = $flashMessageService->getMessageQueueByIdentifier($queue);
@@ -128,9 +128,9 @@  discard block
 block discarded – undo
128 128
                     $checksum = 'X';
129 129
                 }
130 130
                 if (!preg_match('/\d{8}[\dX]{1}/i', $id)) {
131
-                    return false;
131
+                    return FALSE;
132 132
                 } elseif (strtoupper(substr($id, -1, 1)) != $checksum) {
133
-                    return false;
133
+                    return FALSE;
134 134
                 }
135 135
                 break;
136 136
             case 'ZDB':
@@ -138,21 +138,21 @@  discard block
 block discarded – undo
138 138
                     $checksum = 'X';
139 139
                 }
140 140
                 if (!preg_match('/\d{8}-[\dX]{1}/i', $id)) {
141
-                    return false;
141
+                    return FALSE;
142 142
                 } elseif (strtoupper(substr($id, -1, 1)) != $checksum) {
143
-                    return false;
143
+                    return FALSE;
144 144
                 }
145 145
                 break;
146 146
             case 'SWD':
147 147
                 $checksum = 11 - $checksum;
148 148
                 if (!preg_match('/\d{8}-\d{1}/i', $id)) {
149
-                    return false;
149
+                    return FALSE;
150 150
                 } elseif ($checksum == 10) {
151 151
                     //TODO: Binary operation "+" between string and 1 results in an error.
152 152
                     // @phpstan-ignore-next-line
153 153
                     return self::checkIdentifier(($digits + 1) . substr($id, -2, 2), 'SWD');
154 154
                 } elseif (substr($id, -1, 1) != $checksum) {
155
-                    return false;
155
+                    return FALSE;
156 156
                 }
157 157
                 break;
158 158
             case 'GKD':
@@ -161,13 +161,13 @@  discard block
 block discarded – undo
161 161
                     $checksum = 'X';
162 162
                 }
163 163
                 if (!preg_match('/\d{8}-[\dX]{1}/i', $id)) {
164
-                    return false;
164
+                    return FALSE;
165 165
                 } elseif (strtoupper(substr($id, -1, 1)) != $checksum) {
166
-                    return false;
166
+                    return FALSE;
167 167
                 }
168 168
                 break;
169 169
         }
170
-        return true;
170
+        return TRUE;
171 171
     }
172 172
 
173 173
     /**
@@ -204,28 +204,28 @@  discard block
 block discarded – undo
204 204
     public static function decrypt(string $encrypted)
205 205
     {
206 206
         if (
207
-            !in_array(self::$cipherAlgorithm, openssl_get_cipher_methods(true))
208
-            || !in_array(self::$hashAlgorithm, openssl_get_md_methods(true))
207
+            !in_array(self::$cipherAlgorithm, openssl_get_cipher_methods(TRUE))
208
+            || !in_array(self::$hashAlgorithm, openssl_get_md_methods(TRUE))
209 209
         ) {
210 210
             self::log('OpenSSL library doesn\'t support cipher and/or hash algorithm', LOG_SEVERITY_ERROR);
211
-            return false;
211
+            return FALSE;
212 212
         }
213 213
         if (empty(self::getEncryptionKey())) {
214 214
             self::log('No encryption key set in TYPO3 configuration', LOG_SEVERITY_ERROR);
215
-            return false;
215
+            return FALSE;
216 216
         }
217 217
         if (
218 218
             empty($encrypted)
219 219
             || strlen($encrypted) < openssl_cipher_iv_length(self::$cipherAlgorithm)
220 220
         ) {
221 221
             self::log('Invalid parameters given for decryption', LOG_SEVERITY_ERROR);
222
-            return false;
222
+            return FALSE;
223 223
         }
224 224
         // Split initialisation vector and encrypted data.
225 225
         $binary = base64_decode($encrypted);
226 226
         $iv = substr($binary, 0, openssl_cipher_iv_length(self::$cipherAlgorithm));
227 227
         $data = substr($binary, openssl_cipher_iv_length(self::$cipherAlgorithm));
228
-        $key = openssl_digest(self::getEncryptionKey(), self::$hashAlgorithm, true);
228
+        $key = openssl_digest(self::getEncryptionKey(), self::$hashAlgorithm, TRUE);
229 229
         // Decrypt data.
230 230
         return openssl_decrypt($data, self::$cipherAlgorithm, $key, OPENSSL_RAW_DATA, $iv);
231 231
     }
@@ -247,15 +247,15 @@  discard block
 block discarded – undo
247 247
         // Don't make simplexml_load_string throw (when $content is an array
248 248
         // or object)
249 249
         if (!is_string($content)) {
250
-            return false;
250
+            return FALSE;
251 251
         }
252 252
 
253 253
         // Turn off libxml's error logging.
254
-        $libxmlErrors = libxml_use_internal_errors(true);
254
+        $libxmlErrors = libxml_use_internal_errors(TRUE);
255 255
 
256 256
         if (\PHP_VERSION_ID < 80000) {
257 257
             // Disables the functionality to allow external entities to be loaded when parsing the XML, must be kept
258
-            $previousValueOfEntityLoader = libxml_disable_entity_loader(true);
258
+            $previousValueOfEntityLoader = libxml_disable_entity_loader(TRUE);
259 259
         }
260 260
 
261 261
         // Try to load XML from file.
@@ -317,9 +317,9 @@  discard block
 block discarded – undo
317 317
      */
318 318
     public static function digest(string $string)
319 319
     {
320
-        if (!in_array(self::$hashAlgorithm, openssl_get_md_methods(true))) {
320
+        if (!in_array(self::$hashAlgorithm, openssl_get_md_methods(TRUE))) {
321 321
             self::log('OpenSSL library doesn\'t support hash algorithm', LOG_SEVERITY_ERROR);
322
-            return false;
322
+            return FALSE;
323 323
         }
324 324
         // Hash string.
325 325
         return openssl_digest($string, self::$hashAlgorithm);
@@ -339,23 +339,23 @@  discard block
 block discarded – undo
339 339
     public static function encrypt(string $string)
340 340
     {
341 341
         if (
342
-            !in_array(self::$cipherAlgorithm, openssl_get_cipher_methods(true))
343
-            || !in_array(self::$hashAlgorithm, openssl_get_md_methods(true))
342
+            !in_array(self::$cipherAlgorithm, openssl_get_cipher_methods(TRUE))
343
+            || !in_array(self::$hashAlgorithm, openssl_get_md_methods(TRUE))
344 344
         ) {
345 345
             self::log('OpenSSL library doesn\'t support cipher and/or hash algorithm', LOG_SEVERITY_ERROR);
346
-            return false;
346
+            return FALSE;
347 347
         }
348 348
         if (empty(self::getEncryptionKey())) {
349 349
             self::log('No encryption key set in TYPO3 configuration', LOG_SEVERITY_ERROR);
350
-            return false;
350
+            return FALSE;
351 351
         }
352 352
         // Generate random initialization vector.
353 353
         $iv = openssl_random_pseudo_bytes(openssl_cipher_iv_length(self::$cipherAlgorithm));
354
-        $key = openssl_digest(self::getEncryptionKey(), self::$hashAlgorithm, true);
354
+        $key = openssl_digest(self::getEncryptionKey(), self::$hashAlgorithm, TRUE);
355 355
         // Encrypt data.
356 356
         $encrypted = openssl_encrypt($string, self::$cipherAlgorithm, $key, OPENSSL_RAW_DATA, $iv);
357 357
         // Merge initialization vector and encrypted data.
358
-        if ($encrypted !== false) {
358
+        if ($encrypted !== FALSE) {
359 359
             $encrypted = base64_encode($iv . $encrypted);
360 360
         }
361 361
         return $encrypted;
@@ -556,7 +556,7 @@  discard block
 block discarded – undo
556 556
     public static function isValidHttpUrl(string $url): bool
557 557
     {
558 558
         if (!GeneralUtility::isValidUrl($url)) {
559
-            return false;
559
+            return FALSE;
560 560
         }
561 561
 
562 562
         try {
@@ -564,7 +564,7 @@  discard block
 block discarded – undo
564 564
             return !empty($uri->getScheme());
565 565
         } catch (\InvalidArgumentException $e) {
566 566
             self::log($e->getMessage(), LOG_SEVERITY_ERROR);
567
-            return false;
567
+            return FALSE;
568 568
         }
569 569
     }
570 570
 
@@ -580,7 +580,7 @@  discard block
 block discarded – undo
580 580
      *
581 581
      * @return array Array of substituted "NEW..." identifiers and their actual UIDs.
582 582
      */
583
-    public static function processDatabaseAsAdmin(array $data = [], array $cmd = [], $reverseOrder = false, $cmdFirst = false)
583
+    public static function processDatabaseAsAdmin(array $data = [], array $cmd = [], $reverseOrder = FALSE, $cmdFirst = FALSE)
584 584
     {
585 585
         $context = GeneralUtility::makeInstance(Context::class);
586 586
 
@@ -591,7 +591,7 @@  discard block
 block discarded – undo
591 591
             // Instantiate TYPO3 core engine.
592 592
             $dataHandler = GeneralUtility::makeInstance(DataHandler::class);
593 593
             // We do not use workspaces and have to bypass restrictions in DataHandler.
594
-            $dataHandler->bypassWorkspaceRestrictions = true;
594
+            $dataHandler->bypassWorkspaceRestrictions = TRUE;
595 595
             // Load data and command arrays.
596 596
             $dataHandler->start($data, $cmd);
597 597
             // Process command map first if default order is reversed.
@@ -690,7 +690,7 @@  discard block
 block discarded – undo
690 690
             ->where(
691 691
                 $queryBuilder->expr()->eq($table . '.pid', $pid),
692 692
                 $queryBuilder->expr()->eq($table . '.index_name', $queryBuilder->expr()->literal($indexName)),
693
-                self::whereExpression($table, true)
693
+                self::whereExpression($table, TRUE)
694 694
             )
695 695
             ->setMaxResults(1)
696 696
             ->execute();
@@ -706,7 +706,7 @@  discard block
 block discarded – undo
706 706
                     $queryBuilder->expr()->eq($table . '.pid', $pid),
707 707
                     $queryBuilder->expr()->eq($table . '.uid', $row['l18n_parent']),
708 708
                     $queryBuilder->expr()->eq($table . '.sys_language_uid', (int) $languageContentId),
709
-                    self::whereExpression($table, true)
709
+                    self::whereExpression($table, TRUE)
710 710
                 )
711 711
                 ->setMaxResults(1)
712 712
                 ->execute();
@@ -741,7 +741,7 @@  discard block
 block discarded – undo
741 741
                     ->where(
742 742
                         $queryBuilder->expr()->eq($table . '.pid', $pid),
743 743
                         $additionalWhere,
744
-                        self::whereExpression($table, true)
744
+                        self::whereExpression($table, TRUE)
745 745
                     )
746 746
                     ->setMaxResults(10000)
747 747
                     ->execute();
@@ -783,7 +783,7 @@  discard block
 block discarded – undo
783 783
      *
784 784
      * @return string Additional WHERE expression
785 785
      */
786
-    public static function whereExpression(string $table, bool $showHidden = false): string
786
+    public static function whereExpression(string $table, bool $showHidden = FALSE): string
787 787
     {
788 788
         if (!Environment::isCli() && ApplicationType::fromRequest($GLOBALS['TYPO3_REQUEST'])->isFrontend()) {
789 789
             // Should we ignore the record's hidden flag?
@@ -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.
Classes/Task/IndexAdditionalFieldProvider.php 3 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -59,8 +59,8 @@
 block discarded – undo
59 59
 
60 60
         // Text field for document URL
61 61
         $fieldName = 'doc';
62
-        $fieldId = 'task_' . $fieldName;
63
-        $fieldHtml = '<input type="text" name="tx_scheduler[' . $fieldName . ']" id="' . $fieldId . '" value="' . $taskInfo[$fieldName] . '" >';
62
+        $fieldId = 'task_'.$fieldName;
63
+        $fieldHtml = '<input type="text" name="tx_scheduler['.$fieldName.']" id="'.$fieldId.'" value="'.$taskInfo[$fieldName].'" >';
64 64
         $additionalFields[$fieldId] = [
65 65
             'code' => $fieldHtml,
66 66
             'label' => 'LLL:EXT:dlf/Resources/Private/Language/locallang_tasks.xlf:additionalFields.doc',
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -23,8 +23,7 @@  discard block
 block discarded – undo
23 23
  *
24 24
  * @access public
25 25
  */
26
-class IndexAdditionalFieldProvider extends BaseAdditionalFieldProvider
27
-{
26
+class IndexAdditionalFieldProvider extends BaseAdditionalFieldProvider {
28 27
     /**
29 28
      * Gets additional fields to render in the form to add/edit a task
30 29
      *
@@ -33,8 +32,7 @@  discard block
 block discarded – undo
33 32
      * @param \TYPO3\CMS\Scheduler\Controller\SchedulerModuleController $schedulerModule Reference to the scheduler backend module
34 33
      * @return array A two dimensional array, array('Identifier' => array('fieldId' => array('code' => '', 'label' => '', 'cshKey' => '', 'cshLabel' => ''))
35 34
      */
36
-    public function getAdditionalFields(array &$taskInfo, $task, SchedulerModuleController $schedulerModule)
37
-    {
35
+    public function getAdditionalFields(array &$taskInfo, $task, SchedulerModuleController $schedulerModule) {
38 36
         $currentSchedulerModuleAction = $schedulerModule->getCurrentAction();
39 37
 
40 38
         /** @var BaseTask $task */
Please login to merge, or discard this patch.
Upper-Lower-Casing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -46,12 +46,12 @@
 block discarded – undo
46 46
             $taskInfo['owner'] = $task->getOwner();
47 47
             $taskInfo['softCommit'] = $task->isSoftCommit();
48 48
         } else {
49
-            $taskInfo['dryRun'] = false;
49
+            $taskInfo['dryRun'] = FALSE;
50 50
             $taskInfo['doc'] = 'https://';
51 51
             $taskInfo['pid'] = - 1;
52 52
             $taskInfo['solr'] = - 1;
53 53
             $taskInfo['owner'] = '';
54
-            $taskInfo['softCommit'] = false;
54
+            $taskInfo['softCommit'] = FALSE;
55 55
         }
56 56
 
57 57
         $additionalFields = [];
Please login to merge, or discard this patch.
Classes/Task/HarvestAdditionalFieldProvider.php 3 patches
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -65,16 +65,16 @@  discard block
 block discarded – undo
65 65
 
66 66
         // Text field for library
67 67
         $fieldName = 'lib';
68
-        $fieldId = 'task_' . $fieldName;
68
+        $fieldId = 'task_'.$fieldName;
69 69
 
70 70
         $allLibraries = $this->getLibraries($taskInfo['pid']);
71 71
         $options = [];
72 72
         $options[] = '<option value="-1"></option>';
73 73
         foreach ($allLibraries as $label => $uid) {
74
-            $options[] = '<option value="' . $uid . '" ' . ($taskInfo['lib'] == $uid ? 'selected' : '') . ' >' . $label . '</option>';
74
+            $options[] = '<option value="'.$uid.'" '.($taskInfo['lib'] == $uid ? 'selected' : '').' >'.$label.'</option>';
75 75
         }
76 76
 
77
-        $fieldHtml = '<select name="tx_scheduler[' . $fieldName . ']" id="' . $fieldId . '">' . implode("\n", $options) . '</select>';
77
+        $fieldHtml = '<select name="tx_scheduler['.$fieldName.']" id="'.$fieldId.'">'.implode("\n", $options).'</select>';
78 78
         $additionalFields[$fieldId] = [
79 79
             'code' => $fieldHtml,
80 80
             'label' => 'LLL:EXT:dlf/Resources/Private/Language/locallang_tasks.xlf:additionalFields.lib',
@@ -90,8 +90,8 @@  discard block
 block discarded – undo
90 90
 
91 91
         // Text field for from
92 92
         $fieldName = 'from';
93
-        $fieldId = 'task_' . $fieldName;
94
-        $fieldHtml = '<input type="date" name="tx_scheduler[' . $fieldName . ']" id="' . $fieldId . '" value="' . $taskInfo[$fieldName] . '" >';
93
+        $fieldId = 'task_'.$fieldName;
94
+        $fieldHtml = '<input type="date" name="tx_scheduler['.$fieldName.']" id="'.$fieldId.'" value="'.$taskInfo[$fieldName].'" >';
95 95
         $additionalFields[$fieldId] = [
96 96
             'code' => $fieldHtml,
97 97
             'label' => 'LLL:EXT:dlf/Resources/Private/Language/locallang_tasks.xlf:additionalFields.from',
@@ -101,8 +101,8 @@  discard block
 block discarded – undo
101 101
 
102 102
         // Text field for until
103 103
         $fieldName = 'until';
104
-        $fieldId = 'task_' . $fieldName;
105
-        $fieldHtml = '<input type="date" name="tx_scheduler[' . $fieldName . ']" id="' . $fieldId . '" value="' . $taskInfo[$fieldName] . '" >';
104
+        $fieldId = 'task_'.$fieldName;
105
+        $fieldHtml = '<input type="date" name="tx_scheduler['.$fieldName.']" id="'.$fieldId.'" value="'.$taskInfo[$fieldName].'" >';
106 106
         $additionalFields[$fieldId] = [
107 107
             'code' => $fieldHtml,
108 108
             'label' => 'LLL:EXT:dlf/Resources/Private/Language/locallang_tasks.xlf:additionalFields.until',
@@ -112,8 +112,8 @@  discard block
 block discarded – undo
112 112
 
113 113
         // Text field for set
114 114
         $fieldName = 'set';
115
-        $fieldId = 'task_' . $fieldName;
116
-        $fieldHtml = '<input type="text" name="tx_scheduler[' . $fieldName . ']" id="' . $fieldId . '" value="' . $taskInfo[$fieldName] . '" >';
115
+        $fieldId = 'task_'.$fieldName;
116
+        $fieldHtml = '<input type="text" name="tx_scheduler['.$fieldName.']" id="'.$fieldId.'" value="'.$taskInfo[$fieldName].'" >';
117 117
         $additionalFields[$fieldId] = [
118 118
             'code' => $fieldHtml,
119 119
             'label' => 'LLL:EXT:dlf/Resources/Private/Language/locallang_tasks.xlf:additionalFields.set',
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -25,8 +25,7 @@  discard block
 block discarded – undo
25 25
  *
26 26
  * @access public
27 27
  */
28
-class HarvestAdditionalFieldProvider extends BaseAdditionalFieldProvider
29
-{
28
+class HarvestAdditionalFieldProvider extends BaseAdditionalFieldProvider {
30 29
     /**
31 30
      * Gets additional fields to render in the form to add/edit a task
32 31
      *
@@ -35,8 +34,7 @@  discard block
 block discarded – undo
35 34
      * @param \TYPO3\CMS\Scheduler\Controller\SchedulerModuleController $schedulerModule Reference to the scheduler backend module
36 35
      * @return array A two dimensional array, array('Identifier' => array('fieldId' => array('code' => '', 'label' => '', 'cshKey' => '', 'cshLabel' => ''))
37 36
      */
38
-    public function getAdditionalFields(array &$taskInfo, $task, SchedulerModuleController $schedulerModule)
39
-    {
37
+    public function getAdditionalFields(array &$taskInfo, $task, SchedulerModuleController $schedulerModule) {
40 38
         $currentSchedulerModuleAction = $schedulerModule->getCurrentAction();
41 39
 
42 40
         /** @var BaseTask $task */
Please login to merge, or discard this patch.
Upper-Lower-Casing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -50,14 +50,14 @@
 block discarded – undo
50 50
             $taskInfo['set'] = $task->getSet();
51 51
             $taskInfo['softCommit'] = $task->isSoftCommit();
52 52
         } else {
53
-            $taskInfo['dryRun'] = false;
53
+            $taskInfo['dryRun'] = FALSE;
54 54
             $taskInfo['lib'] = - 1;
55 55
             $taskInfo['pid'] = - 1;
56 56
             $taskInfo['solr'] = - 1;
57 57
             $taskInfo['from'] = '';
58 58
             $taskInfo['until'] = '';
59 59
             $taskInfo['set'] = '';
60
-            $taskInfo['softCommit'] = false;
60
+            $taskInfo['softCommit'] = FALSE;
61 61
         }
62 62
 
63 63
         $additionalFields = [];
Please login to merge, or discard this patch.
Classes/Task/ReindexTask.php 2 patches
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -23,10 +23,8 @@
 block discarded – undo
23 23
  *
24 24
  * @access public
25 25
  */
26
-class ReindexTask extends BaseTask
27
-{
28
-    public function execute()
29
-    {
26
+class ReindexTask extends BaseTask {
27
+    public function execute() {
30 28
         $inputArray = [];
31 29
         if ($this->dryRun) {
32 30
             $inputArray['--dry-run'] = true;
Please login to merge, or discard this patch.
Upper-Lower-Casing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
     {
30 30
         $inputArray = [];
31 31
         if ($this->dryRun) {
32
-            $inputArray['--dry-run'] = true;
32
+            $inputArray['--dry-run'] = TRUE;
33 33
         }
34 34
         if (count($this->coll)) {
35 35
             $inputArray['-c'] = implode(',', $this->coll);
@@ -40,10 +40,10 @@  discard block
 block discarded – undo
40 40
             $inputArray['-o'] = $this->owner;
41 41
         }
42 42
         if ($this->all) {
43
-            $inputArray['--all'] = true;
43
+            $inputArray['--all'] = TRUE;
44 44
         }
45 45
         if (!empty($this->softCommit)) {
46
-            $inputArray['--softCommit'] = true;
46
+            $inputArray['--softCommit'] = TRUE;
47 47
         }
48 48
 
49 49
         $reindexCommand = GeneralUtility::makeInstance(\Kitodo\Dlf\Command\ReindexCommand::class);
Please login to merge, or discard this patch.