@@ -129,7 +129,7 @@ |
||
129 | 129 | $this->raw->registerXPathNamespace('personal-details', 'http://www.orcid.org/ns/personal-details'); |
130 | 130 | $givenNames = $this->raw->xpath('./personal-details:name/personal-details:given-names'); |
131 | 131 | $familyName = $this->raw->xpath('./personal-details:name/personal-details:family-name'); |
132 | - return (string) $givenNames[0] . ' ' . (string) $familyName[0]; |
|
132 | + return (string) $givenNames[0].' '.(string) $familyName[0]; |
|
133 | 133 | } else { |
134 | 134 | $this->logger->warning('No name found for given ORCID'); |
135 | 135 | return false; |
@@ -26,8 +26,7 @@ discard block |
||
26 | 26 | * |
27 | 27 | * @access public |
28 | 28 | **/ |
29 | -class Profile |
|
30 | -{ |
|
29 | +class Profile { |
|
31 | 30 | /** |
32 | 31 | * @access protected |
33 | 32 | * @var Logger This holds the logger |
@@ -55,8 +54,7 @@ discard block |
||
55 | 54 | * |
56 | 55 | * @return void |
57 | 56 | **/ |
58 | - public function __construct(string $orcid) |
|
59 | - { |
|
57 | + public function __construct(string $orcid) { |
|
60 | 58 | $this->logger = GeneralUtility::makeInstance(LogManager::class)->getLogger(static::class); |
61 | 59 | $this->client = new Client($orcid, GeneralUtility::makeInstance(RequestFactory::class)); |
62 | 60 | } |
@@ -68,8 +66,7 @@ discard block |
||
68 | 66 | * |
69 | 67 | * @return array|false |
70 | 68 | **/ |
71 | - public function getData() |
|
72 | - { |
|
69 | + public function getData() { |
|
73 | 70 | $this->getRaw('person'); |
74 | 71 | if ($this->raw !== false && !empty($this->raw)) { |
75 | 72 | $data = []; |
@@ -90,8 +87,7 @@ discard block |
||
90 | 87 | * |
91 | 88 | * @return string|false |
92 | 89 | **/ |
93 | - public function getAddress() |
|
94 | - { |
|
90 | + public function getAddress() { |
|
95 | 91 | $this->getRaw('address'); |
96 | 92 | if ($this->raw !== false && !empty($this->raw)) { |
97 | 93 | $this->raw->registerXPathNamespace('address', 'http://www.orcid.org/ns/address'); |
@@ -109,8 +105,7 @@ discard block |
||
109 | 105 | * |
110 | 106 | * @return string|false |
111 | 107 | **/ |
112 | - public function getEmail() |
|
113 | - { |
|
108 | + public function getEmail() { |
|
114 | 109 | $this->getRaw('email'); |
115 | 110 | if ($this->raw !== false && !empty($this->raw)) { |
116 | 111 | $this->raw->registerXPathNamespace('email', 'http://www.orcid.org/ns/email'); |
@@ -128,8 +123,7 @@ discard block |
||
128 | 123 | * |
129 | 124 | * @return string|false |
130 | 125 | **/ |
131 | - public function getFullName() |
|
132 | - { |
|
126 | + public function getFullName() { |
|
133 | 127 | $this->getRaw('personal-details'); |
134 | 128 | if ($this->raw !== false && !empty($this->raw)) { |
135 | 129 | $this->raw->registerXPathNamespace('personal-details', 'http://www.orcid.org/ns/personal-details'); |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | * @access private |
45 | 45 | * @var \SimpleXmlElement|false The raw ORCID profile |
46 | 46 | **/ |
47 | - private $raw = false; |
|
47 | + private $raw = FALSE; |
|
48 | 48 | |
49 | 49 | /** |
50 | 50 | * Constructs client instance |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | public function getData() |
72 | 72 | { |
73 | 73 | $this->getRaw('person'); |
74 | - if ($this->raw !== false && !empty($this->raw)) { |
|
74 | + if ($this->raw !== FALSE && !empty($this->raw)) { |
|
75 | 75 | $data = []; |
76 | 76 | $data['address'] = $this->getAddress(); |
77 | 77 | $data['email'] = $this->getEmail(); |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | return $data; |
80 | 80 | } else { |
81 | 81 | $this->logger->warning('No data found for given ORCID'); |
82 | - return false; |
|
82 | + return FALSE; |
|
83 | 83 | } |
84 | 84 | } |
85 | 85 | |
@@ -93,12 +93,12 @@ discard block |
||
93 | 93 | public function getAddress() |
94 | 94 | { |
95 | 95 | $this->getRaw('address'); |
96 | - if ($this->raw !== false && !empty($this->raw)) { |
|
96 | + if ($this->raw !== FALSE && !empty($this->raw)) { |
|
97 | 97 | $this->raw->registerXPathNamespace('address', 'http://www.orcid.org/ns/address'); |
98 | 98 | return (string) $this->raw->xpath('./address:address/address:country')[0]; |
99 | 99 | } else { |
100 | 100 | $this->logger->warning('No address found for given ORCID'); |
101 | - return false; |
|
101 | + return FALSE; |
|
102 | 102 | } |
103 | 103 | } |
104 | 104 | |
@@ -112,12 +112,12 @@ discard block |
||
112 | 112 | public function getEmail() |
113 | 113 | { |
114 | 114 | $this->getRaw('email'); |
115 | - if ($this->raw !== false && !empty($this->raw)) { |
|
115 | + if ($this->raw !== FALSE && !empty($this->raw)) { |
|
116 | 116 | $this->raw->registerXPathNamespace('email', 'http://www.orcid.org/ns/email'); |
117 | 117 | return (string) $this->raw->xpath('./email:email/email:email')[0]; |
118 | 118 | } else { |
119 | 119 | $this->logger->warning('No email found for given ORCID'); |
120 | - return false; |
|
120 | + return FALSE; |
|
121 | 121 | } |
122 | 122 | } |
123 | 123 | |
@@ -131,14 +131,14 @@ discard block |
||
131 | 131 | public function getFullName() |
132 | 132 | { |
133 | 133 | $this->getRaw('personal-details'); |
134 | - if ($this->raw !== false && !empty($this->raw)) { |
|
134 | + if ($this->raw !== FALSE && !empty($this->raw)) { |
|
135 | 135 | $this->raw->registerXPathNamespace('personal-details', 'http://www.orcid.org/ns/personal-details'); |
136 | 136 | $givenNames = $this->raw->xpath('./personal-details:name/personal-details:given-names'); |
137 | 137 | $familyName = $this->raw->xpath('./personal-details:name/personal-details:family-name'); |
138 | 138 | return (string) $givenNames[0] . ' ' . (string) $familyName[0]; |
139 | 139 | } else { |
140 | 140 | $this->logger->warning('No name found for given ORCID'); |
141 | - return false; |
|
141 | + return FALSE; |
|
142 | 142 | } |
143 | 143 | } |
144 | 144 | |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | { |
156 | 156 | $this->client->setEndpoint($endpoint); |
157 | 157 | $data = $this->client->getData(); |
158 | - if ($data != false) { |
|
158 | + if ($data != FALSE) { |
|
159 | 159 | $this->raw = Helper::getXmlFileAsString($data); |
160 | 160 | } |
161 | 161 | } |
@@ -24,8 +24,7 @@ |
||
24 | 24 | * |
25 | 25 | * @access public |
26 | 26 | */ |
27 | -class EditInProductionWarning extends AbstractNode |
|
28 | -{ |
|
27 | +class EditInProductionWarning extends AbstractNode { |
|
29 | 28 | /** |
30 | 29 | * Generates warning message when editing 'index_name' field |
31 | 30 | * |
@@ -33,8 +33,7 @@ |
||
33 | 33 | * |
34 | 34 | * @access public |
35 | 35 | */ |
36 | -class DataHandler implements LoggerAwareInterface |
|
37 | -{ |
|
36 | +class DataHandler implements LoggerAwareInterface { |
|
38 | 37 | use LoggerAwareTrait; |
39 | 38 | |
40 | 39 | /** |
@@ -149,10 +149,10 @@ discard block |
||
149 | 149 | ) { |
150 | 150 | // Get current configuration. |
151 | 151 | $result = $queryBuilder |
152 | - ->select($table . '.is_listed AS is_listed') |
|
152 | + ->select($table.'.is_listed AS is_listed') |
|
153 | 153 | ->from($table) |
154 | 154 | ->where( |
155 | - $queryBuilder->expr()->eq($table . '.uid', (int) $id), |
|
155 | + $queryBuilder->expr()->eq($table.'.uid', (int) $id), |
|
156 | 156 | Helper::whereExpression($table) |
157 | 157 | ) |
158 | 158 | ->setMaxResults(1) |
@@ -175,10 +175,10 @@ discard block |
||
175 | 175 | ) { |
176 | 176 | // Get current configuration. |
177 | 177 | $result = $queryBuilder |
178 | - ->select($table . '.index_autocomplete AS index_autocomplete') |
|
178 | + ->select($table.'.index_autocomplete AS index_autocomplete') |
|
179 | 179 | ->from($table) |
180 | 180 | ->where( |
181 | - $queryBuilder->expr()->eq($table . '.uid', (int) $id), |
|
181 | + $queryBuilder->expr()->eq($table.'.uid', (int) $id), |
|
182 | 182 | Helper::whereExpression($table) |
183 | 183 | ) |
184 | 184 | ->setMaxResults(1) |
@@ -348,7 +348,7 @@ discard block |
||
348 | 348 | if ($solr->ready) { |
349 | 349 | // Delete Solr document. |
350 | 350 | $updateQuery = $solr->service->createUpdate(); |
351 | - $updateQuery->addDeleteQuery('uid:' . (int) $id); |
|
351 | + $updateQuery->addDeleteQuery('uid:'.(int) $id); |
|
352 | 352 | $updateQuery->addCommit(false); |
353 | 353 | $solr->service->update($updateQuery); |
354 | 354 | } |
@@ -371,7 +371,7 @@ discard block |
||
371 | 371 | $document->setCurrentDocument($doc); |
372 | 372 | Indexer::add($document, $this->getDocumentRepository()); |
373 | 373 | } else { |
374 | - $this->logger->error('Failed to re-index document with UID ' . (string) $id); |
|
374 | + $this->logger->error('Failed to re-index document with UID '.(string) $id); |
|
375 | 375 | } |
376 | 376 | } |
377 | 377 | |
@@ -422,7 +422,7 @@ discard block |
||
422 | 422 | try { |
423 | 423 | $response = $solr->service->coreAdmin($query); |
424 | 424 | if ($response->getWasSuccessful() == false) { |
425 | - $this->logger->warning('Core ' . $resArray['core'] . ' could not be deleted from Apache Solr'); |
|
425 | + $this->logger->warning('Core '.$resArray['core'].' could not be deleted from Apache Solr'); |
|
426 | 426 | } |
427 | 427 | } catch (\Exception $e) { |
428 | 428 | $this->logger->warning($e->getMessage()); |
@@ -349,7 +349,7 @@ discard block |
||
349 | 349 | // Delete Solr document. |
350 | 350 | $updateQuery = $solr->service->createUpdate(); |
351 | 351 | $updateQuery->addDeleteQuery('uid:' . (int) $id); |
352 | - $updateQuery->addCommit(false); |
|
352 | + $updateQuery->addCommit(FALSE); |
|
353 | 353 | $solr->service->update($updateQuery); |
354 | 354 | } |
355 | 355 | } |
@@ -366,8 +366,8 @@ discard block |
||
366 | 366 | private function reindexDocument($id):void |
367 | 367 | { |
368 | 368 | $document = $this->getDocumentRepository()->findByUid((int) $id); |
369 | - $doc = AbstractDocument::getInstance($document->getLocation(), ['storagePid' => $document->getPid()], true); |
|
370 | - if ($document !== null && $doc !== null) { |
|
369 | + $doc = AbstractDocument::getInstance($document->getLocation(), ['storagePid' => $document->getPid()], TRUE); |
|
370 | + if ($document !== NULL && $doc !== NULL) { |
|
371 | 371 | $document->setCurrentDocument($doc); |
372 | 372 | Indexer::add($document, $this->getDocumentRepository()); |
373 | 373 | } else { |
@@ -415,13 +415,13 @@ discard block |
||
415 | 415 | $query = $solr->service->createCoreAdmin(); |
416 | 416 | $action = $query->createUnload(); |
417 | 417 | $action->setCore($resArray['core']); |
418 | - $action->setDeleteDataDir(true); |
|
419 | - $action->setDeleteIndex(true); |
|
420 | - $action->setDeleteInstanceDir(true); |
|
418 | + $action->setDeleteDataDir(TRUE); |
|
419 | + $action->setDeleteIndex(TRUE); |
|
420 | + $action->setDeleteInstanceDir(TRUE); |
|
421 | 421 | $query->setAction($action); |
422 | 422 | try { |
423 | 423 | $response = $solr->service->coreAdmin($query); |
424 | - if ($response->getWasSuccessful() == false) { |
|
424 | + if ($response->getWasSuccessful() == FALSE) { |
|
425 | 425 | $this->logger->warning('Core ' . $resArray['core'] . ' could not be deleted from Apache Solr'); |
426 | 426 | } |
427 | 427 | } catch (\Exception $e) { |
@@ -57,7 +57,7 @@ |
||
57 | 57 | } |
58 | 58 | $dmdIds = explode(' ', $id); |
59 | 59 | foreach ($dmdIds as $dmdId) { |
60 | - $recordIds = $xml->xpath('//mets:dmdSec[@ID="' . $dmdId . '"]//mods:mods/mods:recordInfo/mods:recordIdentifier'); |
|
60 | + $recordIds = $xml->xpath('//mets:dmdSec[@ID="'.$dmdId.'"]//mods:mods/mods:recordInfo/mods:recordIdentifier'); |
|
61 | 61 | if (!empty($recordIds)) { |
62 | 62 | $recordId = (string) $recordIds[0]; |
63 | 63 | break; |
@@ -20,8 +20,7 @@ |
||
20 | 20 | * |
21 | 21 | * @access public |
22 | 22 | */ |
23 | -class KitodoProductionHacks |
|
24 | -{ |
|
23 | +class KitodoProductionHacks { |
|
25 | 24 | /** |
26 | 25 | * Hook for \Kitodo\Dlf\Common\MetsDocument::establishRecordId() |
27 | 26 | * When using Kitodo.Production the record identifier is saved only in MODS, but not |
@@ -24,8 +24,7 @@ discard block |
||
24 | 24 | * |
25 | 25 | * @access public |
26 | 26 | */ |
27 | -class ConfigurationForm |
|
28 | -{ |
|
27 | +class ConfigurationForm { |
|
29 | 28 | |
30 | 29 | /** |
31 | 30 | * Check if a connection to a Solr server could be established with the given credentials. |
@@ -60,8 +59,7 @@ discard block |
||
60 | 59 | * |
61 | 60 | * @return void |
62 | 61 | */ |
63 | - public function __construct() |
|
64 | - { |
|
62 | + public function __construct() { |
|
65 | 63 | // Load backend localization file. |
66 | 64 | Helper::getLanguageService()->includeLLFile('EXT:dlf/Resources/Private/Language/locallang_be.xlf'); |
67 | 65 | } |
@@ -29,8 +29,7 @@ |
||
29 | 29 | * |
30 | 30 | * @access public |
31 | 31 | */ |
32 | -class ItemsProcFunc implements LoggerAwareInterface |
|
33 | -{ |
|
32 | +class ItemsProcFunc implements LoggerAwareInterface { |
|
34 | 33 | use LoggerAwareTrait; |
35 | 34 | |
36 | 35 | /** |
@@ -155,8 +155,8 @@ |
||
155 | 155 | ->select(...explode(',', $fields)) |
156 | 156 | ->from($table) |
157 | 157 | ->where( |
158 | - $queryBuilder->expr()->eq($table . '.pid', $this->storagePid), |
|
159 | - $queryBuilder->expr()->in($table . '.sys_language_uid', [-1, 0]), |
|
158 | + $queryBuilder->expr()->eq($table.'.pid', $this->storagePid), |
|
159 | + $queryBuilder->expr()->in($table.'.sys_language_uid', [-1, 0]), |
|
160 | 160 | $andWhere |
161 | 161 | ) |
162 | 162 | ->orderBy($sorting) |
@@ -190,9 +190,9 @@ discard block |
||
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 |
||
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 |
||
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)) { |
@@ -171,8 +171,7 @@ |
||
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; |
@@ -105,11 +105,11 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
@@ -22,8 +22,7 @@ discard block |
||
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 |
||
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 | ]; |
@@ -116,12 +116,10 @@ |
||
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(); |
@@ -179,7 +179,7 @@ discard block |
||
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 |
||
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 |
||
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 |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | |
140 | 140 | // Load document with current plugin parameters. |
141 | 141 | $this->loadDocument($queryParams['tx_dlf'], $cPid); |
142 | - if (!isset($this->document) || $this->document->getCurrentDocument() === null) { |
|
142 | + if (!isset($this->document) || $this->document->getCurrentDocument() === NULL) { |
|
143 | 143 | return $type; |
144 | 144 | } |
145 | 145 | |
@@ -172,18 +172,18 @@ discard block |
||
172 | 172 | // Try to get document format from database |
173 | 173 | if (!empty($requestData['id'])) { |
174 | 174 | $this->initializeRepositories($pid); |
175 | - $doc = null; |
|
175 | + $doc = NULL; |
|
176 | 176 | if (MathUtility::canBeInterpretedAsInteger($requestData['id'])) { |
177 | 177 | // find document from repository by uid |
178 | 178 | $this->document = $this->documentRepository->findOneByIdAndSettings((int) $requestData['id'], ['storagePid' => $pid]); |
179 | 179 | if ($this->document) { |
180 | - $doc = AbstractDocument::getInstance($this->document->getLocation(), ['storagePid' => $pid], true); |
|
180 | + $doc = AbstractDocument::getInstance($this->document->getLocation(), ['storagePid' => $pid], TRUE); |
|
181 | 181 | } else { |
182 | 182 | $this->logger->error('Invalid UID "' . $requestData['id'] . '" or PID "' . $pid . '" for document loading'); |
183 | 183 | } |
184 | 184 | } elseif (GeneralUtility::isValidUrl($requestData['id'])) { |
185 | - $doc = AbstractDocument::getInstance($requestData['id'], ['storagePid' => $pid], true); |
|
186 | - if ($doc !== null) { |
|
185 | + $doc = AbstractDocument::getInstance($requestData['id'], ['storagePid' => $pid], TRUE); |
|
186 | + if ($doc !== NULL) { |
|
187 | 187 | if ($doc->recordId) { |
188 | 188 | $this->document = $this->documentRepository->findOneByRecordId($doc->recordId); |
189 | 189 | } |
@@ -196,14 +196,14 @@ discard block |
||
196 | 196 | $this->logger->error('Invalid location given "' . $requestData['id'] . '" for document loading'); |
197 | 197 | } |
198 | 198 | } |
199 | - if ($this->document !== null && $doc !== null) { |
|
199 | + if ($this->document !== NULL && $doc !== NULL) { |
|
200 | 200 | $this->document->setCurrentDocument($doc); |
201 | 201 | } |
202 | 202 | } elseif (!empty($requestData['recordId'])) { |
203 | 203 | $this->document = $this->documentRepository->findOneByRecordId($requestData['recordId']); |
204 | - if ($this->document !== null) { |
|
205 | - $doc = AbstractDocument::getInstance($this->document->getLocation(), ['storagePid' => $pid], true); |
|
206 | - if ($doc !== null) { |
|
204 | + if ($this->document !== NULL) { |
|
205 | + $doc = AbstractDocument::getInstance($this->document->getLocation(), ['storagePid' => $pid], TRUE); |
|
206 | + if ($doc !== NULL) { |
|
207 | 207 | $this->document->setCurrentDocument($doc); |
208 | 208 | } else { |
209 | 209 | $this->logger->error('Failed to load document with record ID "' . $requestData['recordId'] . '"'); |