Passed
Pull Request — master (#123)
by
unknown
04:23
created
Classes/ViewHelpers/IsInArrayViewHelper.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -13,10 +13,8 @@  discard block
 block discarded – undo
13 13
 
14 14
 use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
15 15
 
16
-class IsInArrayViewHelper extends AbstractViewHelper
17
-{
18
-    public function initializeArguments()
19
-    {
16
+class IsInArrayViewHelper extends AbstractViewHelper {
17
+    public function initializeArguments() {
20 18
         parent::initializeArguments();
21 19
         $this->registerArgument('needle', 'mixed', 'The searched value', true);
22 20
         $this->registerArgument('haystack', 'array', 'The array', true);
@@ -27,8 +25,7 @@  discard block
 block discarded – undo
27 25
      *
28 26
      * @return bool
29 27
      */
30
-    public function render()
31
-    {
28
+    public function render() {
32 29
         $needle = $this->arguments['needle'];
33 30
         $haystack = $this->arguments['haystack'];
34 31
 
Please login to merge, or discard this patch.
Classes/ViewHelpers/ImplodeViewHelper.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -13,10 +13,8 @@  discard block
 block discarded – undo
13 13
 
14 14
 use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
15 15
 
16
-class ImplodeViewHelper extends AbstractViewHelper
17
-{
18
-    public function initializeArguments()
19
-    {
16
+class ImplodeViewHelper extends AbstractViewHelper {
17
+    public function initializeArguments() {
20 18
         parent::initializeArguments();
21 19
         $this->registerArgument('value', 'array', 'The array to be imploded', true);
22 20
         $this->registerArgument('delimiter', 'string', 'The delimiter ', true);
@@ -27,8 +25,7 @@  discard block
 block discarded – undo
27 25
      *
28 26
      * @return string
29 27
      */
30
-    public function render()
31
-    {
28
+    public function render() {
32 29
         $value = $this->arguments['value'];
33 30
         $delimiter = $this->arguments['delimiter'];
34 31
 
Please login to merge, or discard this patch.
Classes/Common/AnnotationRequest.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -12,8 +12,7 @@  discard block
 block discarded – undo
12 12
  * LICENSE.txt file that was distributed with this source code.
13 13
  */
14 14
 
15
-class AnnotationRequest
16
-{
15
+class AnnotationRequest {
17 16
     /**
18 17
      * @var string
19 18
      */
@@ -22,8 +21,7 @@  discard block
 block discarded – undo
22 21
     /**
23 22
      * @param string $apiUrl The url of the annotation server api.
24 23
      */
25
-    public function __construct($apiUrl)
26
-    {
24
+    public function __construct($apiUrl) {
27 25
         $this->apiUrl =  trim($apiUrl, "/ ");
28 26
     }
29 27
 
@@ -55,8 +53,7 @@  discard block
 block discarded – undo
55 53
      * @param string $id Document id (purl)
56 54
      * @return array
57 55
      */
58
-    public function getAll($id)
59
-    {
56
+    public function getAll($id) {
60 57
         $annotations = [];
61 58
 
62 59
         $annotationData = $this->requestAnnotions($this->apiUrl . '?target=' . urlencode($id . '/*'));
Please login to merge, or discard this patch.
Classes/Common/MetsDocument.php 1 patch
Braces   +8 added lines, -16 removed lines patch added patch discarded remove patch
@@ -72,8 +72,7 @@  discard block
 block discarded – undo
72 72
  * @property-read SimpleXMLElement $mets this holds the XML file's METS part as SimpleXMLElement object
73 73
  * @property-read string $parentHref URL of the parent document (determined via mptr element), or empty string if none is available
74 74
  */
75
-final class MetsDocument extends AbstractDocument
76
-{
75
+final class MetsDocument extends AbstractDocument {
77 76
     /**
78 77
      * @access protected
79 78
      * @var string[] Subsections / tags that may occur within `<mets:amdSec>`
@@ -286,8 +285,7 @@  discard block
 block discarded – undo
286 285
     /**
287 286
      * This gets the measure beginning of a page
288 287
      */
289
-    public function getPageBeginning($pageId, $fileId)
290
-    {
288
+    public function getPageBeginning($pageId, $fileId) {
291 289
         $mets = $this->mets
292 290
             ->xpath(
293 291
                 './mets:structMap[@TYPE="PHYSICAL"]' .
@@ -482,8 +480,7 @@  discard block
 block discarded – undo
482 480
      *
483 481
      * @return ?string thumbnail or null if not found
484 482
      */
485
-    private function getThumbnail(string $id = '')
486
-    {
483
+    private function getThumbnail(string $id = '') {
487 484
         // Load plugin configuration.
488 485
         $extConf = GeneralUtility::makeInstance(ExtensionConfiguration::class)->get(self::$extKey, 'files');
489 486
         $fileGrpsThumb = GeneralUtility::trimExplode(',', $extConf['fileGrpThumbs']);
@@ -624,8 +621,7 @@  discard block
 block discarded – undo
624 621
      * @param DOMNode $parentNode
625 622
      * @return array|false
626 623
      */
627
-    private function getSubentries($allSubentries, string $parentIndex, DOMNode $parentNode)
628
-    {
624
+    private function getSubentries($allSubentries, string $parentIndex, DOMNode $parentNode) {
629 625
         $domXPath = new DOMXPath($parentNode->ownerDocument);
630 626
         $this->registerNamespaces($domXPath);
631 627
         $theseSubentries = [];
@@ -655,8 +651,7 @@  discard block
 block discarded – undo
655 651
      * @param $subentry
656 652
      * @return array
657 653
      */
658
-    private function getSubentryValue($values, $subentry)
659
-    {
654
+    private function getSubentryValue($values, $subentry) {
660 655
         $theseSubentries = [];
661 656
         if (
662 657
             ($values instanceof DOMNodeList
@@ -906,8 +901,7 @@  discard block
 block discarded – undo
906 901
      *
907 902
      * @return bool true if extraction successful, false otherwise
908 903
      */
909
-    private function extractMetadataIfTypeSupported(string $dmdId, string $mdSectionType, array &$metadata)
910
-    {
904
+    private function extractMetadataIfTypeSupported(string $dmdId, string $mdSectionType, array &$metadata) {
911 905
         // Is this metadata format supported?
912 906
         if (!empty($this->formats[$this->mdSec[$dmdId]['type']])) {
913 907
             if (!empty($this->formats[$this->mdSec[$dmdId]['type']]['class'])) {
@@ -939,8 +933,7 @@  discard block
 block discarded – undo
939 933
      *
940 934
      * @return array additional metadata data queried from database
941 935
      */
942
-    private function getAdditionalMetadataFromDatabase(int $cPid, string $dmdId)
943
-    {
936
+    private function getAdditionalMetadataFromDatabase(int $cPid, string $dmdId) {
944 937
         $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
945 938
             ->getQueryBuilderForTable('tx_dlf_metadata');
946 939
         // Get hidden records, too.
@@ -1131,8 +1124,7 @@  discard block
 block discarded – undo
1131 1124
     /**
1132 1125
      * @see AbstractDocument::getStructureDepth()
1133 1126
      */
1134
-    public function getStructureDepth(string $logId)
1135
-    {
1127
+    public function getStructureDepth(string $logId) {
1136 1128
         $ancestors = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@ID="' . $logId . '"]/ancestor::*');
1137 1129
         if (!empty($ancestors)) {
1138 1130
             return count($ancestors);
Please login to merge, or discard this patch.
Classes/Common/DocumentAnnotation.php 1 patch
Braces   +11 added lines, -22 removed lines patch added patch discarded remove patch
@@ -28,8 +28,7 @@  discard block
 block discarded – undo
28 28
  *
29 29
  * @access public
30 30
  */
31
-class DocumentAnnotation
32
-{
31
+class DocumentAnnotation {
33 32
     /**
34 33
      * @var null|DocumentAnnotation
35 34
      */
@@ -55,8 +54,7 @@  discard block
 block discarded – undo
55 54
      * @param array $annotationData
56 55
      * @param Document $document
57 56
      */
58
-    private function __construct($annotationData, $document)
59
-    {
57
+    private function __construct($annotationData, $document) {
60 58
         $this->annotationData = $annotationData;
61 59
         $this->document = $document;
62 60
         $this->logger = GeneralUtility::makeInstance(LogManager::class)->getLogger(static::class);
@@ -67,8 +65,7 @@  discard block
 block discarded – undo
67 65
      *
68 66
      * @return Annotation[]|array
69 67
      */
70
-    public function getAnnotations()
71
-    {
68
+    public function getAnnotations() {
72 69
         if (empty($this->annotationData)) {
73 70
             return [];
74 71
         }
@@ -168,8 +165,7 @@  discard block
 block discarded – undo
168 165
      * @param string $logicalId
169 166
      * @return array
170 167
      */
171
-    protected function getPagesByLogicalId($logicalId)
172
-    {
168
+    protected function getPagesByLogicalId($logicalId) {
173 169
         $pages = [];
174 170
         if (
175 171
             array_key_exists('l2p', $this->document->getCurrentDocument()->smLinks) &&
@@ -193,8 +189,7 @@  discard block
 block discarded – undo
193 189
      * @param string $physicalId
194 190
      * @return array
195 191
      */
196
-    protected function getPagesByPhysicalId($physicalId)
197
-    {
192
+    protected function getPagesByPhysicalId($physicalId) {
198 193
         $pages = [];
199 194
         foreach ($this->document->getCurrentDocument()->physicalStructureInfo as $physicalInfo) {
200 195
             $order = $physicalInfo['order'];
@@ -217,8 +212,7 @@  discard block
 block discarded – undo
217 212
      * @param string $fileId
218 213
      * @return array
219 214
      */
220
-    protected function getPagesByFileId($fileId)
221
-    {
215
+    protected function getPagesByFileId($fileId) {
222 216
         $pages = [];
223 217
         foreach ($this->document->getCurrentDocument()->physicalStructureInfo as $physicalInfo) {
224 218
             if (
@@ -243,8 +237,7 @@  discard block
 block discarded – undo
243 237
      * @param string $range
244 238
      * @return array
245 239
      */
246
-    protected function getAudioPagesByFileId($fileId, $range = null)
247
-    {
240
+    protected function getAudioPagesByFileId($fileId, $range = null) {
248 241
         $tracks = [];
249 242
         foreach ($this->document->getCurrentDocument()->physicalStructureInfo as $physicalInfo) {
250 243
             if (array_key_exists('tracks', $physicalInfo) && is_array($physicalInfo['tracks'])) {
@@ -299,8 +292,7 @@  discard block
 block discarded – undo
299 292
      * @param string $range
300 293
      * @return array
301 294
      */
302
-    protected function getMeasurePagesByFileId($fileId, $range = null)
303
-    {
295
+    protected function getMeasurePagesByFileId($fileId, $range = null) {
304 296
         // Get all measures referencing the fileid
305 297
         $measures = [];
306 298
         // Get the related page numbers
@@ -355,8 +347,7 @@  discard block
 block discarded – undo
355 347
      *
356 348
      * @return array
357 349
      */
358
-    public function getVerovioRelevantAnnotations()
359
-    {
350
+    public function getVerovioRelevantAnnotations() {
360 351
         $annotations = [];
361 352
         /** @var Annotation $annotation */
362 353
         foreach ($this->getAnnotations() as $annotation) {
@@ -373,8 +364,7 @@  discard block
 block discarded – undo
373 364
      * @param Document $document
374 365
      * @return array
375 366
      */
376
-    protected static function loadData($document)
377
-    {
367
+    protected static function loadData($document) {
378 368
         $annotationData = [];
379 369
         $conf = GeneralUtility::makeInstance(ExtensionConfiguration::class)->get('dlf');
380 370
         $apiBaseUrl = $conf['annotationServerUrl'];
@@ -393,8 +383,7 @@  discard block
 block discarded – undo
393 383
      * @return DocumentAnnotation|null
394 384
      *
395 385
      */
396
-    public static function getInstance($document)
397
-    {
386
+    public static function getInstance($document) {
398 387
         if (self::$instance == null) {
399 388
             $annotationData = self::loadData($document);
400 389
             self::$instance = new DocumentAnnotation($annotationData, $document);
Please login to merge, or discard this patch.
Classes/Controller/AbstractController.php 1 patch
Braces   +9 added lines, -12 removed lines patch added patch discarded remove patch
@@ -35,8 +35,7 @@  discard block
 block discarded – undo
35 35
  *
36 36
  * @abstract
37 37
  */
38
-abstract class AbstractController extends ActionController implements LoggerAwareInterface
39
-{
38
+abstract class AbstractController extends ActionController implements LoggerAwareInterface {
40 39
     use LoggerAwareTrait;
41 40
 
42 41
     /**
@@ -236,8 +235,7 @@  discard block
 block discarded – undo
236 235
      *
237 236
      * @return null|string|array
238 237
      */
239
-    protected function getParametersSafely(string $parameterName)
240
-    {
238
+    protected function getParametersSafely(string $parameterName) {
241 239
         if ($this->request->hasArgument($parameterName)) {
242 240
             return $this->request->getArgument($parameterName);
243 241
         }
@@ -333,8 +331,7 @@  discard block
 block discarded – undo
333 331
      *
334 332
      * @return void
335 333
      */
336
-    public function __construct()
337
-    {
334
+    public function __construct() {
338 335
         $this->initialize();
339 336
     }
340 337
 
@@ -375,7 +372,8 @@  discard block
 block discarded – undo
375 372
         $lastStartRecordNumberGrid = 0; // due to validity outside the loop
376 373
         foreach (range($firstPage, $lastPage) as $i) {
377 374
             // detect which pagination is active: ListView or GridView
378
-            if (get_class($pagination) == 'TYPO3\CMS\Core\Pagination\SimplePagination') {  // ListView
375
+            if (get_class($pagination) == 'TYPO3\CMS\Core\Pagination\SimplePagination') {
376
+// ListView
379 377
                 $lastStartRecordNumberGrid = $i; // save last $startRecordNumber for LastPage button
380 378
 
381 379
                 $pages[$i] = [
@@ -388,7 +386,8 @@  discard block
 block discarded – undo
388 386
                 if (in_array($i, $aRange)) {
389 387
                     array_push($pagesSect, ['label' => $i, 'startRecordNumber' => $i]);
390 388
                 };
391
-            } else { // GridView
389
+            } else {
390
+// GridView
392 391
                 // to calculate the values for generation the links for the pagination pages
393 392
                 /** @var \Kitodo\Dlf\Pagination\PageGridPaginator $paginator */
394 393
                 $itemsPerPage = $paginator->getPublicItemsPerPage();
@@ -468,8 +467,7 @@  discard block
 block discarded – undo
468 467
      *
469 468
      * @return AbstractDocument
470 469
      */
471
-    private function getDocumentByUid(int $documentId)
472
-    {
470
+    private function getDocumentByUid(int $documentId) {
473 471
         $doc = null;
474 472
         $this->document = $this->documentRepository->findOneByIdAndSettings($documentId);
475 473
 
@@ -491,8 +489,7 @@  discard block
 block discarded – undo
491 489
      *
492 490
      * @return AbstractDocument
493 491
      */
494
-    protected function getDocumentByUrl(string $documentId)
495
-    {
492
+    protected function getDocumentByUrl(string $documentId) {
496 493
         $doc = AbstractDocument::getInstance($documentId, $this->settings, true);
497 494
 
498 495
         if (isset($this->settings['multiViewType']) && $doc->tableOfContents[0]['type'] === $this->settings['multiViewType']) {
Please login to merge, or discard this patch.
Classes/Controller/Embedded3dViewerController.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -21,8 +21,7 @@
 block discarded – undo
21 21
  *
22 22
  * @access public
23 23
  */
24
-class Embedded3dViewerController extends AbstractController
25
-{
24
+class Embedded3dViewerController extends AbstractController {
26 25
 
27 26
     const MIDDLEWARE_DLF_EMBEDDED_3D_VIEWER_PREFIX = '/?middleware=dlf/embedded3dviewer';
28 27
 
Please login to merge, or discard this patch.
Classes/Command/OptimizeCommand.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -27,8 +27,7 @@
 block discarded – undo
27 27
  *
28 28
  * @access public
29 29
  */
30
-class OptimizeCommand extends Command
31
-{
30
+class OptimizeCommand extends Command {
32 31
 
33 32
     /**
34 33
      * Configure the command by defining the name, options and arguments
Please login to merge, or discard this patch.
Classes/Task/DeleteTask.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -23,10 +23,8 @@
 block discarded – undo
23 23
  *
24 24
  * @access public
25 25
  */
26
-class DeleteTask extends BaseTask
27
-{
28
-    public function execute()
29
-    {
26
+class DeleteTask extends BaseTask {
27
+    public function execute() {
30 28
         $inputArray = [];
31 29
         $inputArray['-d'] = $this->doc;
32 30
         $inputArray['-p'] = $this->pid;
Please login to merge, or discard this patch.