We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -73,7 +73,8 @@ |
||
| 73 | 73 | /** |
| 74 | 74 | * @param string $endpoint the shortname of the endpoint |
| 75 | 75 | */ |
| 76 | - public function setEndpoint($endpoint) { |
|
| 76 | + public function setEndpoint($endpoint) |
|
| 77 | + { |
|
| 77 | 78 | $this->endpoint = $endpoint; |
| 78 | 79 | } |
| 79 | 80 | |
@@ -187,7 +187,7 @@ |
||
| 187 | 187 | |
| 188 | 188 | $identifier = $holders[$i]->xpath('./mods:nameIdentifier'); |
| 189 | 189 | if ($identifier[0]['type'] == 'viaf') { |
| 190 | - $this->getHoldersFromViafApi($identifier,$holders, $i); |
|
| 190 | + $this->getHoldersFromViafApi($identifier, $holders, $i); |
|
| 191 | 191 | } else { |
| 192 | 192 | $this->getHoldersFromXml($holders, $i); |
| 193 | 193 | } |
@@ -76,7 +76,8 @@ discard block |
||
| 76 | 76 | * |
| 77 | 77 | * @return void |
| 78 | 78 | */ |
| 79 | - private function getAuthors() { |
|
| 79 | + private function getAuthors() |
|
| 80 | + { |
|
| 80 | 81 | $authors = $this->xml->xpath('./mods:name[./mods:role/mods:roleTerm[@type="code" and @authority="marcrelator"]="aut"]'); |
| 81 | 82 | |
| 82 | 83 | // Get "author" and "author_sorting" again if that was too sophisticated. |
@@ -99,7 +100,8 @@ discard block |
||
| 99 | 100 | } |
| 100 | 101 | } |
| 101 | 102 | |
| 102 | - private function getAuthorsFromOrcidApi($identifier, $authors, $i) { |
|
| 103 | + private function getAuthorsFromOrcidApi($identifier, $authors, $i) |
|
| 104 | + { |
|
| 103 | 105 | $orcidUrl = (string) $identifier[0]; |
| 104 | 106 | $orcidIdParts = explode('/', $orcidUrl); |
| 105 | 107 | $orcidId = trim(end($orcidIdParts)); |
@@ -121,7 +123,8 @@ discard block |
||
| 121 | 123 | } |
| 122 | 124 | } |
| 123 | 125 | |
| 124 | - private function getAuthorsFromXml($authors, $i) { |
|
| 126 | + private function getAuthorsFromXml($authors, $i) |
|
| 127 | + { |
|
| 125 | 128 | $this->getAuthorFromXmlDisplayForm($authors, $i); |
| 126 | 129 | |
| 127 | 130 | $nameParts = $authors[$i]->xpath('./mods:namePart'); |
@@ -164,7 +167,8 @@ discard block |
||
| 164 | 167 | } |
| 165 | 168 | } |
| 166 | 169 | |
| 167 | - private function getAuthorFromXmlDisplayForm($authors, $i) { |
|
| 170 | + private function getAuthorFromXmlDisplayForm($authors, $i) |
|
| 171 | + { |
|
| 168 | 172 | $displayForm = $authors[$i]->xpath('./mods:displayForm'); |
| 169 | 173 | if ($displayForm) { |
| 170 | 174 | $this->metadata['author'][$i] = (string) $displayForm[0]; |
@@ -178,7 +182,8 @@ discard block |
||
| 178 | 182 | * |
| 179 | 183 | * @return void |
| 180 | 184 | */ |
| 181 | - private function getHolders() { |
|
| 185 | + private function getHolders() |
|
| 186 | + { |
|
| 182 | 187 | $holders = $this->xml->xpath('./mods:name[./mods:role/mods:roleTerm[@type="code" and @authority="marcrelator"]="prv"]'); |
| 183 | 188 | |
| 184 | 189 | if (!empty($holders)) { |
@@ -195,7 +200,8 @@ discard block |
||
| 195 | 200 | } |
| 196 | 201 | } |
| 197 | 202 | |
| 198 | - private function getHoldersFromViafApi($identifier, $holders, $i) { |
|
| 203 | + private function getHoldersFromViafApi($identifier, $holders, $i) |
|
| 204 | + { |
|
| 199 | 205 | $viafUrl = (string) $identifier[0]; |
| 200 | 206 | $profile = new ViafProfile($viafUrl); |
| 201 | 207 | $name = $profile->getFullName(); |
@@ -213,7 +219,8 @@ discard block |
||
| 213 | 219 | } |
| 214 | 220 | } |
| 215 | 221 | |
| 216 | - private function getHoldersFromXml($holders, $i) { |
|
| 222 | + private function getHoldersFromXml($holders, $i) |
|
| 223 | + { |
|
| 217 | 224 | // Check if there is a display form. |
| 218 | 225 | $displayForm = $holders[$i]->xpath('./mods:displayForm'); |
| 219 | 226 | if ($displayForm) { |
@@ -232,7 +239,8 @@ discard block |
||
| 232 | 239 | * |
| 233 | 240 | * @return void |
| 234 | 241 | */ |
| 235 | - private function getPlaces() { |
|
| 242 | + private function getPlaces() |
|
| 243 | + { |
|
| 236 | 244 | $places = $this->xml->xpath('./mods:originInfo[not(./mods:edition="[Electronic ed.]")]/mods:place/mods:placeTerm'); |
| 237 | 245 | // Get "place" and "place_sorting" again if that was to sophisticated. |
| 238 | 246 | if (empty($places)) { |
@@ -256,7 +264,8 @@ discard block |
||
| 256 | 264 | * |
| 257 | 265 | * @return void |
| 258 | 266 | */ |
| 259 | - private function getYears() { |
|
| 267 | + private function getYears() |
|
| 268 | + { |
|
| 260 | 269 | // Get "year_sorting". |
| 261 | 270 | if (($years_sorting = $this->xml->xpath('./mods:originInfo[not(./mods:edition="[Electronic ed.]")]/mods:dateOther[@type="order" and @encoding="w3cdtf"]'))) { |
| 262 | 271 | foreach ($years_sorting as $year_sorting) { |
@@ -294,7 +303,8 @@ discard block |
||
| 294 | 303 | * |
| 295 | 304 | * @return void |
| 296 | 305 | */ |
| 297 | - private function getDescription() { |
|
| 306 | + private function getDescription() |
|
| 307 | + { |
|
| 298 | 308 | $this->getSingleMetadata('description', './mods:recordInfo/mods:recordInfoNote/text()'); |
| 299 | 309 | } |
| 300 | 310 | |
@@ -305,7 +315,8 @@ discard block |
||
| 305 | 315 | * |
| 306 | 316 | * @return void |
| 307 | 317 | */ |
| 308 | - private function getIdentifier() { |
|
| 318 | + private function getIdentifier() |
|
| 319 | + { |
|
| 309 | 320 | $this->getSingleMetadata('identifier', './mods:identifier/text()'); |
| 310 | 321 | } |
| 311 | 322 | |
@@ -316,7 +327,8 @@ discard block |
||
| 316 | 327 | * |
| 317 | 328 | * @return void |
| 318 | 329 | */ |
| 319 | - private function getLicense() { |
|
| 330 | + private function getLicense() |
|
| 331 | + { |
|
| 320 | 332 | $this->getSingleMetadata('license', './mods:accessCondition/text()'); |
| 321 | 333 | } |
| 322 | 334 | |
@@ -329,7 +341,8 @@ discard block |
||
| 329 | 341 | * |
| 330 | 342 | * @return void |
| 331 | 343 | */ |
| 332 | - private function getObjectNames() { |
|
| 344 | + private function getObjectNames() |
|
| 345 | + { |
|
| 333 | 346 | $this->getSingleMetadata('object_name', './mods:relatedItem/mods:titleInfo[not(@displayLabel="alternative")]/mods:title/text()'); |
| 334 | 347 | $this->getSingleMetadata('object_alternative_names', './mods:relatedItem/mods:titleInfo[@displayLabel="alternative"]/mods:title/text()'); |
| 335 | 348 | } |
@@ -345,7 +358,8 @@ discard block |
||
| 345 | 358 | * |
| 346 | 359 | * @return void |
| 347 | 360 | */ |
| 348 | - private function getObjectLocationMetadata() { |
|
| 361 | + private function getObjectLocationMetadata() |
|
| 362 | + { |
|
| 349 | 363 | $this->getSingleMetadata('object_location', './mods:relatedItem/mods:location/mods:physicalLocation/text()'); |
| 350 | 364 | $this->getSingleMetadata('geonames', './mods:relatedItem/mods:location/mods:url[@displayLabel="geonames"]/text()'); |
| 351 | 365 | $this->getSingleMetadata('wikidata', './mods:relatedItem/mods:location/mods:url[@displayLabel="wikidata"]/text()'); |
@@ -362,7 +376,8 @@ discard block |
||
| 362 | 376 | * |
| 363 | 377 | * @return void |
| 364 | 378 | */ |
| 365 | - private function getSingleMetadata($metadataIndex, $xpath) { |
|
| 379 | + private function getSingleMetadata($metadataIndex, $xpath) |
|
| 380 | + { |
|
| 366 | 381 | $results = $this->xml->xpath($xpath); |
| 367 | 382 | if (!empty($results)) { |
| 368 | 383 | foreach ($results as $result) { |