Passed
Pull Request — master (#123)
by
unknown
05:05
created
Classes/Updates/MigrateSettings.php 2 patches
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -26,8 +26,7 @@
 block discarded – undo
26 26
  *
27 27
  * @internal
28 28
  */
29
-class MigrateSettings implements UpgradeWizardInterface
30
-{
29
+class MigrateSettings implements UpgradeWizardInterface {
31 30
 
32 31
     /**
33 32
      * Return the identifier for this wizard
Please login to merge, or discard this patch.
Upper-Lower-Casing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -108,11 +108,11 @@  discard block
 block discarded – undo
108 108
 
109 109
             // exit if at least one update statement is not successful
110 110
             if (!((bool) $updateResult)) {
111
-                return false;
111
+                return FALSE;
112 112
             }
113 113
         }
114 114
 
115
-        return true;
115
+        return TRUE;
116 116
     }
117 117
 
118 118
     /**
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
      */
127 127
     public function updateNecessary(): bool
128 128
     {
129
-        $oldSettingsFound = false;
129
+        $oldSettingsFound = FALSE;
130 130
 
131 131
         $connection = GeneralUtility::makeInstance(ConnectionPool::class)->getConnectionForTable('tt_content');
132 132
 
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
         // Update the found record sets
145 145
         while ($record = $statement->fetchAssociative()) {
146 146
             $oldSettingsFound = $this->checkForOldSettings($record['pi_flexform']);
147
-            if ($oldSettingsFound === true) {
147
+            if ($oldSettingsFound === TRUE) {
148 148
                 // We found at least one field to be updated --> break here
149 149
                 break;
150 150
             }
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
 
188 188
         foreach ($fields as $field) {
189 189
             // change the index attribute if it doesn't start with 'settings.' yet
190
-            if (strpos($field['index'], 'settings.') === false) {
190
+            if (strpos($field['index'], 'settings.') === FALSE) {
191 191
                 $field['index'] = 'settings.' . $field['index'];
192 192
             }
193 193
         }
Please login to merge, or discard this patch.
Classes/Updates/FileLocationUpdater.php 3 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -190,9 +190,9 @@  discard block
 block discarded – undo
190 190
                             $queryBuilder->createNamedParameter('', \PDO::PARAM_STR)
191 191
                         ),
192 192
                         $queryBuilder->expr()->comparison(
193
-                            'CAST(CAST(' . $queryBuilder->quoteIdentifier($this->fieldsToMigrate[$table]) . ' AS DECIMAL) AS CHAR)',
193
+                            'CAST(CAST('.$queryBuilder->quoteIdentifier($this->fieldsToMigrate[$table]).' AS DECIMAL) AS CHAR)',
194 194
                             ExpressionBuilder::NEQ,
195
-                            'CAST(' . $queryBuilder->quoteIdentifier($this->fieldsToMigrate[$table]) . ' AS CHAR)'
195
+                            'CAST('.$queryBuilder->quoteIdentifier($this->fieldsToMigrate[$table]).' AS CHAR)'
196 196
                         )
197 197
                     )
198 198
                     ->orderBy('uid')
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
                 }
206 206
             } catch (Exception $e) {
207 207
                 throw new \RuntimeException(
208
-                    'Database query failed. Error was: ' . $e->getPrevious()->getMessage(),
208
+                    'Database query failed. Error was: '.$e->getPrevious()->getMessage(),
209 209
                     1511950673
210 210
                 );
211 211
             }
@@ -271,7 +271,7 @@  discard block
 block discarded – undo
271 271
         $connectionPool = GeneralUtility::makeInstance(ConnectionPool::class);
272 272
 
273 273
         $fileUid = null;
274
-        $sourcePath = Environment::getPublicPath() . '/' . $fieldItem;
274
+        $sourcePath = Environment::getPublicPath().'/'.$fieldItem;
275 275
 
276 276
         // maybe the file was already moved, so check if the original file still exists
277 277
         if (file_exists($sourcePath)) {
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -171,8 +171,7 @@
 block discarded – undo
171 171
      *
172 172
      * @throws \RuntimeException
173 173
      */
174
-    protected function getRecordsFromTable(bool $countOnly = false)
175
-    {
174
+    protected function getRecordsFromTable(bool $countOnly = false) {
176 175
         $connectionPool = GeneralUtility::makeInstance(ConnectionPool::class);
177 176
         $allResults = [];
178 177
         $numResults = 0;
Please login to merge, or discard this patch.
Upper-Lower-Casing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -105,11 +105,11 @@  discard block
 block discarded – undo
105 105
     public function updateNecessary(): bool
106 106
     {
107 107
         /** @var int */
108
-        $numRecords = $this->getRecordsFromTable(true);
108
+        $numRecords = $this->getRecordsFromTable(TRUE);
109 109
         if ($numRecords > 0) {
110
-            return true;
110
+            return TRUE;
111 111
         }
112
-        return false;
112
+        return FALSE;
113 113
     }
114 114
 
115 115
     /**
@@ -145,16 +145,16 @@  discard block
 block discarded – undo
145 145
      */
146 146
     public function executeUpdate(): bool
147 147
     {
148
-        $result = true;
148
+        $result = TRUE;
149 149
         try {
150 150
             /** @var int */
151
-            $numRecords = $this->getRecordsFromTable(true);
151
+            $numRecords = $this->getRecordsFromTable(TRUE);
152 152
             if ($numRecords > 0) {
153 153
                 $this->performUpdate();
154 154
             }
155 155
         } catch (\Exception $e) {
156 156
             // If something goes wrong, migrateField() logs an error
157
-            $result = false;
157
+            $result = FALSE;
158 158
         }
159 159
         return $result;
160 160
     }
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
      *
172 172
      * @throws \RuntimeException
173 173
      */
174
-    protected function getRecordsFromTable(bool $countOnly = false)
174
+    protected function getRecordsFromTable(bool $countOnly = FALSE)
175 175
     {
176 176
         $connectionPool = GeneralUtility::makeInstance(ConnectionPool::class);
177 177
         $allResults = [];
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
                     ->orderBy('uid')
199 199
                     ->execute()
200 200
                     ->fetchAllAssociative();
201
-                if ($countOnly === true) {
201
+                if ($countOnly === TRUE) {
202 202
                     $numResults += count($result);
203 203
                 } else {
204 204
                     $allResults[$table] = $result;
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
             }
212 212
         }
213 213
 
214
-        if ($countOnly === true) {
214
+        if ($countOnly === TRUE) {
215 215
             return $numResults;
216 216
         } else {
217 217
             return $allResults;
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
      */
229 229
     protected function performUpdate(): bool
230 230
     {
231
-        $result = true;
231
+        $result = TRUE;
232 232
 
233 233
         try {
234 234
             $storages = GeneralUtility::makeInstance(StorageRepository::class)->findAll();
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
                 }
242 242
             }
243 243
         } catch (\Exception $e) {
244
-            $result = false;
244
+            $result = FALSE;
245 245
         }
246 246
 
247 247
         return $result;
@@ -270,7 +270,7 @@  discard block
 block discarded – undo
270 270
         $storageUid = (int) $this->storage->getUid();
271 271
         $connectionPool = GeneralUtility::makeInstance(ConnectionPool::class);
272 272
 
273
-        $fileUid = null;
273
+        $fileUid = NULL;
274 274
         $sourcePath = Environment::getPublicPath() . '/' . $fieldItem;
275 275
 
276 276
         // maybe the file was already moved, so check if the original file still exists
Please login to merge, or discard this patch.
Classes/ExpressionLanguage/DocumentTypeProvider.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -22,8 +22,7 @@  discard block
 block discarded – undo
22 22
  *
23 23
  * @access public
24 24
  */
25
-class DocumentTypeProvider extends AbstractProvider
26
-{
25
+class DocumentTypeProvider extends AbstractProvider {
27 26
     /**
28 27
      * Construct the instance
29 28
      *
@@ -31,8 +30,7 @@  discard block
 block discarded – undo
31 30
      *
32 31
      * @return void
33 32
      */
34
-    public function __construct()
35
-    {
33
+    public function __construct() {
36 34
         $this->expressionLanguageProviders = [
37 35
             DocumentTypeFunctionProvider::class
38 36
         ];
Please login to merge, or discard this patch.
Classes/ExpressionLanguage/DocumentTypeFunctionProvider.php 3 patches
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -116,12 +116,10 @@
 block discarded – undo
116 116
     {
117 117
         return new ExpressionFunction(
118 118
             'getDocumentType',
119
-            function()
120
-            {
119
+            function() {
121 120
                 // Not implemented, we only use the evaluator
122 121
             },
123
-            function($arguments, $cPid)
124
-            {
122
+            function($arguments, $cPid) {
125 123
                 /** @var RequestWrapper $requestWrapper */
126 124
                 $requestWrapper = $arguments['request'];
127 125
                 $queryParams = $requestWrapper->getQueryParams();
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
                 if ($this->document) {
180 180
                     $doc = AbstractDocument::getInstance($this->document->getLocation(), ['storagePid' => $pid], true);
181 181
                 } else {
182
-                    $this->logger->error('Invalid UID "' . $requestData['id'] . '" or PID "' . $pid . '" for document loading');
182
+                    $this->logger->error('Invalid UID "'.$requestData['id'].'" or PID "'.$pid.'" for document loading');
183 183
                 }
184 184
             } elseif (GeneralUtility::isValidUrl($requestData['id'])) {
185 185
                 $doc = AbstractDocument::getInstance($requestData['id'], ['storagePid' => $pid], true);
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
                     }
194 194
                     $this->document->setLocation($requestData['id']);
195 195
                 } else {
196
-                    $this->logger->error('Invalid location given "' . $requestData['id'] . '" for document loading');
196
+                    $this->logger->error('Invalid location given "'.$requestData['id'].'" for document loading');
197 197
                 }
198 198
             }
199 199
             if ($this->document !== null && $doc !== null) {
@@ -206,11 +206,11 @@  discard block
 block discarded – undo
206 206
                 if ($doc !== null) {
207 207
                     $this->document->setCurrentDocument($doc);
208 208
                 } else {
209
-                    $this->logger->error('Failed to load document with record ID "' . $requestData['recordId'] . '"');
209
+                    $this->logger->error('Failed to load document with record ID "'.$requestData['recordId'].'"');
210 210
                 }
211 211
             }
212 212
         } else {
213
-            $this->logger->error('Empty UID or invalid PID "' . $pid . '" for document loading');
213
+            $this->logger->error('Empty UID or invalid PID "'.$pid.'" for document loading');
214 214
         }
215 215
     }
216 216
 
Please login to merge, or discard this patch.
Upper-Lower-Casing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
 
129 129
                 // Load document with current plugin parameters.
130 130
                 $this->loadDocument($queryParams['tx_dlf'], $cPid);
131
-                if (!isset($this->document) || $this->document->getCurrentDocument() === null) {
131
+                if (!isset($this->document) || $this->document->getCurrentDocument() === NULL) {
132 132
                     return $type;
133 133
                 }
134 134
 
@@ -160,20 +160,20 @@  discard block
 block discarded – undo
160 160
         // Try to get document format from database
161 161
         if (!empty($requestData['id'])) {
162 162
             $this->initializeRepositories($pid);
163
-            $doc = null;
164
-            $this->document = null;
163
+            $doc = NULL;
164
+            $this->document = NULL;
165 165
             if (MathUtility::canBeInterpretedAsInteger($requestData['id'])) {
166 166
                 // find document from repository by uid
167 167
                 $this->document = $this->documentRepository->findOneByIdAndSettings((int) $requestData['id'], ['storagePid' => $pid]);
168 168
                 if ($this->document) {
169
-                    $doc = AbstractDocument::getInstance($this->document->getLocation(), ['storagePid' => $pid], true);
169
+                    $doc = AbstractDocument::getInstance($this->document->getLocation(), ['storagePid' => $pid], TRUE);
170 170
                 } else {
171 171
                     $this->logger->error('Invalid UID "' . $requestData['id'] . '" or PID "' . $pid . '" for document loading');
172 172
                 }
173 173
             } elseif (GeneralUtility::isValidUrl($requestData['id'])) {
174
-                $doc = AbstractDocument::getInstance($requestData['id'], ['storagePid' => $pid], true);
174
+                $doc = AbstractDocument::getInstance($requestData['id'], ['storagePid' => $pid], TRUE);
175 175
 
176
-                if ($doc !== null) {
176
+                if ($doc !== NULL) {
177 177
                     if ($doc->recordId) {
178 178
                         $this->document = $this->documentRepository->findOneByRecordId($doc->recordId);
179 179
                     }
@@ -186,14 +186,14 @@  discard block
 block discarded – undo
186 186
                     $this->logger->error('Invalid location given "' . $requestData['id'] . '" for document loading');
187 187
                 }
188 188
             }
189
-            if ($this->document !== null && $doc !== null) {
189
+            if ($this->document !== NULL && $doc !== NULL) {
190 190
                 $this->document->setCurrentDocument($doc);
191 191
             }
192 192
         } elseif (!empty($requestData['recordId'])) {
193 193
             $this->document = $this->documentRepository->findOneByRecordId($requestData['recordId']);
194
-            if ($this->document !== null) {
195
-                $doc = AbstractDocument::getInstance($this->document->getLocation(), ['storagePid' => $pid], true);
196
-                if ($doc !== null) {
194
+            if ($this->document !== NULL) {
195
+                $doc = AbstractDocument::getInstance($this->document->getLocation(), ['storagePid' => $pid], TRUE);
196
+                if ($doc !== NULL) {
197 197
                     $this->document->setCurrentDocument($doc);
198 198
                 } else {
199 199
                     $this->logger->error('Failed to load document with record ID "' . $requestData['recordId'] . '"');
Please login to merge, or discard this patch.
Classes/Pagination/PageGridPagination.php 2 patches
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -18,15 +18,13 @@
 block discarded – undo
18 18
 use TYPO3\CMS\Core\Pagination\PaginatorInterface;
19 19
 
20 20
 
21
-final class PageGridPagination implements PaginationInterface
22
-{
21
+final class PageGridPagination implements PaginationInterface {
23 22
     /**
24 23
      * @var PageGridPaginator
25 24
      */
26 25
     protected $paginator;
27 26
 
28
-    public function __construct(PaginatorInterface $paginator)
29
-    {
27
+    public function __construct(PaginatorInterface $paginator) {
30 28
         // @phpstan-ignore-next-line
31 29
         $this->paginator = $paginator;
32 30
     }
Please login to merge, or discard this patch.
Upper-Lower-Casing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -36,12 +36,12 @@  discard block
 block discarded – undo
36 36
         $previousPage = (int) (($this->paginator->getCurrentPageNumber() - 1) * $this->paginator->getPublicItemsPerPage()) - ($this->paginator->getPublicItemsPerPage() - 1);
37 37
 
38 38
         if ($previousPage > $this->paginator->getNumberOfPages()) {
39
-            return null;
39
+            return NULL;
40 40
         }
41 41
 
42 42
         return $previousPage >= $this->getFirstPageNumber()
43 43
             ? $previousPage
44
-            : null
44
+            : NULL
45 45
             ;
46 46
     }
47 47
 
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
 
52 52
         return $nextPage <= $this->paginator->getNumberOfPages()
53 53
             ? $nextPage
54
-            : null
54
+            : NULL
55 55
             ;
56 56
     }
57 57
 
Please login to merge, or discard this patch.
Classes/Pagination/PageGridPaginator.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -16,8 +16,7 @@
 block discarded – undo
16 16
 
17 17
 use TYPO3\CMS\Core\Pagination\AbstractPaginator;
18 18
 
19
-final class PageGridPaginator extends AbstractPaginator
20
-{
19
+final class PageGridPaginator extends AbstractPaginator {
21 20
     /**
22 21
      * @var array
23 22
      */
Please login to merge, or discard this patch.
Classes/Controller/OaiPmhController.php 3 patches
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -250,10 +250,10 @@  discard block
 block discarded – undo
250 250
             if ($root->item(0) instanceof \DOMNode) {
251 251
                 $mets = $xml->saveXML($root->item(0));
252 252
             } else {
253
-                $this->logger->error('No METS part found in document with location "' . $record['location'] . '"');
253
+                $this->logger->error('No METS part found in document with location "'.$record['location'].'"');
254 254
             }
255 255
         } else {
256
-            $this->logger->error('Could not load XML file from "' . $record['location'] . '"');
256
+            $this->logger->error('Could not load XML file from "'.$record['location'].'"');
257 257
         }
258 258
         return $mets;
259 259
     }
@@ -421,7 +421,7 @@  discard block
 block discarded – undo
421 421
             $pageSettings = $this->configurationManager->getConfiguration($this->configurationManager::CONFIGURATION_TYPE_FULL_TYPOSCRIPT);
422 422
             $storagePid = $pageSettings["plugin."]["tx_dlf."]["persistence."]["storagePid"];
423 423
             if ($storagePid > 0) {
424
-                $this->logger->notice('No records found with PID ' . $storagePid);
424
+                $this->logger->notice('No records found with PID '.$storagePid);
425 425
             } else {
426 426
                 $this->logger->notice('No records found');
427 427
             }
@@ -504,7 +504,7 @@  discard block
 block discarded – undo
504 504
             if (!empty($resArray)) {
505 505
                 // check, if all required fields are available for a given identifier
506 506
                 foreach ($details['requiredFields'] as $required) {
507
-                    $methodName = 'get' . GeneralUtility::underscoredToUpperCamelCase($required);
507
+                    $methodName = 'get'.GeneralUtility::underscoredToUpperCamelCase($required);
508 508
                     if (empty($resArray->$methodName())) {
509 509
                         // Skip metadata formats whose requirements are not met.
510 510
                         continue 2;
@@ -610,9 +610,9 @@  discard block
 block discarded – undo
610 610
             $resArray = $result->fetchAssociative();
611 611
             if ($resArray) {
612 612
                 if ($resArray['index_query'] != "") {
613
-                    $solrQuery .= '(' . $resArray['index_query'] . ')';
613
+                    $solrQuery .= '('.$resArray['index_query'].')';
614 614
                 } else {
615
-                    $solrQuery .= 'collection:' . '"' . $resArray['index_name'] . '"';
615
+                    $solrQuery .= 'collection:'.'"'.$resArray['index_name'].'"';
616 616
                 }
617 617
             } else {
618 618
                 $this->error = 'noSetHierarchy';
@@ -624,7 +624,7 @@  discard block
 block discarded – undo
624 624
         }
625 625
         // Check for required fields.
626 626
         foreach ($this->formats[$this->parameters['metadataPrefix']]['requiredFields'] as $required) {
627
-            $solrQuery .= ' NOT ' . $required . ':""';
627
+            $solrQuery .= ' NOT '.$required.':""';
628 628
         }
629 629
         // toplevel="true" is always required
630 630
         $solrQuery .= ' AND toplevel:true';
@@ -638,7 +638,7 @@  discard block
 block discarded – undo
638 638
             return $documentSet;
639 639
         }
640 640
 
641
-        $solrQuery .= ' AND timestamp:[' . $from . ' TO ' . $until . ']';
641
+        $solrQuery .= ' AND timestamp:['.$from.' TO '.$until.']';
642 642
 
643 643
         $solr = Solr::getInstance($this->settings['solrcore']);
644 644
         if (!$solr->ready) {
@@ -729,7 +729,7 @@  discard block
 block discarded – undo
729 729
      */
730 730
     private function getDate(string $dateType)
731 731
     {
732
-        return strptime($this->parameters[$dateType], '%Y-%m-%dT%H:%M:%SZ') ?: strptime($this->parameters[$dateType], '%Y-%m-%d');
732
+        return strptime($this->parameters[$dateType], '%Y-%m-%dT%H:%M:%SZ') ? : strptime($this->parameters[$dateType], '%Y-%m-%d');
733 733
     }
734 734
 
735 735
     /**
@@ -752,7 +752,7 @@  discard block
 block discarded – undo
752 752
             $date['tm_mday'],
753 753
             $date['tm_year'] + 1900
754 754
         );
755
-        return date("Y-m-d", $timestamp) . 'T' . date("H:i:s", $timestamp) . $end;
755
+        return date("Y-m-d", $timestamp).'T'.date("H:i:s", $timestamp).$end;
756 756
     }
757 757
 
758 758
     /**
@@ -865,7 +865,7 @@  discard block
 block discarded – undo
865 865
         $resumptionTokenInfo['cursor'] = $currentCursor;
866 866
         $resumptionTokenInfo['completeListSize'] = $documentListSet['metadata']['completeListSize'];
867 867
         $expireDateTime = new \DateTime();
868
-        $expireDateTime->add(new \DateInterval('PT' . $this->settings['expired'] . 'S'));
868
+        $expireDateTime->add(new \DateInterval('PT'.$this->settings['expired'].'S'));
869 869
         $resumptionTokenInfo['expired'] = $expireDateTime;
870 870
 
871 871
         $omitResumptionToken = $currentCursor === 0 && $numShownDocuments >= $documentListSet['metadata']['completeListSize'];
Please login to merge, or discard this patch.
Braces   +19 added lines, -38 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 OaiPmhController extends AbstractController
31
-{
30
+class OaiPmhController extends AbstractController {
32 31
     /**
33 32
      * @access protected
34 33
      * @var TokenRepository
@@ -42,8 +41,7 @@  discard block
 block discarded – undo
42 41
      *
43 42
      * @return void
44 43
      */
45
-    public function injectTokenRepository(TokenRepository $tokenRepository)
46
-    {
44
+    public function injectTokenRepository(TokenRepository $tokenRepository) {
47 45
         $this->tokenRepository = $tokenRepository;
48 46
     }
49 47
 
@@ -60,8 +58,7 @@  discard block
 block discarded – undo
60 58
      *
61 59
      * @return void
62 60
      */
63
-    public function injectCollectionRepository(CollectionRepository $collectionRepository)
64
-    {
61
+    public function injectCollectionRepository(CollectionRepository $collectionRepository) {
65 62
         $this->collectionRepository = $collectionRepository;
66 63
     }
67 64
 
@@ -78,8 +75,7 @@  discard block
 block discarded – undo
78 75
      *
79 76
      * @return void
80 77
      */
81
-    public function injectLibraryRepository(LibraryRepository $libraryRepository)
82
-    {
78
+    public function injectLibraryRepository(LibraryRepository $libraryRepository) {
83 79
         $this->libraryRepository = $libraryRepository;
84 80
     }
85 81
 
@@ -90,8 +86,7 @@  discard block
 block discarded – undo
90 86
      *
91 87
      * @return void
92 88
      */
93
-    public function initializeAction()
94
-    {
89
+    public function initializeAction() {
95 90
         $this->request = $this->request->withFormat("xml");
96 91
     }
97 92
 
@@ -136,8 +131,7 @@  discard block
 block discarded – undo
136 131
      *
137 132
      * @return void
138 133
      */
139
-    protected function deleteExpiredTokens()
140
-    {
134
+    protected function deleteExpiredTokens() {
141 135
         // Delete expired resumption tokens.
142 136
         $this->tokenRepository->deleteExpiredTokens($this->settings['expired']);
143 137
     }
@@ -149,8 +143,7 @@  discard block
 block discarded – undo
149 143
      *
150 144
      * @return void
151 145
      */
152
-    protected function getUrlParams()
153
-    {
146
+    protected function getUrlParams() {
154 147
         $allowedParams = [
155 148
             'verb',
156 149
             'identifier',
@@ -181,8 +174,7 @@  discard block
 block discarded – undo
181 174
      *
182 175
      * @return array The mapped metadata array
183 176
      */
184
-    private function getDublinCoreData(array $record)
185
-    {
177
+    private function getDublinCoreData(array $record) {
186 178
         $metadata = [];
187 179
 
188 180
         $metadata[] = ['dc:identifier' => $record['record_id']];
@@ -224,8 +216,7 @@  discard block
 block discarded – undo
224 216
      *
225 217
      * @return void
226 218
      */
227
-    private function addDublinCoreData(&$metadata, $key, $value)
228
-    {
219
+    private function addDublinCoreData(&$metadata, $key, $value) {
229 220
         if (!empty($value)) {
230 221
             $metadata[] = [$key => $value];
231 222
         }
@@ -241,8 +232,7 @@  discard block
 block discarded – undo
241 232
      *
242 233
      * @return string The fetched METS XML
243 234
      */
244
-    protected function getMetsData(array $record)
245
-    {
235
+    protected function getMetsData(array $record) {
246 236
         $mets = null;
247 237
         // Load METS file.
248 238
         $xml = new \DOMDocument();
@@ -335,8 +325,7 @@  discard block
 block discarded – undo
335 325
      *
336 326
      * @return void
337 327
      */
338
-    protected function verbGetRecord()
339
-    {
328
+    protected function verbGetRecord() {
340 329
         if (count($this->parameters) !== 3 || empty($this->parameters['metadataPrefix']) || empty($this->parameters['identifier'])) {
341 330
             $this->error = 'badArgument';
342 331
             return;
@@ -388,8 +377,7 @@  discard block
 block discarded – undo
388 377
      *
389 378
      * @return void
390 379
      */
391
-    protected function verbIdentify()
392
-    {
380
+    protected function verbIdentify() {
393 381
         $library = $this->libraryRepository->findByUid($this->settings['library']);
394 382
 
395 383
         $oaiIdentifyInfo = [];
@@ -438,8 +426,7 @@  discard block
 block discarded – undo
438 426
      *
439 427
      * @return void
440 428
      */
441
-    protected function verbListIdentifiers()
442
-    {
429
+    protected function verbListIdentifiers() {
443 430
         // If we have a resumption token we can continue our work
444 431
         if (!empty($this->parameters['resumptionToken'])) {
445 432
             // "resumptionToken" is an exclusive argument.
@@ -493,8 +480,7 @@  discard block
 block discarded – undo
493 480
      *
494 481
      * @return void
495 482
      */
496
-    protected function verbListMetadataFormats()
497
-    {
483
+    protected function verbListMetadataFormats() {
498 484
         $resArray = [];
499 485
         // check for the optional "identifier" parameter
500 486
         if (isset($this->parameters['identifier'])) {
@@ -526,8 +512,7 @@  discard block
 block discarded – undo
526 512
      *
527 513
      * @return void
528 514
      */
529
-    protected function verbListRecords()
530
-    {
515
+    protected function verbListRecords() {
531 516
         // Check for invalid arguments.
532 517
         if (!empty($this->parameters['resumptionToken'])) {
533 518
             // "resumptionToken" is an exclusive argument.
@@ -582,8 +567,7 @@  discard block
 block discarded – undo
582 567
      *
583 568
      * @return void
584 569
      */
585
-    protected function verbListSets()
586
-    {
570
+    protected function verbListSets() {
587 571
         // It is required to set a oai_name inside the collection record to be shown in oai-pmh plugin.
588 572
         $this->settings['hideEmptyOaiNames'] = true;
589 573
 
@@ -729,8 +713,7 @@  discard block
 block discarded – undo
729 713
      *
730 714
      * @return array|false
731 715
      */
732
-    private function getDate(string $dateType)
733
-    {
716
+    private function getDate(string $dateType) {
734 717
         return strptime($this->parameters[$dateType], '%Y-%m-%dT%H:%M:%SZ') ?: strptime($this->parameters[$dateType], '%Y-%m-%d');
735 718
     }
736 719
 
@@ -785,8 +768,7 @@  discard block
 block discarded – undo
785 768
      *
786 769
      * @return array of enriched records
787 770
      */
788
-    protected function generateOutputForDocumentList(array $documentListSet)
789
-    {
771
+    protected function generateOutputForDocumentList(array $documentListSet) {
790 772
         // check whether any result elements are available
791 773
         if (empty($documentListSet) || empty($documentListSet['elements'])) {
792 774
             $this->error = 'noRecordsMatch';
@@ -841,8 +823,7 @@  discard block
 block discarded – undo
841 823
      *
842 824
      * @return void
843 825
      */
844
-    protected function generateResumptionTokenForDocumentListSet(array $documentListSet, int $numShownDocuments)
845
-    {
826
+    protected function generateResumptionTokenForDocumentListSet(array $documentListSet, int $numShownDocuments) {
846 827
         // The cursor specifies how many elements have already been returned in previous requests
847 828
         // See http://www.openarchives.org/OAI/openarchivesprotocol.html#FlowControl
848 829
         $currentCursor = $documentListSet['metadata']['cursor'];
Please login to merge, or discard this patch.
Upper-Lower-Casing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
      */
244 244
     protected function getMetsData(array $record)
245 245
     {
246
-        $mets = null;
246
+        $mets = NULL;
247 247
         // Load METS file.
248 248
         $xml = new \DOMDocument();
249 249
         if ($xml->load($record['location'])) {
@@ -275,7 +275,7 @@  discard block
 block discarded – undo
275 275
         // Delete expired resumption tokens.
276 276
         $this->deleteExpiredTokens();
277 277
 
278
-        switch ($this->parameters['verb'] ?? null) {
278
+        switch ($this->parameters['verb'] ?? NULL) {
279 279
             case 'GetRecord':
280 280
                 $this->verbGetRecord();
281 281
                 break;
@@ -324,7 +324,7 @@  discard block
 block discarded – undo
324 324
         } else {
325 325
             // No resumption token found or resumption token expired.
326 326
             $this->error = 'badResumptionToken';
327
-            return null;
327
+            return NULL;
328 328
         }
329 329
     }
330 330
 
@@ -585,7 +585,7 @@  discard block
 block discarded – undo
585 585
     protected function verbListSets()
586 586
     {
587 587
         // It is required to set a oai_name inside the collection record to be shown in oai-pmh plugin.
588
-        $this->settings['hideEmptyOaiNames'] = true;
588
+        $this->settings['hideEmptyOaiNames'] = TRUE;
589 589
 
590 590
         $oaiSets = $this->collectionRepository->findCollectionsBySettings($this->settings);
591 591
 
@@ -848,7 +848,7 @@  discard block
 block discarded – undo
848 848
         $currentCursor = $documentListSet['metadata']['cursor'];
849 849
 
850 850
         if (count($documentListSet['elements']) !== 0) {
851
-            $resumptionToken = uniqid('', false);
851
+            $resumptionToken = uniqid('', FALSE);
852 852
 
853 853
             $documentListSet['metadata']['cursor'] += $numShownDocuments;
854 854
 
Please login to merge, or discard this patch.
Classes/Controller/StatisticsController.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -21,8 +21,7 @@
 block discarded – undo
21 21
  *
22 22
  * @access public
23 23
  */
24
-class StatisticsController extends AbstractController
25
-{
24
+class StatisticsController extends AbstractController {
26 25
     /**
27 26
      * The main method of the plugin
28 27
      *
Please login to merge, or discard this patch.
Classes/Controller/ListViewController.php 3 patches
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -24,8 +24,7 @@
 block discarded – undo
24 24
  *
25 25
  * @access public
26 26
  */
27
-class ListViewController extends AbstractController
28
-{
27
+class ListViewController extends AbstractController {
29 28
     /**
30 29
      * @access protected
31 30
      * @var CollectionRepository
Please login to merge, or discard this patch.
Upper-Lower-Casing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -91,15 +91,15 @@
 block discarded – undo
91 91
         $currentPage = $this->requestData['page'] ?? 1;
92 92
 
93 93
         // get all sortable metadata records
94
-        $sortableMetadata = $this->metadataRepository->findByIsSortable(true);
94
+        $sortableMetadata = $this->metadataRepository->findByIsSortable(TRUE);
95 95
 
96 96
         // get all metadata records to be shown in results
97
-        $listedMetadata = $this->metadataRepository->findByIsListed(true);
97
+        $listedMetadata = $this->metadataRepository->findByIsListed(TRUE);
98 98
 
99 99
         // get all indexed metadata fields
100
-        $indexedMetadata = $this->metadataRepository->findByIndexIndexed(true);
100
+        $indexedMetadata = $this->metadataRepository->findByIndexIndexed(TRUE);
101 101
 
102
-        $solrResults = null;
102
+        $solrResults = NULL;
103 103
         $numResults = 0;
104 104
         if (is_array($this->searchParams) && !empty($this->searchParams)) {
105 105
             $solrResults = $this->documentRepository->findSolrByCollections($collections, $this->settings, $this->searchParams, $listedMetadata, $indexedMetadata);
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
         // extract collection(s) from collection parameter
84 84
         $collections = [];
85 85
         if (is_array($this->searchParams) && array_key_exists('collection', $this->searchParams)) {
86
-            foreach(explode(',', $this->searchParams['collection']) as $collectionEntry) {
86
+            foreach (explode(',', $this->searchParams['collection']) as $collectionEntry) {
87 87
                 if (!empty($collectionEntry)) {
88 88
                     $collections[] = $this->collectionRepository->findByUid((int) $collectionEntry);
89 89
                 }
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
             $simplePagination = new SimplePagination($solrPaginator);
117 117
 
118 118
             $pagination = $this->buildSimplePagination($simplePagination, $solrPaginator);
119
-            $this->view->assignMultiple([ 'pagination' => $pagination, 'paginator' => $solrPaginator ]);
119
+            $this->view->assignMultiple(['pagination' => $pagination, 'paginator' => $solrPaginator]);
120 120
         }
121 121
 
122 122
         $this->view->assign('viewData', $this->viewData);
Please login to merge, or discard this patch.