@@ -460,7 +460,7 @@ discard block |
||
| 460 | 460 | if ($this->accessRestrictionRoles) { |
| 461 | 461 | return array_map('trim', explode(',', $this->accessRestrictionRoles)); |
| 462 | 462 | } else { |
| 463 | - return array(); |
|
| 463 | + return array (); |
|
| 464 | 464 | } |
| 465 | 465 | } |
| 466 | 466 | |
@@ -827,7 +827,7 @@ discard block |
||
| 827 | 827 | } |
| 828 | 828 | |
| 829 | 829 | protected function isRepeatable() { |
| 830 | - return !in_array($this->getObjectType(), ['fileDownload','fileArchive','fileLabel']) |
|
| 830 | + return !in_array($this->getObjectType(), ['fileDownload', 'fileArchive', 'fileLabel']) |
|
| 831 | 831 | && $this->getInputField() != self::FILE_UPLOAD; |
| 832 | 832 | } |
| 833 | 833 | } |
@@ -219,7 +219,7 @@ |
||
| 219 | 219 | |
| 220 | 220 | public function getFileNames() |
| 221 | 221 | { |
| 222 | - $fileNames = array(); |
|
| 222 | + $fileNames = array (); |
|
| 223 | 223 | foreach ($this->getFiles() as $file) { |
| 224 | 224 | $fileNames[] = $file->getTitle(); |
| 225 | 225 | } |
@@ -258,8 +258,8 @@ discard block |
||
| 258 | 258 | $doc->setProcessNumber($processNumber); |
| 259 | 259 | } |
| 260 | 260 | |
| 261 | - if ($this->documentManager->update($doc, null,true)) { |
|
| 262 | - return '{"success": "Document '.$document.' added '.$id.'"}'; |
|
| 261 | + if ($this->documentManager->update($doc, null, true)) { |
|
| 262 | + return '{"success": "Document ' . $document . ' added ' . $id . '"}'; |
|
| 263 | 263 | } else { |
| 264 | 264 | return '{"failed": Could not update the Document"}'; |
| 265 | 265 | } |
@@ -298,7 +298,7 @@ discard block |
||
| 298 | 298 | return '{"error": "Invalid data in parameter json."}'; |
| 299 | 299 | } |
| 300 | 300 | } else { |
| 301 | - if (empty($json) || json_decode($json,true) === []) { |
|
| 301 | + if (empty($json) || json_decode($json, true) === []) { |
|
| 302 | 302 | return '{"error": "Parameter json can not be empty."}'; |
| 303 | 303 | } |
| 304 | 304 | if (is_null(json_decode($json))) { |
@@ -310,7 +310,7 @@ discard block |
||
| 310 | 310 | $doc = $this->documentManager->read($document); |
| 311 | 311 | |
| 312 | 312 | if (!$doc) { |
| 313 | - return '{"failed": "Document does not exist: '.$document.'"}'; |
|
| 313 | + return '{"failed": "Document does not exist: ' . $document . '"}'; |
|
| 314 | 314 | } |
| 315 | 315 | |
| 316 | 316 | if ($doc->getState() === DocumentWorkflow::STATE_NEW_NONE) { |
@@ -323,7 +323,7 @@ discard block |
||
| 323 | 323 | } |
| 324 | 324 | |
| 325 | 325 | if ($linkedDocument) { |
| 326 | - return '{"failed": "There is already a suggestion for the document: '.$linkedDocument->getUid().'"}'; |
|
| 326 | + return '{"failed": "There is already a suggestion for the document: ' . $linkedDocument->getUid() . '"}'; |
|
| 327 | 327 | } |
| 328 | 328 | |
| 329 | 329 | $mapper = $this->objectManager->get(\EWW\Dpf\Services\Api\JsonToDocumentMapper::class); |
@@ -681,7 +681,7 @@ discard block |
||
| 681 | 681 | $missingArguments = []; |
| 682 | 682 | foreach ($parameterNames as $parameterName) { |
| 683 | 683 | if (!$this->request->hasArgument($parameterName)) { |
| 684 | - $missingArguments[] = $parameterName; |
|
| 684 | + $missingArguments[] = $parameterName; |
|
| 685 | 685 | } |
| 686 | 686 | } |
| 687 | 687 | |
@@ -689,7 +689,7 @@ discard block |
||
| 689 | 689 | $this->throwStatus( |
| 690 | 690 | 400, |
| 691 | 691 | null, |
| 692 | - '{"error": "Missing parameters: '.implode(", ", $missingArguments).'"}' |
|
| 692 | + '{"error": "Missing parameters: ' . implode(", ", $missingArguments) . '"}' |
|
| 693 | 693 | ); |
| 694 | 694 | } |
| 695 | 695 | |
@@ -719,7 +719,7 @@ discard block |
||
| 719 | 719 | $this->throwStatus( |
| 720 | 720 | 400, |
| 721 | 721 | null, |
| 722 | - '{"error": "An invalid action hes been called: '.$actionName.'"}' |
|
| 722 | + '{"error": "An invalid action hes been called: ' . $actionName . '"}' |
|
| 723 | 723 | ); |
| 724 | 724 | } |
| 725 | 725 | |
@@ -192,7 +192,7 @@ discard block |
||
| 192 | 192 | $this->request->setArguments($requestArguments); |
| 193 | 193 | } else { |
| 194 | 194 | $t = $docForm->getFileNames(); |
| 195 | - $this->redirect('list', 'DocumentForm', null, array('message' => 'UPLOAD_MAX_FILESIZE_ERROR', 'errorFiles' => $t)); |
|
| 195 | + $this->redirect('list', 'DocumentForm', null, array ('message' => 'UPLOAD_MAX_FILESIZE_ERROR', 'errorFiles' => $t)); |
|
| 196 | 196 | } |
| 197 | 197 | } else { |
| 198 | 198 | $this->redirectToList("UPLOAD_POST_SIZE_ERROR"); |
@@ -355,7 +355,7 @@ discard block |
||
| 355 | 355 | $this->request->setArguments($requestArguments); |
| 356 | 356 | } else { |
| 357 | 357 | $t = $docForm->getFileNames(); |
| 358 | - $this->redirect('list', 'Document', null, array('message' => 'UPLOAD_MAX_FILESIZE_ERROR', 'errorFiles' => $t)); |
|
| 358 | + $this->redirect('list', 'Document', null, array ('message' => 'UPLOAD_MAX_FILESIZE_ERROR', 'errorFiles' => $t)); |
|
| 359 | 359 | } |
| 360 | 360 | } else { |
| 361 | 361 | $this->redirectToList("UPLOAD_POST_SIZE_ERROR"); |
@@ -27,7 +27,7 @@ |
||
| 27 | 27 | */ |
| 28 | 28 | public function __construct(ObjectStorage $documentFiles) |
| 29 | 29 | { |
| 30 | - $idList = array(); |
|
| 30 | + $idList = array (); |
|
| 31 | 31 | $this->id = 0; |
| 32 | 32 | |
| 33 | 33 | if (is_a($documentFiles, ObjectStorage::class)) { |
@@ -45,13 +45,13 @@ discard block |
||
| 45 | 45 | * |
| 46 | 46 | * @var array |
| 47 | 47 | */ |
| 48 | - protected $formData = array(); |
|
| 48 | + protected $formData = array (); |
|
| 49 | 49 | |
| 50 | 50 | /** |
| 51 | 51 | * files from form |
| 52 | 52 | * @var array |
| 53 | 53 | */ |
| 54 | - protected $files = array(); |
|
| 54 | + protected $files = array (); |
|
| 55 | 55 | |
| 56 | 56 | /** |
| 57 | 57 | * metsData |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | |
| 112 | 112 | $this->xmlHeader = '<data' . $this->namespaceString . '></data>'; |
| 113 | 113 | |
| 114 | - $this->xmlData = new \DOMDocument(); |
|
| 114 | + $this->xmlData = new \DOMDocument(); |
|
| 115 | 115 | $this->xmlData->loadXML($this->xmlHeader); |
| 116 | 116 | |
| 117 | 117 | // Parser |
@@ -164,7 +164,7 @@ discard block |
||
| 164 | 164 | // mods extension |
| 165 | 165 | if ($group['modsExtensionMapping']) { |
| 166 | 166 | $counter = sprintf("%'03d", $this->counter); |
| 167 | - $attributeXPath .= '[@ID="'.$fedoraNamespace.'_' . $counter . '"]'; |
|
| 167 | + $attributeXPath .= '[@ID="' . $fedoraNamespace . '_' . $counter . '"]'; |
|
| 168 | 168 | } |
| 169 | 169 | |
| 170 | 170 | $existsExtensionFlag = false; |
@@ -205,7 +205,7 @@ discard block |
||
| 205 | 205 | } |
| 206 | 206 | } |
| 207 | 207 | if (!$existsExtensionFlag && $group['modsExtensionMapping']) { |
| 208 | - $xPath = $group['modsExtensionMapping'] . $extensionAttribute . '[@' . $group['modsExtensionReference'] . '="'.$fedoraNamespace.'_' . $counter . '"]'; |
|
| 208 | + $xPath = $group['modsExtensionMapping'] . $extensionAttribute . '[@' . $group['modsExtensionReference'] . '="' . $fedoraNamespace . '_' . $counter . '"]'; |
|
| 209 | 209 | $xml = $this->customXPath($xPath, true, '', true); |
| 210 | 210 | } |
| 211 | 211 | if ($group['modsExtensionMapping']) { |
@@ -290,7 +290,7 @@ discard block |
||
| 290 | 290 | $nestedXml = $this->parseXPath($nested); |
| 291 | 291 | |
| 292 | 292 | // object xpath without nested element [] |
| 293 | - $newPath[1] = str_replace('['.$match[2].']', '', $newPath[1]); |
|
| 293 | + $newPath[1] = str_replace('[' . $match[2] . ']', '', $newPath[1]); |
|
| 294 | 294 | |
| 295 | 295 | $xml = $this->parseXPath($newPath[1]); |
| 296 | 296 | |
@@ -360,7 +360,7 @@ discard block |
||
| 360 | 360 | $nestedXml = $this->parseXPathWrapped($nested); |
| 361 | 361 | |
| 362 | 362 | // object xpath without nested element [] |
| 363 | - $newPath[1] = str_replace('['.$match[2].']', '', $newPath[1]); |
|
| 363 | + $newPath[1] = str_replace('[' . $match[2] . ']', '', $newPath[1]); |
|
| 364 | 364 | |
| 365 | 365 | $xml2 = $this->parseXPathWrapped($path . $newPath[1]); |
| 366 | 366 | } |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | $logger->log( |
| 89 | 89 | LogLevel::WARNING, |
| 90 | 90 | "Input XML: No transformation file is present. The given xml data was taken over as it is", |
| 91 | - array( |
|
| 91 | + array ( |
|
| 92 | 92 | 'documentTypeName' => $documentTypeName |
| 93 | 93 | ) |
| 94 | 94 | ); |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | $filePath = $transformationFile->getFile()->getOriginalResource()->getIdentifier(); |
| 120 | 120 | $documentTransformer = new DocumentTransformer(); |
| 121 | 121 | |
| 122 | - if ( !$document->getRemoteState() || $document->getRemoteState() == 'NONE' ) { |
|
| 122 | + if (!$document->getRemoteState() || $document->getRemoteState() == 'NONE') { |
|
| 123 | 123 | $remoteState = 'ACTIVE'; |
| 124 | 124 | } else { |
| 125 | 125 | $remoteState = $document->getRemoteState(); |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | ); |
| 139 | 139 | } else { |
| 140 | 140 | $transformedXml = $documentTransformer->transform( |
| 141 | - Environment::getPublicPath(). '/fileadmin' . $filePath, $document->publicXml(), $transformParams |
|
| 141 | + Environment::getPublicPath() . '/fileadmin' . $filePath, $document->publicXml(), $transformParams |
|
| 142 | 142 | ); |
| 143 | 143 | } |
| 144 | 144 | |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | $logger->log( |
| 155 | 155 | LogLevel::WARNING, |
| 156 | 156 | "Output XML: No transformation file is present. The generated xml data was taken over as it is", |
| 157 | - array( |
|
| 157 | + array ( |
|
| 158 | 158 | 'documentTypeName' => $documentTypeName |
| 159 | 159 | ) |
| 160 | 160 | ); |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | ( |
| 143 | 143 | $this->getSettings()['deactivatePrimaryFileMandatoryCheck'] || |
| 144 | 144 | $document->getDocumentType()->getVirtualType() |
| 145 | - )? false : true |
|
| 145 | + ) ? false : true |
|
| 146 | 146 | ) |
| 147 | 147 | ); |
| 148 | 148 | |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | |
| 160 | 160 | $internalFormat = new \EWW\Dpf\Helper\InternalFormat($document->getXmlData(), $this->clientPid); |
| 161 | 161 | |
| 162 | - $excludeGroupAttributes = array(); |
|
| 162 | + $excludeGroupAttributes = array (); |
|
| 163 | 163 | |
| 164 | 164 | foreach ($document->getDocumentType()->getMetadataPage() as $metadataPage) { |
| 165 | 165 | $documentFormPage = new \EWW\Dpf\Domain\Model\DocumentFormPage(); |
@@ -190,7 +190,7 @@ discard block |
||
| 190 | 190 | $xpath = $internalFormat->getXpath(); |
| 191 | 191 | |
| 192 | 192 | // get fixed attributes from xpath configuration |
| 193 | - $fixedGroupAttributes = array(); |
|
| 193 | + $fixedGroupAttributes = array (); |
|
| 194 | 194 | |
| 195 | 195 | preg_match_all('/[A-Za-z0-9:@\.]+(\[@.*?\])*/', $metadataGroup->getAbsoluteMapping(), $groupMappingPathParts); |
| 196 | 196 | $groupMappingPathParts = $groupMappingPathParts[0]; |
@@ -458,7 +458,7 @@ discard block |
||
| 458 | 458 | |
| 459 | 459 | foreach ($group as $groupItem) { |
| 460 | 460 | |
| 461 | - $item = array(); |
|
| 461 | + $item = array (); |
|
| 462 | 462 | |
| 463 | 463 | $uid = $groupItem->getUid(); |
| 464 | 464 | $metadataGroup = $this->metadataGroupRepository->findByUid($uid); |
@@ -483,7 +483,7 @@ discard block |
||
| 483 | 483 | |
| 484 | 484 | $fieldMapping = $metadataObject->getRelativeMapping(); |
| 485 | 485 | |
| 486 | - $formField = array(); |
|
| 486 | + $formField = array (); |
|
| 487 | 487 | |
| 488 | 488 | $value = $fieldItem->getValue(); |
| 489 | 489 | |
@@ -533,11 +533,11 @@ discard block |
||
| 533 | 533 | } |
| 534 | 534 | |
| 535 | 535 | if (!key_exists('attributes', $item)) { |
| 536 | - $item['attributes'] = array(); |
|
| 536 | + $item['attributes'] = array (); |
|
| 537 | 537 | } |
| 538 | 538 | |
| 539 | 539 | if (!key_exists('values', $item)) { |
| 540 | - $item['values'] = array(); |
|
| 540 | + $item['values'] = array (); |
|
| 541 | 541 | } |
| 542 | 542 | |
| 543 | 543 | if ($groupItem->getMandatory() || $defaultValueCount < $fieldValueCount || $defaultValueCount == $fieldCount) { |
@@ -377,7 +377,7 @@ discard block |
||
| 377 | 377 | public function setObjectIdentifier($objectIdentifier) |
| 378 | 378 | { |
| 379 | 379 | // Due to uniqe key uc_object_identifier, which should ignore empty object identifiers. |
| 380 | - $this->objectIdentifier = empty($objectIdentifier)? null : $objectIdentifier; |
|
| 380 | + $this->objectIdentifier = empty($objectIdentifier) ? null : $objectIdentifier; |
|
| 381 | 381 | } |
| 382 | 382 | |
| 383 | 383 | /** |
@@ -712,7 +712,7 @@ discard block |
||
| 712 | 712 | */ |
| 713 | 713 | public function getCreator() |
| 714 | 714 | { |
| 715 | - return $this->creator? $this->creator : 0; |
|
| 715 | + return $this->creator ? $this->creator : 0; |
|
| 716 | 716 | } |
| 717 | 717 | |
| 718 | 718 | /** |
@@ -867,7 +867,7 @@ discard block |
||
| 867 | 867 | |
| 868 | 868 | foreach ($availableProperties as $propertyName) { |
| 869 | 869 | if (\TYPO3\CMS\Extbase\Reflection\ObjectAccess::isPropertySettable($newDocument, $propertyName) |
| 870 | - && !in_array($propertyName, array('uid','pid', 'file', 'comment', 'linkedUid', 'suggestion', 'creator'))) { |
|
| 870 | + && !in_array($propertyName, array ('uid', 'pid', 'file', 'comment', 'linkedUid', 'suggestion', 'creator'))) { |
|
| 871 | 871 | |
| 872 | 872 | $propertyValue = \TYPO3\CMS\Extbase\Reflection\ObjectAccess::getProperty($documentToCopy, $propertyName); |
| 873 | 873 | \TYPO3\CMS\Extbase\Reflection\ObjectAccess::setProperty($newDocument, $propertyName, $propertyValue); |
@@ -889,7 +889,7 @@ discard block |
||
| 889 | 889 | */ |
| 890 | 890 | public function getDocumentIdentifier() |
| 891 | 891 | { |
| 892 | - return $this->getObjectIdentifier()? $this->getObjectIdentifier() : $this->getUid(); |
|
| 892 | + return $this->getObjectIdentifier() ? $this->getObjectIdentifier() : $this->getUid(); |
|
| 893 | 893 | } |
| 894 | 894 | |
| 895 | 895 | /** |
@@ -922,8 +922,8 @@ discard block |
||
| 922 | 922 | public function getPublicationYear() |
| 923 | 923 | { |
| 924 | 924 | $internalFormat = new InternalFormat($this->getXmlData(), $this->getPid()); |
| 925 | - $year = $internalFormat->getPublishingYear(); |
|
| 926 | - return $year? $year : ""; |
|
| 925 | + $year = $internalFormat->getPublishingYear(); |
|
| 926 | + return $year ? $year : ""; |
|
| 927 | 927 | } |
| 928 | 928 | |
| 929 | 929 | /** |