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 | |
@@ -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 getAuthorFromOrcidApi($identifier, $authors, $i) { |
|
| 103 | + private function getAuthorFromOrcidApi($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 getAuthorFromXml($authors, $i) { |
|
| 126 | + private function getAuthorFromXml($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 getHolderFromViafApi($identifier, $holders, $i) { |
|
| 203 | + private function getHolderFromViafApi($identifier, $holders, $i) |
|
| 204 | + { |
|
| 199 | 205 | $viafUrl = (string) $identifier[0]; |
| 200 | 206 | $profile = new ViafProfile($viafUrl); |
| 201 | 207 | $name = $profile->getFullName(); |
@@ -210,7 +216,8 @@ discard block |
||
| 210 | 216 | } |
| 211 | 217 | } |
| 212 | 218 | |
| 213 | - private function getHolderFromXml($holders, $i) { |
|
| 219 | + private function getHolderFromXml($holders, $i) |
|
| 220 | + { |
|
| 214 | 221 | $this->getHolderFromXmlDisplayForm($holders, $i); |
| 215 | 222 | // Append "valueURI" to name using Unicode unit separator. |
| 216 | 223 | if (isset($holders[$i]['valueURI'])) { |
@@ -218,7 +225,8 @@ discard block |
||
| 218 | 225 | } |
| 219 | 226 | } |
| 220 | 227 | |
| 221 | - private function getHolderFromXmlDisplayForm($holders, $i) { |
|
| 228 | + private function getHolderFromXmlDisplayForm($holders, $i) |
|
| 229 | + { |
|
| 222 | 230 | // Check if there is a display form. |
| 223 | 231 | $displayForm = $holders[$i]->xpath('./mods:displayForm'); |
| 224 | 232 | if ($displayForm) { |
@@ -233,7 +241,8 @@ discard block |
||
| 233 | 241 | * |
| 234 | 242 | * @return void |
| 235 | 243 | */ |
| 236 | - private function getPlaces() { |
|
| 244 | + private function getPlaces() |
|
| 245 | + { |
|
| 237 | 246 | $places = $this->xml->xpath('./mods:originInfo[not(./mods:edition="[Electronic ed.]")]/mods:place/mods:placeTerm'); |
| 238 | 247 | // Get "place" and "place_sorting" again if that was to sophisticated. |
| 239 | 248 | if (empty($places)) { |
@@ -257,7 +266,8 @@ discard block |
||
| 257 | 266 | * |
| 258 | 267 | * @return void |
| 259 | 268 | */ |
| 260 | - private function getYears() { |
|
| 269 | + private function getYears() |
|
| 270 | + { |
|
| 261 | 271 | // Get "year_sorting". |
| 262 | 272 | if (($years_sorting = $this->xml->xpath('./mods:originInfo[not(./mods:edition="[Electronic ed.]")]/mods:dateOther[@type="order" and @encoding="w3cdtf"]'))) { |
| 263 | 273 | foreach ($years_sorting as $year_sorting) { |
@@ -295,7 +305,8 @@ discard block |
||
| 295 | 305 | * |
| 296 | 306 | * @return void |
| 297 | 307 | */ |
| 298 | - private function getDescription() { |
|
| 308 | + private function getDescription() |
|
| 309 | + { |
|
| 299 | 310 | $this->getSingleMetadata('description', './mods:recordInfo/mods:recordInfoNote/text()'); |
| 300 | 311 | } |
| 301 | 312 | |
@@ -306,7 +317,8 @@ discard block |
||
| 306 | 317 | * |
| 307 | 318 | * @return void |
| 308 | 319 | */ |
| 309 | - private function getIdentifier() { |
|
| 320 | + private function getIdentifier() |
|
| 321 | + { |
|
| 310 | 322 | $this->getSingleMetadata('identifier', './mods:identifier/text()'); |
| 311 | 323 | } |
| 312 | 324 | |
@@ -317,7 +329,8 @@ discard block |
||
| 317 | 329 | * |
| 318 | 330 | * @return void |
| 319 | 331 | */ |
| 320 | - private function getLicense() { |
|
| 332 | + private function getLicense() |
|
| 333 | + { |
|
| 321 | 334 | $this->getSingleMetadata('license', './mods:accessCondition/text()'); |
| 322 | 335 | } |
| 323 | 336 | |
@@ -330,7 +343,8 @@ discard block |
||
| 330 | 343 | * |
| 331 | 344 | * @return void |
| 332 | 345 | */ |
| 333 | - private function getObjectNames() { |
|
| 346 | + private function getObjectNames() |
|
| 347 | + { |
|
| 334 | 348 | $this->getSingleMetadata('object_name', './mods:relatedItem/mods:titleInfo[not(@displayLabel="alternative")]/mods:title/text()'); |
| 335 | 349 | $this->getSingleMetadata('object_alternative_names', './mods:relatedItem/mods:titleInfo[@displayLabel="alternative"]/mods:title/text()'); |
| 336 | 350 | } |
@@ -346,7 +360,8 @@ discard block |
||
| 346 | 360 | * |
| 347 | 361 | * @return void |
| 348 | 362 | */ |
| 349 | - private function getObjectLocationMetadata() { |
|
| 363 | + private function getObjectLocationMetadata() |
|
| 364 | + { |
|
| 350 | 365 | $this->getSingleMetadata('object_location', './mods:relatedItem/mods:location/mods:physicalLocation/text()'); |
| 351 | 366 | $this->getSingleMetadata('geonames', './mods:relatedItem/mods:location/mods:url[@displayLabel="geonames"]/text()'); |
| 352 | 367 | $this->getSingleMetadata('wikidata', './mods:relatedItem/mods:location/mods:url[@displayLabel="wikidata"]/text()'); |
@@ -363,7 +378,8 @@ discard block |
||
| 363 | 378 | * |
| 364 | 379 | * @return void |
| 365 | 380 | */ |
| 366 | - private function getSingleMetadata($metadataIndex, $xpath) { |
|
| 381 | + private function getSingleMetadata($metadataIndex, $xpath) |
|
| 382 | + { |
|
| 367 | 383 | $results = $this->xml->xpath($xpath); |
| 368 | 384 | if (!empty($results)) { |
| 369 | 385 | foreach ($results as $result) { |