@@ -25,8 +25,7 @@ discard block |
||
| 25 | 25 | * @subpackage dlf |
| 26 | 26 | * @access public |
| 27 | 27 | **/ |
| 28 | -class Profile |
|
| 29 | -{ |
|
| 28 | +class Profile { |
|
| 30 | 29 | /** |
| 31 | 30 | * This holds the logger |
| 32 | 31 | * |
@@ -57,8 +56,7 @@ discard block |
||
| 57 | 56 | * |
| 58 | 57 | * @return void |
| 59 | 58 | **/ |
| 60 | - public function __construct($viaf) |
|
| 61 | - { |
|
| 59 | + public function __construct($viaf) { |
|
| 62 | 60 | $this->logger = GeneralUtility::makeInstance(LogManager::class)->getLogger(static::class); |
| 63 | 61 | $this->client = new Client($viaf, GeneralUtility::makeInstance(RequestFactory::class)); |
| 64 | 62 | } |
@@ -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(); |
| 74 | 71 | if (!empty($this->raw)) { |
| 75 | 72 | $data = []; |
@@ -87,8 +84,7 @@ discard block |
||
| 87 | 84 | * |
| 88 | 85 | * @return string|false |
| 89 | 86 | **/ |
| 90 | - public function getAddress() |
|
| 91 | - { |
|
| 87 | + public function getAddress() { |
|
| 92 | 88 | $this->getRaw(); |
| 93 | 89 | if (!empty($this->raw->asXML())) { |
| 94 | 90 | return (string) $this->raw->xpath('./ns1:nationalityOfEntity/ns1:data/ns1:text')[0]; |
@@ -103,8 +99,7 @@ discard block |
||
| 103 | 99 | * |
| 104 | 100 | * @return string|false |
| 105 | 101 | **/ |
| 106 | - public function getFullName() |
|
| 107 | - { |
|
| 102 | + public function getFullName() { |
|
| 108 | 103 | $this->getRaw(); |
| 109 | 104 | if (!empty($this->raw->asXML())) { |
| 110 | 105 | $rawName = $this->raw->xpath('./ns1:mainHeadings/ns1:data/ns1:text'); |
@@ -122,8 +117,7 @@ discard block |
||
| 122 | 117 | * |
| 123 | 118 | * @return void |
| 124 | 119 | **/ |
| 125 | - protected function getRaw() |
|
| 126 | - { |
|
| 120 | + protected function getRaw() { |
|
| 127 | 121 | $data = $this->client->getData(); |
| 128 | 122 | if (!isset($this->raw) && $data != false) { |
| 129 | 123 | $this->raw = Helper::getXmlFileAsString($data); |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | * |
| 49 | 49 | * @var \SimpleXmlElement|false |
| 50 | 50 | **/ |
| 51 | - private $raw = null; |
|
| 51 | + private $raw = NULL; |
|
| 52 | 52 | |
| 53 | 53 | /** |
| 54 | 54 | * Constructs client instance |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | return $data; |
| 79 | 79 | } else { |
| 80 | 80 | $this->logger->warning('No data found for given VIAF URL'); |
| 81 | - return false; |
|
| 81 | + return FALSE; |
|
| 82 | 82 | } |
| 83 | 83 | } |
| 84 | 84 | |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | return (string) $this->raw->xpath('./ns1:nationalityOfEntity/ns1:data/ns1:text')[0]; |
| 95 | 95 | } else { |
| 96 | 96 | $this->logger->warning('No address found for given VIAF URL'); |
| 97 | - return false; |
|
| 97 | + return FALSE; |
|
| 98 | 98 | } |
| 99 | 99 | } |
| 100 | 100 | |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | return $name; |
| 114 | 114 | } else { |
| 115 | 115 | $this->logger->warning('No name found for given VIAF URL'); |
| 116 | - return false; |
|
| 116 | + return FALSE; |
|
| 117 | 117 | } |
| 118 | 118 | } |
| 119 | 119 | |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | protected function getRaw() |
| 126 | 126 | { |
| 127 | 127 | $data = $this->client->getData(); |
| 128 | - if (!isset($this->raw) && $data != false) { |
|
| 128 | + if (!isset($this->raw) && $data != FALSE) { |
|
| 129 | 129 | $this->raw = Helper::getXmlFileAsString($data); |
| 130 | 130 | $this->raw->registerXPathNamespace('ns1', 'http://viaf.org/viaf/terms#'); |
| 131 | 131 | } |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | array_unshift($metadata, $data); |
| 113 | 113 | } |
| 114 | 114 | if (empty($metadata)) { |
| 115 | - $this->logger->warning('No metadata found for document with UID ' . $this->document->getUid()); |
|
| 115 | + $this->logger->warning('No metadata found for document with UID '.$this->document->getUid()); |
|
| 116 | 116 | return ''; |
| 117 | 117 | } |
| 118 | 118 | ksort($metadata); |
@@ -215,7 +215,7 @@ discard block |
||
| 215 | 215 | if (empty(implode('', $value)) && $this->settings['getTitle'] && $this->document->getPartof()) { |
| 216 | 216 | $superiorTitle = Doc::getTitle($this->document->getPartof(), true); |
| 217 | 217 | if (!empty($superiorTitle)) { |
| 218 | - $metadata[$i][$name] = ['[' . $superiorTitle . ']']; |
|
| 218 | + $metadata[$i][$name] = ['['.$superiorTitle.']']; |
|
| 219 | 219 | } |
| 220 | 220 | } |
| 221 | 221 | if (!empty($value)) { |
@@ -29,8 +29,7 @@ discard block |
||
| 29 | 29 | * @subpackage dlf |
| 30 | 30 | * @access public |
| 31 | 31 | */ |
| 32 | -class MetadataController extends AbstractController |
|
| 33 | -{ |
|
| 32 | +class MetadataController extends AbstractController { |
|
| 34 | 33 | /** |
| 35 | 34 | * @var CollectionRepository |
| 36 | 35 | */ |
@@ -39,8 +38,7 @@ discard block |
||
| 39 | 38 | /** |
| 40 | 39 | * @param CollectionRepository $collectionRepository |
| 41 | 40 | */ |
| 42 | - public function injectCollectionRepository(CollectionRepository $collectionRepository) |
|
| 43 | - { |
|
| 41 | + public function injectCollectionRepository(CollectionRepository $collectionRepository) { |
|
| 44 | 42 | $this->collectionRepository = $collectionRepository; |
| 45 | 43 | } |
| 46 | 44 | |
@@ -52,8 +50,7 @@ discard block |
||
| 52 | 50 | /** |
| 53 | 51 | * @param MetadataRepository $metadataRepository |
| 54 | 52 | */ |
| 55 | - public function injectMetadataRepository(MetadataRepository $metadataRepository) |
|
| 56 | - { |
|
| 53 | + public function injectMetadataRepository(MetadataRepository $metadataRepository) { |
|
| 57 | 54 | $this->metadataRepository = $metadataRepository; |
| 58 | 55 | } |
| 59 | 56 | |
@@ -65,16 +62,14 @@ discard block |
||
| 65 | 62 | /** |
| 66 | 63 | * @param StructureRepository $structureRepository |
| 67 | 64 | */ |
| 68 | - public function injectStructureRepository(StructureRepository $structureRepository) |
|
| 69 | - { |
|
| 65 | + public function injectStructureRepository(StructureRepository $structureRepository) { |
|
| 70 | 66 | $this->structureRepository = $structureRepository; |
| 71 | 67 | } |
| 72 | 68 | |
| 73 | 69 | /** |
| 74 | 70 | * @return string|void |
| 75 | 71 | */ |
| 76 | - public function mainAction() |
|
| 77 | - { |
|
| 72 | + public function mainAction() { |
|
| 78 | 73 | $this->cObj = $this->configurationManager->getContentObject(); |
| 79 | 74 | |
| 80 | 75 | // Load current document. |
@@ -130,8 +125,7 @@ discard block |
||
| 130 | 125 | * |
| 131 | 126 | * @return string The metadata array ready for output |
| 132 | 127 | */ |
| 133 | - protected function printMetadata(array $metadata, $useOriginalIiifManifestMetadata = false) |
|
| 134 | - { |
|
| 128 | + protected function printMetadata(array $metadata, $useOriginalIiifManifestMetadata = false) { |
|
| 135 | 129 | if ($useOriginalIiifManifestMetadata) { |
| 136 | 130 | $iiifData = []; |
| 137 | 131 | foreach ($metadata as $row) { |
@@ -269,8 +263,7 @@ discard block |
||
| 269 | 263 | } |
| 270 | 264 | |
| 271 | 265 | if (is_array($metadata[$i][$name])) { |
| 272 | - $metadata[$i][$name] = array_values(array_filter($metadata[$i][$name], function($metadataValue) |
|
| 273 | - { |
|
| 266 | + $metadata[$i][$name] = array_values(array_filter($metadata[$i][$name], function($metadataValue) { |
|
| 274 | 267 | return !empty($metadataValue); |
| 275 | 268 | })); |
| 276 | 269 | } |
@@ -294,8 +287,7 @@ discard block |
||
| 294 | 287 | * |
| 295 | 288 | * @return array metadata |
| 296 | 289 | */ |
| 297 | - private function getMetadata() |
|
| 298 | - { |
|
| 290 | + private function getMetadata() { |
|
| 299 | 291 | $metadata = []; |
| 300 | 292 | if ($this->settings['rootline'] < 2) { |
| 301 | 293 | // Get current structure's @ID. |
@@ -333,8 +325,7 @@ discard block |
||
| 333 | 325 | * |
| 334 | 326 | * @return array metadata |
| 335 | 327 | */ |
| 336 | - private function getMetadataForIds($id, $metadata) |
|
| 337 | - { |
|
| 328 | + private function getMetadataForIds($id, $metadata) { |
|
| 338 | 329 | $useOriginalIiifManifestMetadata = $this->settings['originalIiifMetadata'] == 1 && $this->document->getDoc() instanceof IiifManifest; |
| 339 | 330 | foreach ($id as $sid) { |
| 340 | 331 | if ($useOriginalIiifManifestMetadata) { |
@@ -80,8 +80,8 @@ discard block |
||
| 80 | 80 | // Load current document. |
| 81 | 81 | $this->loadDocument($this->requestData); |
| 82 | 82 | if ( |
| 83 | - $this->document === null |
|
| 84 | - || $this->document->getDoc() === null |
|
| 83 | + $this->document === NULL |
|
| 84 | + || $this->document->getDoc() === NULL |
|
| 85 | 85 | ) { |
| 86 | 86 | // Quit without doing anything if required variables are not set. |
| 87 | 87 | return ''; |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | * |
| 131 | 131 | * @return string The metadata array ready for output |
| 132 | 132 | */ |
| 133 | - protected function printMetadata(array $metadata, $useOriginalIiifManifestMetadata = false) |
|
| 133 | + protected function printMetadata(array $metadata, $useOriginalIiifManifestMetadata = FALSE) |
|
| 134 | 134 | { |
| 135 | 135 | if ($useOriginalIiifManifestMetadata) { |
| 136 | 136 | $iiifData = []; |
@@ -148,14 +148,14 @@ discard block |
||
| 148 | 148 | $iiifData[$key] = [ |
| 149 | 149 | 'label' => $key, |
| 150 | 150 | 'value' => $group, |
| 151 | - 'buildUrl' => true, |
|
| 151 | + 'buildUrl' => TRUE, |
|
| 152 | 152 | ]; |
| 153 | 153 | } else { |
| 154 | 154 | // Data output |
| 155 | 155 | $iiifData[$key] = [ |
| 156 | 156 | 'label' => $key, |
| 157 | 157 | 'value' => $group, |
| 158 | - 'buildUrl' => false, |
|
| 158 | + 'buildUrl' => FALSE, |
|
| 159 | 159 | ]; |
| 160 | 160 | } |
| 161 | 161 | } else { |
@@ -172,18 +172,18 @@ discard block |
||
| 172 | 172 | $iiifData[$key]['data'][] = [ |
| 173 | 173 | 'label' => $nolabel ? '' : $label, |
| 174 | 174 | 'value' => $value, |
| 175 | - 'buildUrl' => true, |
|
| 175 | + 'buildUrl' => TRUE, |
|
| 176 | 176 | ]; |
| 177 | 177 | } else { |
| 178 | 178 | $iiifData[$key]['data'][] = [ |
| 179 | 179 | 'label' => $label, |
| 180 | 180 | 'value' => $value, |
| 181 | - 'buildUrl' => false, |
|
| 181 | + 'buildUrl' => FALSE, |
|
| 182 | 182 | ]; |
| 183 | 183 | } |
| 184 | 184 | } |
| 185 | 185 | } |
| 186 | - $this->view->assign('useIiif', true); |
|
| 186 | + $this->view->assign('useIiif', TRUE); |
|
| 187 | 187 | $this->view->assign('iiifData', $iiifData); |
| 188 | 188 | } |
| 189 | 189 | } |
@@ -213,7 +213,7 @@ discard block |
||
| 213 | 213 | if ($name == 'title') { |
| 214 | 214 | // Get title of parent document if needed. |
| 215 | 215 | if (empty(implode('', $value)) && $this->settings['getTitle'] && $this->document->getPartof()) { |
| 216 | - $superiorTitle = Doc::getTitle($this->document->getPartof(), true); |
|
| 216 | + $superiorTitle = Doc::getTitle($this->document->getPartof(), TRUE); |
|
| 217 | 217 | if (!empty($superiorTitle)) { |
| 218 | 218 | $metadata[$i][$name] = ['[' . $superiorTitle . ']']; |
| 219 | 219 | } |