@@ -20,8 +20,7 @@ discard block |
||
| 20 | 20 | * @subpackage dlf |
| 21 | 21 | * @access public |
| 22 | 22 | */ |
| 23 | -class Alto implements \Kitodo\Dlf\Common\FulltextInterface |
|
| 24 | -{ |
|
| 23 | +class Alto implements \Kitodo\Dlf\Common\FulltextInterface { |
|
| 25 | 24 | /** |
| 26 | 25 | * This extracts the fulltext data from ALTO XML |
| 27 | 26 | * |
@@ -31,8 +30,7 @@ discard block |
||
| 31 | 30 | * |
| 32 | 31 | * @return string The raw unformatted fulltext |
| 33 | 32 | */ |
| 34 | - public function getRawText(\SimpleXMLElement $xml) |
|
| 35 | - { |
|
| 33 | + public function getRawText(\SimpleXMLElement $xml) { |
|
| 36 | 34 | $rawText = ''; |
| 37 | 35 | $xml->registerXPathNamespace('alto', 'http://www.loc.gov/standards/alto/ns-v2#'); |
| 38 | 36 | // Get all (presumed) words of the text. |
@@ -20,8 +20,7 @@ discard block |
||
| 20 | 20 | * @subpackage dlf |
| 21 | 21 | * @access public |
| 22 | 22 | */ |
| 23 | -class TeiHeader implements \Kitodo\Dlf\Common\MetadataInterface |
|
| 24 | -{ |
|
| 23 | +class TeiHeader implements \Kitodo\Dlf\Common\MetadataInterface { |
|
| 25 | 24 | /** |
| 26 | 25 | * This extracts the essential TEIHDR metadata from XML |
| 27 | 26 | * |
@@ -32,8 +31,7 @@ discard block |
||
| 32 | 31 | * |
| 33 | 32 | * @return void |
| 34 | 33 | */ |
| 35 | - public function extractMetadata(\SimpleXMLElement $xml, array &$metadata) |
|
| 36 | - { |
|
| 34 | + public function extractMetadata(\SimpleXMLElement $xml, array &$metadata) { |
|
| 37 | 35 | $xml->registerXPathNamespace('teihdr', 'http://www.tei-c.org/ns/1.0'); |
| 38 | 36 | } |
| 39 | 37 | } |
@@ -20,8 +20,7 @@ discard block |
||
| 20 | 20 | * @subpackage dlf |
| 21 | 21 | * @access public |
| 22 | 22 | */ |
| 23 | -class Mods implements \Kitodo\Dlf\Common\MetadataInterface |
|
| 24 | -{ |
|
| 23 | +class Mods implements \Kitodo\Dlf\Common\MetadataInterface { |
|
| 25 | 24 | /** |
| 26 | 25 | * This extracts the essential MODS metadata from XML |
| 27 | 26 | * |
@@ -32,8 +31,7 @@ discard block |
||
| 32 | 31 | * |
| 33 | 32 | * @return void |
| 34 | 33 | */ |
| 35 | - public function extractMetadata(\SimpleXMLElement $xml, array &$metadata) |
|
| 36 | - { |
|
| 34 | + public function extractMetadata(\SimpleXMLElement $xml, array &$metadata) { |
|
| 37 | 35 | $xml->registerXPathNamespace('mods', 'http://www.loc.gov/mods/v3'); |
| 38 | 36 | // Get "author" and "author_sorting". |
| 39 | 37 | $authors = $xml->xpath('./mods:name[./mods:role/mods:roleTerm[@type="code" and @authority="marcrelator"]="aut"]'); |
@@ -21,8 +21,7 @@ |
||
| 21 | 21 | * @access public |
| 22 | 22 | * @abstract |
| 23 | 23 | */ |
| 24 | -interface FulltextInterface |
|
| 25 | -{ |
|
| 24 | +interface FulltextInterface { |
|
| 26 | 25 | /** |
| 27 | 26 | * This extracts raw fulltext data from XML |
| 28 | 27 | * |
@@ -21,8 +21,7 @@ |
||
| 21 | 21 | * @access public |
| 22 | 22 | * @abstract |
| 23 | 23 | */ |
| 24 | -interface MetadataInterface |
|
| 25 | -{ |
|
| 24 | +interface MetadataInterface { |
|
| 26 | 25 | /** |
| 27 | 26 | * This extracts metadata from XML |
| 28 | 27 | * |
@@ -25,8 +25,7 @@ discard block |
||
| 25 | 25 | * @subpackage dlf |
| 26 | 26 | * @access public |
| 27 | 27 | */ |
| 28 | -class IiifUrlReader implements UrlReaderInterface |
|
| 29 | -{ |
|
| 28 | +class IiifUrlReader implements UrlReaderInterface { |
|
| 30 | 29 | /** |
| 31 | 30 | * Singleton instance of the class |
| 32 | 31 | * |
@@ -40,8 +39,7 @@ discard block |
||
| 40 | 39 | * {@inheritDoc} |
| 41 | 40 | * @see \Ubl\Iiif\Tools\UrlReaderInterface::getContent() |
| 42 | 41 | */ |
| 43 | - public function getContent($url) |
|
| 44 | - { |
|
| 42 | + public function getContent($url) { |
|
| 45 | 43 | $fileContents = GeneralUtility::getUrl($url); |
| 46 | 44 | if ($fileContents !== false) { |
| 47 | 45 | return $fileContents; |
@@ -57,8 +55,7 @@ discard block |
||
| 57 | 55 | * |
| 58 | 56 | * @return IiifUrlReader |
| 59 | 57 | */ |
| 60 | - public static function getInstance() |
|
| 61 | - { |
|
| 58 | + public static function getInstance() { |
|
| 62 | 59 | if (!isset(self::$instance)) { |
| 63 | 60 | self::$instance = new IiifUrlReader(); |
| 64 | 61 | } |
@@ -97,8 +97,7 @@ discard block |
||
| 97 | 97 | * |
| 98 | 98 | * @return void |
| 99 | 99 | */ |
| 100 | - public function add(array $elements, $position = -1) |
|
| 101 | - { |
|
| 100 | + public function add(array $elements, $position = -1) { |
|
| 102 | 101 | $position = MathUtility::forceIntegerInRange($position, 0, $this->count, $this->count); |
| 103 | 102 | if (!empty($elements)) { |
| 104 | 103 | array_splice($this->elements, $position, 0, $elements); |
@@ -114,8 +113,7 @@ discard block |
||
| 114 | 113 | * |
| 115 | 114 | * @return int The number of elements in the list |
| 116 | 115 | */ |
| 117 | - public function count() |
|
| 118 | - { |
|
| 116 | + public function count() { |
|
| 119 | 117 | return $this->count; |
| 120 | 118 | } |
| 121 | 119 | |
@@ -127,8 +125,7 @@ discard block |
||
| 127 | 125 | * |
| 128 | 126 | * @return array The current element |
| 129 | 127 | */ |
| 130 | - public function current() |
|
| 131 | - { |
|
| 128 | + public function current() { |
|
| 132 | 129 | if ($this->valid()) { |
| 133 | 130 | return $this->getRecord($this->elements[$this->position]); |
| 134 | 131 | } else { |
@@ -146,8 +143,7 @@ discard block |
||
| 146 | 143 | * |
| 147 | 144 | * @return mixed The element's full record |
| 148 | 145 | */ |
| 149 | - protected function getRecord($element) |
|
| 150 | - { |
|
| 146 | + protected function getRecord($element) { |
|
| 151 | 147 | if ( |
| 152 | 148 | is_array($element) |
| 153 | 149 | && array_keys($element) == ['u', 'h', 's', 'p'] |
@@ -318,8 +314,7 @@ discard block |
||
| 318 | 314 | * |
| 319 | 315 | * @return int The current position |
| 320 | 316 | */ |
| 321 | - public function key() |
|
| 322 | - { |
|
| 317 | + public function key() { |
|
| 323 | 318 | return $this->position; |
| 324 | 319 | } |
| 325 | 320 | |
@@ -333,8 +328,7 @@ discard block |
||
| 333 | 328 | * |
| 334 | 329 | * @return void |
| 335 | 330 | */ |
| 336 | - public function move($position, $steps) |
|
| 337 | - { |
|
| 331 | + public function move($position, $steps) { |
|
| 338 | 332 | $position = intval($position); |
| 339 | 333 | // Check if list position is valid. |
| 340 | 334 | if ( |
@@ -365,8 +359,7 @@ discard block |
||
| 365 | 359 | * |
| 366 | 360 | * @return void |
| 367 | 361 | */ |
| 368 | - public function moveUp($position) |
|
| 369 | - { |
|
| 362 | + public function moveUp($position) { |
|
| 370 | 363 | $this->move($position, -1); |
| 371 | 364 | } |
| 372 | 365 | |
@@ -379,8 +372,7 @@ discard block |
||
| 379 | 372 | * |
| 380 | 373 | * @return void |
| 381 | 374 | */ |
| 382 | - public function moveDown($position) |
|
| 383 | - { |
|
| 375 | + public function moveDown($position) { |
|
| 384 | 376 | $this->move($position, 1); |
| 385 | 377 | } |
| 386 | 378 | |
@@ -392,8 +384,7 @@ discard block |
||
| 392 | 384 | * |
| 393 | 385 | * @return void |
| 394 | 386 | */ |
| 395 | - public function next() |
|
| 396 | - { |
|
| 387 | + public function next() { |
|
| 397 | 388 | $this->position++; |
| 398 | 389 | } |
| 399 | 390 | |
@@ -407,8 +398,7 @@ discard block |
||
| 407 | 398 | * |
| 408 | 399 | * @return bool Does the given offset exist? |
| 409 | 400 | */ |
| 410 | - public function offsetExists($offset) |
|
| 411 | - { |
|
| 401 | + public function offsetExists($offset) { |
|
| 412 | 402 | return isset($this->elements[$offset]); |
| 413 | 403 | } |
| 414 | 404 | |
@@ -422,8 +412,7 @@ discard block |
||
| 422 | 412 | * |
| 423 | 413 | * @return array The element at the given offset |
| 424 | 414 | */ |
| 425 | - public function offsetGet($offset) |
|
| 426 | - { |
|
| 415 | + public function offsetGet($offset) { |
|
| 427 | 416 | if ($this->offsetExists($offset)) { |
| 428 | 417 | return $this->getRecord($this->elements[$offset]); |
| 429 | 418 | } else { |
@@ -443,8 +432,7 @@ discard block |
||
| 443 | 432 | * |
| 444 | 433 | * @return void |
| 445 | 434 | */ |
| 446 | - public function offsetSet($offset, $value) |
|
| 447 | - { |
|
| 435 | + public function offsetSet($offset, $value) { |
|
| 448 | 436 | if (\TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($offset)) { |
| 449 | 437 | $this->elements[$offset] = $value; |
| 450 | 438 | } else { |
@@ -464,8 +452,7 @@ discard block |
||
| 464 | 452 | * |
| 465 | 453 | * @return array The removed element |
| 466 | 454 | */ |
| 467 | - public function remove($position) |
|
| 468 | - { |
|
| 455 | + public function remove($position) { |
|
| 469 | 456 | $position = intval($position); |
| 470 | 457 | if ( |
| 471 | 458 | $position < 0 |
@@ -489,8 +476,7 @@ discard block |
||
| 489 | 476 | * |
| 490 | 477 | * @return array The indizes of the removed elements |
| 491 | 478 | */ |
| 492 | - public function removeRange($position, $length) |
|
| 493 | - { |
|
| 479 | + public function removeRange($position, $length) { |
|
| 494 | 480 | $position = intval($position); |
| 495 | 481 | if ( |
| 496 | 482 | $position < 0 |
@@ -511,8 +497,7 @@ discard block |
||
| 511 | 497 | * |
| 512 | 498 | * @return void |
| 513 | 499 | */ |
| 514 | - public function reset() |
|
| 515 | - { |
|
| 500 | + public function reset() { |
|
| 516 | 501 | $this->elements = []; |
| 517 | 502 | $this->records = []; |
| 518 | 503 | $this->metadata = []; |
@@ -528,8 +513,7 @@ discard block |
||
| 528 | 513 | * |
| 529 | 514 | * @return void |
| 530 | 515 | */ |
| 531 | - public function rewind() |
|
| 532 | - { |
|
| 516 | + public function rewind() { |
|
| 533 | 517 | $this->position = 0; |
| 534 | 518 | } |
| 535 | 519 | |
@@ -542,8 +526,7 @@ discard block |
||
| 542 | 526 | * |
| 543 | 527 | * @return void |
| 544 | 528 | */ |
| 545 | - public function save($pid = 0) |
|
| 546 | - { |
|
| 529 | + public function save($pid = 0) { |
|
| 547 | 530 | $pid = max(intval($pid), 0); |
| 548 | 531 | // If no PID is given, save to the user's session instead |
| 549 | 532 | if ($pid > 0) { |
@@ -560,8 +543,7 @@ discard block |
||
| 560 | 543 | * |
| 561 | 544 | * @return bool true on success or false on failure |
| 562 | 545 | */ |
| 563 | - protected function solrConnect() |
|
| 564 | - { |
|
| 546 | + protected function solrConnect() { |
|
| 565 | 547 | // Get Solr instance. |
| 566 | 548 | if (!$this->solr) { |
| 567 | 549 | // Connect to Solr server. |
@@ -607,8 +589,7 @@ discard block |
||
| 607 | 589 | * |
| 608 | 590 | * @return void |
| 609 | 591 | */ |
| 610 | - public function sort($by, $asc = true) |
|
| 611 | - { |
|
| 592 | + public function sort($by, $asc = true) { |
|
| 612 | 593 | $newOrder = []; |
| 613 | 594 | $nonSortable = []; |
| 614 | 595 | foreach ($this->elements as $num => $element) { |
@@ -645,8 +626,7 @@ discard block |
||
| 645 | 626 | * |
| 646 | 627 | * @return void |
| 647 | 628 | */ |
| 648 | - public function offsetUnset($offset) |
|
| 649 | - { |
|
| 629 | + public function offsetUnset($offset) { |
|
| 650 | 630 | unset($this->elements[$offset]); |
| 651 | 631 | // Re-number the elements. |
| 652 | 632 | $this->elements = array_values($this->elements); |
@@ -661,8 +641,7 @@ discard block |
||
| 661 | 641 | * |
| 662 | 642 | * @return bool Is the current list position valid? |
| 663 | 643 | */ |
| 664 | - public function valid() |
|
| 665 | - { |
|
| 644 | + public function valid() { |
|
| 666 | 645 | return isset($this->elements[$this->position]); |
| 667 | 646 | } |
| 668 | 647 | |
@@ -673,8 +652,7 @@ discard block |
||
| 673 | 652 | * |
| 674 | 653 | * @return array The list's metadata |
| 675 | 654 | */ |
| 676 | - protected function _getMetadata() |
|
| 677 | - { |
|
| 655 | + protected function _getMetadata() { |
|
| 678 | 656 | return $this->metadata; |
| 679 | 657 | } |
| 680 | 658 | |
@@ -687,8 +665,7 @@ discard block |
||
| 687 | 665 | * |
| 688 | 666 | * @return void |
| 689 | 667 | */ |
| 690 | - protected function _setMetadata(array $metadata = []) |
|
| 691 | - { |
|
| 668 | + protected function _setMetadata(array $metadata = []) { |
|
| 692 | 669 | $this->metadata = $metadata; |
| 693 | 670 | } |
| 694 | 671 | |
@@ -702,8 +679,7 @@ discard block |
||
| 702 | 679 | * |
| 703 | 680 | * @return void |
| 704 | 681 | */ |
| 705 | - public function __construct(array $elements = [], array $metadata = []) |
|
| 706 | - { |
|
| 682 | + public function __construct(array $elements = [], array $metadata = []) { |
|
| 707 | 683 | if ( |
| 708 | 684 | empty($elements) |
| 709 | 685 | && empty($metadata) |
@@ -735,8 +711,7 @@ discard block |
||
| 735 | 711 | * |
| 736 | 712 | * @return void |
| 737 | 713 | */ |
| 738 | - protected function __clone() |
|
| 739 | - { |
|
| 714 | + protected function __clone() { |
|
| 740 | 715 | // This method is defined as protected because singleton objects should not be cloned. |
| 741 | 716 | } |
| 742 | 717 | |
@@ -749,8 +724,7 @@ discard block |
||
| 749 | 724 | * |
| 750 | 725 | * @return mixed Value of $this->$var |
| 751 | 726 | */ |
| 752 | - public function __get($var) |
|
| 753 | - { |
|
| 727 | + public function __get($var) { |
|
| 754 | 728 | $method = '_get' . ucfirst($var); |
| 755 | 729 | if ( |
| 756 | 730 | !property_exists($this, $var) |
@@ -772,8 +746,7 @@ discard block |
||
| 772 | 746 | * |
| 773 | 747 | * @return bool true if variable is set and not empty, false otherwise |
| 774 | 748 | */ |
| 775 | - public function __isset($var) |
|
| 776 | - { |
|
| 749 | + public function __isset($var) { |
|
| 777 | 750 | return !empty($this->__get($var)); |
| 778 | 751 | } |
| 779 | 752 | |
@@ -787,8 +760,7 @@ discard block |
||
| 787 | 760 | * |
| 788 | 761 | * @return void |
| 789 | 762 | */ |
| 790 | - public function __set($var, $value) |
|
| 791 | - { |
|
| 763 | + public function __set($var, $value) { |
|
| 792 | 764 | $method = '_set' . ucfirst($var); |
| 793 | 765 | if ( |
| 794 | 766 | !property_exists($this, $var) |
@@ -808,8 +780,7 @@ discard block |
||
| 808 | 780 | * |
| 809 | 781 | * @return array Properties to be serialized |
| 810 | 782 | */ |
| 811 | - public function __sleep() |
|
| 812 | - { |
|
| 783 | + public function __sleep() { |
|
| 813 | 784 | return ['elements', 'metadata']; |
| 814 | 785 | } |
| 815 | 786 | |
@@ -821,8 +792,7 @@ discard block |
||
| 821 | 792 | * |
| 822 | 793 | * @return void |
| 823 | 794 | */ |
| 824 | - public function __wakeup() |
|
| 825 | - { |
|
| 795 | + public function __wakeup() { |
|
| 826 | 796 | $this->count = count($this->elements); |
| 827 | 797 | } |
| 828 | 798 | } |
@@ -21,8 +21,7 @@ |
||
| 21 | 21 | * The created output contains all classes which are required for |
| 22 | 22 | * the TYPO3 backend. Any kind of message contains also a nice icon. |
| 23 | 23 | */ |
| 24 | -class KitodoFlashMessageRenderer implements \TYPO3\CMS\Core\Messaging\Renderer\FlashMessageRendererInterface |
|
| 25 | -{ |
|
| 24 | +class KitodoFlashMessageRenderer implements \TYPO3\CMS\Core\Messaging\Renderer\FlashMessageRendererInterface { |
|
| 26 | 25 | /** |
| 27 | 26 | * @var string The message severity class names |
| 28 | 27 | */ |
@@ -23,8 +23,7 @@ |
||
| 23 | 23 | * @subpackage dlf |
| 24 | 24 | * @access public |
| 25 | 25 | */ |
| 26 | -class ext_update |
|
| 27 | -{ |
|
| 26 | +class ext_update { |
|
| 28 | 27 | /** |
| 29 | 28 | * This holds the output ready to return |
| 30 | 29 | * |