Passed
Pull Request — master (#123)
by Sebastian
03:12
created
Classes/Controller/StatisticsController.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -33,13 +33,13 @@
 block discarded – undo
33 33
         $foundNumbers = $this->documentRepository->getStatisticsForSelectedCollection($this->settings);
34 34
 
35 35
         // Set replacements.
36
-        $args['###TITLES###'] = $foundNumbers['titles'] . ' ' . htmlspecialchars(
36
+        $args['###TITLES###'] = $foundNumbers['titles'].' '.htmlspecialchars(
37 37
             LocalizationUtility::translate(
38 38
                 ($foundNumbers['titles'] > 1 ? 'titles' : 'title'), 'dlf'
39 39
             )
40 40
         );
41 41
 
42
-        $args['###VOLUMES###'] = $foundNumbers['volumes'] . ' ' . htmlspecialchars(
42
+        $args['###VOLUMES###'] = $foundNumbers['volumes'].' '.htmlspecialchars(
43 43
             LocalizationUtility::translate(
44 44
                 ($foundNumbers['volumes'] > 1 ? 'volumes' : 'volume'), 'dlf'
45 45
             )
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -21,15 +21,13 @@
 block discarded – undo
21 21
  * @subpackage dlf
22 22
  * @access public
23 23
  */
24
-class StatisticsController extends AbstractController
25
-{
24
+class StatisticsController extends AbstractController {
26 25
     /**
27 26
      * The main method of the plugin
28 27
      *
29 28
      * @return void
30 29
      */
31
-    public function mainAction()
32
-    {
30
+    public function mainAction() {
33 31
         $foundNumbers = $this->documentRepository->getStatisticsForSelectedCollection($this->settings);
34 32
 
35 33
         // Set replacements.
Please login to merge, or discard this patch.
Classes/Domain/Repository/DocumentRepository.php 4 patches
Indentation   -1 removed lines patch added patch discarded remove patch
@@ -210,7 +210,6 @@
 block discarded – undo
210 210
      * Volumes are documents that are both
211 211
      *  a) "leaf" elements i.e. partof != 0
212 212
      *  b) "root" elements that are not referenced by other documents ("root" elements that have no descendants)
213
-
214 213
      * @param array $settings
215 214
      *
216 215
      * @return array
Please login to merge, or discard this patch.
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -356,7 +356,7 @@  discard block
 block discarded – undo
356 356
 
357 357
         $excludeOtherWhere = '';
358 358
         if ($settings['excludeOther']) {
359
-            $excludeOtherWhere = 'tx_dlf_documents.pid=' . intval($settings['storagePid']);
359
+            $excludeOtherWhere = 'tx_dlf_documents.pid='.intval($settings['storagePid']);
360 360
         }
361 361
         // Check if there are any metadata to suggest.
362 362
         $result = $queryBuilder
@@ -408,12 +408,12 @@  discard block
 block discarded – undo
408 408
         $connection = GeneralUtility::makeInstance(ConnectionPool::class)
409 409
             ->getConnectionForTable('tx_dlf_documents');
410 410
 
411
-        $sql = 'SELECT `tx_dlf_documents`.*, GROUP_CONCAT(DISTINCT `tx_dlf_collections`.`oai_name` ORDER BY `tx_dlf_collections`.`oai_name` SEPARATOR " ") AS `collections` ' .
412
-            'FROM `tx_dlf_documents` ' .
413
-            'INNER JOIN `tx_dlf_relations` ON `tx_dlf_relations`.`uid_local` = `tx_dlf_documents`.`uid` ' .
414
-            'INNER JOIN `tx_dlf_collections` ON `tx_dlf_collections`.`uid` = `tx_dlf_relations`.`uid_foreign` ' .
415
-            'WHERE `tx_dlf_documents`.`record_id` = ? ' .
416
-            'AND `tx_dlf_relations`.`ident`="docs_colls" ' .
411
+        $sql = 'SELECT `tx_dlf_documents`.*, GROUP_CONCAT(DISTINCT `tx_dlf_collections`.`oai_name` ORDER BY `tx_dlf_collections`.`oai_name` SEPARATOR " ") AS `collections` '.
412
+            'FROM `tx_dlf_documents` '.
413
+            'INNER JOIN `tx_dlf_relations` ON `tx_dlf_relations`.`uid_local` = `tx_dlf_documents`.`uid` '.
414
+            'INNER JOIN `tx_dlf_collections` ON `tx_dlf_collections`.`uid` = `tx_dlf_relations`.`uid_foreign` '.
415
+            'WHERE `tx_dlf_documents`.`record_id` = ? '.
416
+            'AND `tx_dlf_relations`.`ident`="docs_colls" '.
417 417
             $where;
418 418
 
419 419
         $values = [
@@ -443,13 +443,13 @@  discard block
 block discarded – undo
443 443
         $connection = GeneralUtility::makeInstance(ConnectionPool::class)
444 444
             ->getConnectionForTable('tx_dlf_documents');
445 445
 
446
-        $sql = 'SELECT `tx_dlf_documents`.*, GROUP_CONCAT(DISTINCT `tx_dlf_collections`.`oai_name` ORDER BY `tx_dlf_collections`.`oai_name` SEPARATOR " ") AS `collections` ' .
447
-            'FROM `tx_dlf_documents` ' .
448
-            'INNER JOIN `tx_dlf_relations` ON `tx_dlf_relations`.`uid_local` = `tx_dlf_documents`.`uid` ' .
449
-            'INNER JOIN `tx_dlf_collections` ON `tx_dlf_collections`.`uid` = `tx_dlf_relations`.`uid_foreign` ' .
450
-            'WHERE `tx_dlf_documents`.`uid` IN ( ? ) ' .
451
-            'AND `tx_dlf_relations`.`ident`="docs_colls" ' .
452
-            'AND ' . Helper::whereExpression('tx_dlf_collections') . ' ' .
446
+        $sql = 'SELECT `tx_dlf_documents`.*, GROUP_CONCAT(DISTINCT `tx_dlf_collections`.`oai_name` ORDER BY `tx_dlf_collections`.`oai_name` SEPARATOR " ") AS `collections` '.
447
+            'FROM `tx_dlf_documents` '.
448
+            'INNER JOIN `tx_dlf_relations` ON `tx_dlf_relations`.`uid_local` = `tx_dlf_documents`.`uid` '.
449
+            'INNER JOIN `tx_dlf_collections` ON `tx_dlf_collections`.`uid` = `tx_dlf_relations`.`uid_foreign` '.
450
+            'WHERE `tx_dlf_documents`.`uid` IN ( ? ) '.
451
+            'AND `tx_dlf_relations`.`ident`="docs_colls" '.
452
+            'AND '.Helper::whereExpression('tx_dlf_collections').' '.
453 453
             'GROUP BY `tx_dlf_documents`.`uid` ';
454 454
 
455 455
         $values = [
Please login to merge, or discard this patch.
Braces   +13 added lines, -26 removed lines patch added patch discarded remove patch
@@ -48,8 +48,7 @@  discard block
 block discarded – undo
48 48
      *
49 49
      * @return \Kitodo\Dlf\Domain\Model\Document|null
50 50
      */
51
-    public function findOneByParameters($parameters)
52
-    {
51
+    public function findOneByParameters($parameters) {
53 52
         $doc = null;
54 53
         $document = null;
55 54
 
@@ -93,8 +92,7 @@  discard block
 block discarded – undo
93 92
      *
94 93
      * @return \Kitodo\Dlf\Domain\Model\Document|null
95 94
      */
96
-    public function findOldestDocument()
97
-    {
95
+    public function findOldestDocument() {
98 96
         $query = $this->createQuery();
99 97
 
100 98
         $query->setOrderings(['tstamp' => QueryInterface::ORDER_ASCENDING]);
@@ -108,8 +106,7 @@  discard block
 block discarded – undo
108 106
      * @param  \Kitodo\Dlf\Domain\Model\Structure $structure
109 107
      * @return array|\TYPO3\CMS\Extbase\Persistence\QueryResultInterface
110 108
      */
111
-    public function getChildrenOfYearAnchor($partOf, $structure)
112
-    {
109
+    public function getChildrenOfYearAnchor($partOf, $structure) {
113 110
         $query = $this->createQuery();
114 111
 
115 112
         $query->matching($query->equals('structure', $structure));
@@ -130,8 +127,7 @@  discard block
 block discarded – undo
130 127
      *
131 128
      * @return \Kitodo\Dlf\Domain\Model\Document|null
132 129
      */
133
-    public function findOneByIdAndSettings($uid, $settings = [])
134
-    {
130
+    public function findOneByIdAndSettings($uid, $settings = []) {
135 131
         $settings = ['documentSets' => $uid];
136 132
 
137 133
         return $this->findDocumentsBySettings($settings)->getFirst();
@@ -144,8 +140,7 @@  discard block
 block discarded – undo
144 140
      *
145 141
      * @return array|\TYPO3\CMS\Extbase\Persistence\QueryResultInterface
146 142
      */
147
-    public function findDocumentsBySettings($settings = [])
148
-    {
143
+    public function findDocumentsBySettings($settings = []) {
149 144
         $query = $this->createQuery();
150 145
 
151 146
         $constraints = [];
@@ -175,8 +170,7 @@  discard block
 block discarded – undo
175 170
      *
176 171
      * @return array|\TYPO3\CMS\Extbase\Persistence\QueryResultInterface
177 172
      */
178
-    public function findAllByCollectionsLimited($collections, $limit = 50)
179
-    {
173
+    public function findAllByCollectionsLimited($collections, $limit = 50) {
180 174
         $query = $this->createQuery();
181 175
 
182 176
         // order by start_date -> start_time...
@@ -213,8 +207,7 @@  discard block
 block discarded – undo
213 207
      *
214 208
      * @return array
215 209
      */
216
-    public function getStatisticsForSelectedCollection($settings)
217
-    {
210
+    public function getStatisticsForSelectedCollection($settings) {
218 211
         if ($settings['collections']) {
219 212
             // Include only selected collections.
220 213
             $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
@@ -348,8 +341,7 @@  discard block
 block discarded – undo
348 341
      *
349 342
      * @return \TYPO3\CMS\Extbase\Persistence\QueryResultInterface
350 343
      */
351
-    public function getTableOfContentsFromDb($uid, $pid, $settings)
352
-    {
344
+    public function getTableOfContentsFromDb($uid, $pid, $settings) {
353 345
         // Build table of contents from database.
354 346
         $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
355 347
             ->getQueryBuilderForTable('tx_dlf_documents');
@@ -397,8 +389,7 @@  discard block
 block discarded – undo
397 389
      *
398 390
      * @return array The found document object
399 391
      */
400
-    public function getOaiRecord($settings, $parameters)
401
-    {
392
+    public function getOaiRecord($settings, $parameters) {
402 393
         $where = '';
403 394
 
404 395
         if (!$settings['show_userdefined']) {
@@ -438,8 +429,7 @@  discard block
 block discarded – undo
438 429
      *
439 430
      * @return array The found document objects
440 431
      */
441
-    public function getOaiDocumentList($settings, $documentsToProcess)
442
-    {
432
+    public function getOaiDocumentList($settings, $documentsToProcess) {
443 433
         $connection = GeneralUtility::makeInstance(ConnectionPool::class)
444 434
             ->getConnectionForTable('tx_dlf_documents');
445 435
 
@@ -474,8 +464,7 @@  discard block
 block discarded – undo
474 464
      *
475 465
      * @return array
476 466
      */
477
-    public function findAllByUids($uids, $checkPartof = false)
478
-    {
467
+    public function findAllByUids($uids, $checkPartof = false) {
479 468
         // get all documents from db we are talking about
480 469
         $connectionPool = GeneralUtility::makeInstance(ConnectionPool::class);
481 470
         $queryBuilder = $connectionPool->getQueryBuilderForTable('tx_dlf_documents');
@@ -524,8 +513,7 @@  discard block
 block discarded – undo
524 513
      *
525 514
      * @return array
526 515
      */
527
-    public function findChildrenOfEach(array $uids)
528
-    {
516
+    public function findChildrenOfEach(array $uids) {
529 517
         $allDocuments = $this->findAllByUids($uids, true);
530 518
 
531 519
         $result = [];
@@ -546,8 +534,7 @@  discard block
 block discarded – undo
546 534
      * @param \TYPO3\CMS\Extbase\Persistence\Generic\QueryResult $listedMetadata
547 535
      * @return array
548 536
      */
549
-    public function findSolrByCollection($collection, $settings, $searchParams, $listedMetadata = null)
550
-    {
537
+    public function findSolrByCollection($collection, $settings, $searchParams, $listedMetadata = null) {
551 538
         // set settings global inside this repository
552 539
         // (may be necessary when SolrSearch calls back)
553 540
         $this->settings = $settings;
Please login to merge, or discard this patch.
Upper-Lower-Casing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -50,8 +50,8 @@  discard block
 block discarded – undo
50 50
      */
51 51
     public function findOneByParameters($parameters)
52 52
     {
53
-        $doc = null;
54
-        $document = null;
53
+        $doc = NULL;
54
+        $document = NULL;
55 55
 
56 56
         if (isset($parameters['id']) && MathUtility::canBeInterpretedAsInteger($parameters['id'])) {
57 57
 
@@ -63,13 +63,13 @@  discard block
 block discarded – undo
63 63
 
64 64
         } else if (isset($parameters['location']) && GeneralUtility::isValidUrl($parameters['location'])) {
65 65
 
66
-            $doc = Doc::getInstance($parameters['location'], [], true);
66
+            $doc = Doc::getInstance($parameters['location'], [], TRUE);
67 67
 
68 68
             if ($doc->recordId) {
69 69
                 $document = $this->findOneByRecordId($doc->recordId);
70 70
             }
71 71
 
72
-            if ($document === null) {
72
+            if ($document === NULL) {
73 73
                 // create new (dummy) Document object
74 74
                 $document = GeneralUtility::makeInstance(Document::class);
75 75
                 $document->setLocation($parameters['location']);
@@ -77,11 +77,11 @@  discard block
 block discarded – undo
77 77
 
78 78
         }
79 79
 
80
-        if ($document !== null && $doc === null) {
81
-            $doc = Doc::getInstance($document->getLocation(), [], true);
80
+        if ($document !== NULL && $doc === NULL) {
81
+            $doc = Doc::getInstance($document->getLocation(), [], TRUE);
82 82
         }
83 83
 
84
-        if ($doc !== null) {
84
+        if ($doc !== NULL) {
85 85
             $document->setDoc($doc);
86 86
         }
87 87
 
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
         }
156 156
 
157 157
         if (isset($settings['excludeOther']) && (int) $settings['excludeOther'] === 0) {
158
-            $query->getQuerySettings()->setRespectStoragePage(false);
158
+            $query->getQuerySettings()->setRespectStoragePage(FALSE);
159 159
         }
160 160
 
161 161
         if (count($constraints)) {
@@ -474,7 +474,7 @@  discard block
 block discarded – undo
474 474
      *
475 475
      * @return array
476 476
      */
477
-    public function findAllByUids($uids, $checkPartof = false)
477
+    public function findAllByUids($uids, $checkPartof = FALSE)
478 478
     {
479 479
         // get all documents from db we are talking about
480 480
         $connectionPool = GeneralUtility::makeInstance(ConnectionPool::class);
@@ -526,7 +526,7 @@  discard block
 block discarded – undo
526 526
      */
527 527
     public function findChildrenOfEach(array $uids)
528 528
     {
529
-        $allDocuments = $this->findAllByUids($uids, true);
529
+        $allDocuments = $this->findAllByUids($uids, TRUE);
530 530
 
531 531
         $result = [];
532 532
         foreach ($allDocuments as $doc) {
@@ -546,7 +546,7 @@  discard block
 block discarded – undo
546 546
      * @param \TYPO3\CMS\Extbase\Persistence\Generic\QueryResult $listedMetadata
547 547
      * @return array
548 548
      */
549
-    public function findSolrByCollection($collection, $settings, $searchParams, $listedMetadata = null)
549
+    public function findSolrByCollection($collection, $settings, $searchParams, $listedMetadata = NULL)
550 550
     {
551 551
         // set settings global inside this repository
552 552
         // (may be necessary when SolrSearch calls back)
Please login to merge, or discard this patch.
Classes/ViewHelpers/StdWrapViewHelper.php 2 patches
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -15,12 +15,10 @@  discard block
 block discarded – undo
15 15
 use TYPO3\CMS\Extbase\Configuration\ConfigurationManager;
16 16
 use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
17 17
 
18
-class StdWrapViewHelper extends AbstractViewHelper
19
-{
18
+class StdWrapViewHelper extends AbstractViewHelper {
20 19
     protected $escapeOutput = false;
21 20
 
22
-    public function initializeArguments()
23
-    {
21
+    public function initializeArguments() {
24 22
         parent::initializeArguments();
25 23
         $this->registerArgument('wrap', 'string', 'The wrap information', true);
26 24
         $this->registerArgument('data', 'array', 'Data for the content object', false);
@@ -31,8 +29,7 @@  discard block
 block discarded – undo
31 29
      *
32 30
      * @return string
33 31
      */
34
-    public function render()
35
-    {
32
+    public function render() {
36 33
         $wrap = $this->arguments['wrap'];
37 34
         $data = $this->arguments['data'] ?? [];
38 35
 
Please login to merge, or discard this patch.
Upper-Lower-Casing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -17,13 +17,13 @@
 block discarded – undo
17 17
 
18 18
 class StdWrapViewHelper extends AbstractViewHelper
19 19
 {
20
-    protected $escapeOutput = false;
20
+    protected $escapeOutput = FALSE;
21 21
 
22 22
     public function initializeArguments()
23 23
     {
24 24
         parent::initializeArguments();
25
-        $this->registerArgument('wrap', 'string', 'The wrap information', true);
26
-        $this->registerArgument('data', 'array', 'Data for the content object', false);
25
+        $this->registerArgument('wrap', 'string', 'The wrap information', TRUE);
26
+        $this->registerArgument('data', 'array', 'Data for the content object', FALSE);
27 27
     }
28 28
 
29 29
     /**
Please login to merge, or discard this patch.
Tests/Functional/FunctionalTestCase.php 3 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
         $this->configurationToUseInTestInstance['EXTENSIONS']['dlf'] = $this->getDlfConfiguration();
72 72
 
73 73
         if ($this->disableJsonWrappedResponse) {
74
-            $this->frameworkExtensionsToLoad = array_filter($this->frameworkExtensionsToLoad, function ($ext) {
74
+            $this->frameworkExtensionsToLoad = array_filter($this->frameworkExtensionsToLoad, function($ext) {
75 75
                 return $ext !== 'Resources/Core/Functional/Extensions/json_response';
76 76
             });
77 77
         }
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
 
84 84
         $this->objectManager = GeneralUtility::makeInstance(ObjectManager::class);
85 85
 
86
-        $this->baseUrl = 'http://web:8000/public/typo3temp/var/tests/functional-' . $this->identifier . '/';
86
+        $this->baseUrl = 'http://web:8000/public/typo3temp/var/tests/functional-'.$this->identifier.'/';
87 87
         $this->httpClient = new HttpClient([
88 88
             'base_uri' => $this->baseUrl,
89 89
             'http_errors' => false,
@@ -127,13 +127,13 @@  discard block
 block discarded – undo
127 127
 
128 128
     protected function addSiteConfig($identifier, $baseUrl)
129 129
     {
130
-        $siteConfig = Yaml::parseFile(__DIR__ . '/../Fixtures/siteconfig.yaml');
130
+        $siteConfig = Yaml::parseFile(__DIR__.'/../Fixtures/siteconfig.yaml');
131 131
         $siteConfig['base'] = $baseUrl;
132 132
         $siteConfig['languages'][0]['base'] = $baseUrl;
133 133
 
134
-        $siteConfigPath = $this->instancePath . '/typo3conf/sites/' . $identifier;
134
+        $siteConfigPath = $this->instancePath.'/typo3conf/sites/'.$identifier;
135 135
         @mkdir($siteConfigPath, 0775, true);
136
-        file_put_contents($siteConfigPath . '/config.yaml', Yaml::dump($siteConfig));
136
+        file_put_contents($siteConfigPath.'/config.yaml', Yaml::dump($siteConfig));
137 137
     }
138 138
 
139 139
     protected function initializeRepository(string $className, int $storagePid)
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
         $jsonDocuments = json_decode(file_get_contents($path), true);
153 153
 
154 154
         $updateQuery = $solr->service->createUpdate();
155
-        $documents = array_map(function ($jsonDoc) use ($updateQuery) {
155
+        $documents = array_map(function($jsonDoc) use ($updateQuery) {
156 156
             $document = $updateQuery->createDocument();
157 157
             foreach ($jsonDoc as $key => $value) {
158 158
                 $document->setField($key, $value);
Please login to merge, or discard this patch.
Upper-Lower-Casing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
      *
50 50
      * @var bool
51 51
      */
52
-    protected $disableJsonWrappedResponse = false;
52
+    protected $disableJsonWrappedResponse = FALSE;
53 53
 
54 54
     /** @var ObjectManager */
55 55
     protected $objectManager;
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
         $this->baseUrl = 'http://web:8000/public/typo3temp/var/tests/functional-' . $this->identifier . '/';
87 87
         $this->httpClient = new HttpClient([
88 88
             'base_uri' => $this->baseUrl,
89
-            'http_errors' => false,
89
+            'http_errors' => FALSE,
90 90
         ]);
91 91
 
92 92
         $this->addSiteConfig('dlf-testing', $this->baseUrl);
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
         $siteConfig['languages'][0]['base'] = $baseUrl;
133 133
 
134 134
         $siteConfigPath = $this->instancePath . '/typo3conf/sites/' . $identifier;
135
-        @mkdir($siteConfigPath, 0775, true);
135
+        @mkdir($siteConfigPath, 0775, TRUE);
136 136
         file_put_contents($siteConfigPath . '/config.yaml', Yaml::dump($siteConfig));
137 137
     }
138 138
 
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
 
150 150
     protected function importSolrDocuments(Solr $solr, string $path)
151 151
     {
152
-        $jsonDocuments = json_decode(file_get_contents($path), true);
152
+        $jsonDocuments = json_decode(file_get_contents($path), TRUE);
153 153
 
154 154
         $updateQuery = $solr->service->createUpdate();
155 155
         $documents = array_map(function ($jsonDoc) use ($updateQuery) {
Please login to merge, or discard this patch.
Braces   +7 added lines, -14 removed lines patch added patch discarded remove patch
@@ -67,8 +67,7 @@  discard block
 block discarded – undo
67 67
      */
68 68
     protected $httpClient;
69 69
 
70
-    public function __construct()
71
-    {
70
+    public function __construct() {
72 71
         parent::__construct();
73 72
 
74 73
         $this->configurationToUseInTestInstance['EXTENSIONS']['dlf'] = $this->getDlfConfiguration();
@@ -95,8 +94,7 @@  discard block
 block discarded – undo
95 94
         $this->addSiteConfig('dlf-testing', $this->baseUrl);
96 95
     }
97 96
 
98
-    protected function getDlfConfiguration()
99
-    {
97
+    protected function getDlfConfiguration() {
100 98
         return [
101 99
             'fileGrpImages' => 'DEFAULT,MAX',
102 100
             'fileGrpThumbs' => 'THUMBS',
@@ -134,8 +132,7 @@  discard block
 block discarded – undo
134 132
         ];
135 133
     }
136 134
 
137
-    protected function addSiteConfig($identifier, $baseUrl)
138
-    {
135
+    protected function addSiteConfig($identifier, $baseUrl) {
139 136
         $siteConfig = Yaml::parseFile(__DIR__ . '/../Fixtures/siteconfig.yaml');
140 137
         $siteConfig['base'] = $baseUrl;
141 138
         $siteConfig['languages'][0]['base'] = $baseUrl;
@@ -145,8 +142,7 @@  discard block
 block discarded – undo
145 142
         file_put_contents($siteConfigPath . '/config.yaml', Yaml::dump($siteConfig));
146 143
     }
147 144
 
148
-    protected function initializeRepository(string $className, int $storagePid)
149
-    {
145
+    protected function initializeRepository(string $className, int $storagePid) {
150 146
         $repository = $this->objectManager->get($className);
151 147
 
152 148
         $querySettings = $this->objectManager->get(Typo3QuerySettings::class);
@@ -156,8 +152,7 @@  discard block
 block discarded – undo
156 152
         return $repository;
157 153
     }
158 154
 
159
-    protected function importSolrDocuments(Solr $solr, string $path)
160
-    {
155
+    protected function importSolrDocuments(Solr $solr, string $path) {
161 156
         $jsonDocuments = json_decode(file_get_contents($path), true);
162 157
 
163 158
         $updateQuery = $solr->service->createUpdate();
@@ -176,8 +171,7 @@  discard block
 block discarded – undo
176 171
         $solr->service->update($updateQuery);
177 172
     }
178 173
 
179
-    protected function initLanguageService(string $locale)
180
-    {
174
+    protected function initLanguageService(string $locale) {
181 175
         if (class_exists(\TYPO3\CMS\Core\Localization\LanguageServiceFactory::class)) {
182 176
             $GLOBALS['LANG'] = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Localization\LanguageServiceFactory::class)->create($locale);
183 177
         } else {
@@ -193,8 +187,7 @@  discard block
 block discarded – undo
193 187
     /**
194 188
      * Assert that $sub is recursively contained within $super.
195 189
      */
196
-    protected function assertArrayMatches(array $sub, array $super, string $message = '')
197
-    {
190
+    protected function assertArrayMatches(array $sub, array $super, string $message = '') {
198 191
         $this->assertEquals($sub, ArrayUtility::intersectRecursive($super, $sub), $message);
199 192
     }
200 193
 }
Please login to merge, or discard this patch.
Tests/Functional/Api/OaiPmhTest.php 3 patches
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -37,15 +37,15 @@  discard block
 block discarded – undo
37 37
     {
38 38
         parent::setUp();
39 39
 
40
-        $this->oaiUrl = $this->baseUrl . '/index.php?id=' . $this->oaiPage;
41
-        $this->oaiUrlNoStoragePid = $this->baseUrl . '/index.php?id=' . $this->oaiPageNoStoragePid;
40
+        $this->oaiUrl = $this->baseUrl.'/index.php?id='.$this->oaiPage;
41
+        $this->oaiUrlNoStoragePid = $this->baseUrl.'/index.php?id='.$this->oaiPageNoStoragePid;
42 42
 
43
-        $this->importDataSet(__DIR__ . '/../../Fixtures/Common/documents_1.xml');
44
-        $this->importDataSet(__DIR__ . '/../../Fixtures/Common/metadata.xml');
45
-        $this->importDataSet(__DIR__ . '/../../Fixtures/Common/libraries.xml');
46
-        $this->importDataSet(__DIR__ . '/../../Fixtures/Common/pages.xml');
47
-        $this->importDataSet(__DIR__ . '/../../Fixtures/OaiPmh/pages.xml');
48
-        $this->importDataSet(__DIR__ . '/../../Fixtures/OaiPmh/solrcores.xml');
43
+        $this->importDataSet(__DIR__.'/../../Fixtures/Common/documents_1.xml');
44
+        $this->importDataSet(__DIR__.'/../../Fixtures/Common/metadata.xml');
45
+        $this->importDataSet(__DIR__.'/../../Fixtures/Common/libraries.xml');
46
+        $this->importDataSet(__DIR__.'/../../Fixtures/Common/pages.xml');
47
+        $this->importDataSet(__DIR__.'/../../Fixtures/OaiPmh/pages.xml');
48
+        $this->importDataSet(__DIR__.'/../../Fixtures/OaiPmh/solrcores.xml');
49 49
 
50 50
         $this->persistenceManager = $this->objectManager->get(PersistenceManager::class);
51 51
         $this->solrCoreRepository = $this->initializeRepository(SolrCoreRepository::class, 20000);
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
             $coreName = Solr::createCore();
63 63
             $solr = Solr::getInstance($coreName);
64 64
 
65
-            $this->importSolrDocuments($solr, __DIR__ . '/../../Fixtures/Common/documents_1.solr.json');
65
+            $this->importSolrDocuments($solr, __DIR__.'/../../Fixtures/Common/documents_1.solr.json');
66 66
         }
67 67
 
68 68
         $oaiCoreModel = $this->solrCoreRepository->findByUid(11001);
Please login to merge, or discard this patch.
Braces   +14 added lines, -28 removed lines patch added patch discarded remove patch
@@ -12,8 +12,7 @@  discard block
 block discarded – undo
12 12
 use SimpleXMLElement;
13 13
 use TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager;
14 14
 
15
-class OaiPmhTest extends FunctionalTestCase
16
-{
15
+class OaiPmhTest extends FunctionalTestCase {
17 16
     protected $disableJsonWrappedResponse = true;
18 17
 
19 18
     protected $coreExtensionsToLoad = [
@@ -53,8 +52,7 @@  discard block
 block discarded – undo
53 52
         $this->setUpOaiSolr();
54 53
     }
55 54
 
56
-    protected function setUpOaiSolr()
57
-    {
55
+    protected function setUpOaiSolr() {
58 56
         // Setup Solr only once for all tests in this suite
59 57
         static $solr = null;
60 58
 
@@ -74,8 +72,7 @@  discard block
 block discarded – undo
74 72
     /**
75 73
      * @test
76 74
      */
77
-    public function correctlyRespondsOnBadVerb()
78
-    {
75
+    public function correctlyRespondsOnBadVerb() {
79 76
         $client = new HttpClient();
80 77
         $response = $client->get($this->baseUrl, [
81 78
             'query' => [
@@ -100,8 +97,7 @@  discard block
 block discarded – undo
100 97
     /**
101 98
      * @test
102 99
      */
103
-    public function canIdentify()
104
-    {
100
+    public function canIdentify() {
105 101
         $oai = Endpoint::build($this->oaiUrl);
106 102
         $identity = $oai->identify();
107 103
 
@@ -114,8 +110,7 @@  discard block
 block discarded – undo
114 110
     /**
115 111
      * @test
116 112
      */
117
-    public function identifyGivesFallbackDatestampWhenNoDocuments()
118
-    {
113
+    public function identifyGivesFallbackDatestampWhenNoDocuments() {
119 114
         $oai = Endpoint::build($this->oaiUrlNoStoragePid);
120 115
         $identity = $oai->identify();
121 116
 
@@ -125,8 +120,7 @@  discard block
 block discarded – undo
125 120
     /**
126 121
      * @test
127 122
      */
128
-    public function canListMetadataFormats()
129
-    {
123
+    public function canListMetadataFormats() {
130 124
         $oai = Endpoint::build($this->oaiUrl);
131 125
         $formats = $oai->listMetadataFormats();
132 126
 
@@ -141,8 +135,7 @@  discard block
 block discarded – undo
141 135
     /**
142 136
      * @test
143 137
      */
144
-    public function canListRecords()
145
-    {
138
+    public function canListRecords() {
146 139
         $oai = Endpoint::build($this->oaiUrl);
147 140
         $result = $oai->listRecords('mets');
148 141
 
@@ -155,8 +148,7 @@  discard block
 block discarded – undo
155 148
     /**
156 149
      * @test
157 150
      */
158
-    public function noRecordsUntil1900()
159
-    {
151
+    public function noRecordsUntil1900() {
160 152
         $this->expectException(OaipmhException::class);
161 153
         $this->expectExceptionMessage('empty list');
162 154
 
@@ -169,8 +161,7 @@  discard block
 block discarded – undo
169 161
     /**
170 162
      * @test
171 163
      */
172
-    public function canUseResumptionToken()
173
-    {
164
+    public function canUseResumptionToken() {
174 165
         // NOTE: cursor and expirationDate are optional by the specification,
175 166
         //       but we include them in our implementation
176 167
 
@@ -228,8 +219,7 @@  discard block
 block discarded – undo
228 219
     /**
229 220
      * @test
230 221
      */
231
-    public function noResumptionTokenForCompleteList()
232
-    {
222
+    public function noResumptionTokenForCompleteList() {
233 223
         $client = new HttpClient();
234 224
 
235 225
         foreach (['ListIdentifiers', 'ListRecords'] as $verb) {
@@ -251,8 +241,7 @@  discard block
 block discarded – undo
251 241
     /**
252 242
      * @test
253 243
      */
254
-    public function canListAndResumeIdentifiers()
255
-    {
244
+    public function canListAndResumeIdentifiers() {
256 245
         $oai = Endpoint::build($this->oaiUrl);
257 246
         $result = $oai->listIdentifiers('mets');
258 247
 
@@ -265,18 +254,15 @@  discard block
 block discarded – undo
265 254
         $this->assertEquals('oai:de:slub-dresden:db:id-476248086', $record->identifier);
266 255
     }
267 256
 
268
-    protected function parseUtc(string $dateTime)
269
-    {
257
+    protected function parseUtc(string $dateTime) {
270 258
         return DateTime::createFromFormat('Y-m-d\TH:i:s\Z', $dateTime);
271 259
     }
272 260
 
273
-    protected function assertUtcDateString(string $dateTime)
274
-    {
261
+    protected function assertUtcDateString(string $dateTime) {
275 262
         $this->assertInstanceOf(DateTime::class, $this->parseUtc($dateTime));
276 263
     }
277 264
 
278
-    protected function assertInFuture(string $dateTime)
279
-    {
265
+    protected function assertInFuture(string $dateTime) {
280 266
         $this->assertGreaterThan(new DateTime(), $this->parseUtc($dateTime));
281 267
     }
282 268
 }
Please login to merge, or discard this patch.
Upper-Lower-Casing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
 
15 15
 class OaiPmhTest extends FunctionalTestCase
16 16
 {
17
-    protected $disableJsonWrappedResponse = true;
17
+    protected $disableJsonWrappedResponse = TRUE;
18 18
 
19 19
     protected $coreExtensionsToLoad = [
20 20
         'fluid',
@@ -56,9 +56,9 @@  discard block
 block discarded – undo
56 56
     protected function setUpOaiSolr()
57 57
     {
58 58
         // Setup Solr only once for all tests in this suite
59
-        static $solr = null;
59
+        static $solr = NULL;
60 60
 
61
-        if ($solr === null) {
61
+        if ($solr === NULL) {
62 62
             $coreName = Solr::createCore();
63 63
             $solr = Solr::getInstance($coreName);
64 64
 
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
         $this->expectExceptionMessage('empty list');
162 162
 
163 163
         $oai = Endpoint::build($this->oaiUrl);
164
-        $result = $oai->listRecords('mets', null, (new DateTime())->setDate(1900, 1, 1));
164
+        $result = $oai->listRecords('mets', NULL, (new DateTime())->setDate(1900, 1, 1));
165 165
 
166 166
         $result->current();
167 167
     }
Please login to merge, or discard this patch.
Tests/Functional/Common/SolrIndexingTest.php 3 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -43,9 +43,9 @@  discard block
 block discarded – undo
43 43
         $this->documentRepository = $this->initializeRepository(DocumentRepository::class, 20000);
44 44
         $this->solrCoreRepository = $this->initializeRepository(SolrCoreRepository::class, 20000);
45 45
 
46
-        $this->importDataSet(__DIR__ . '/../../Fixtures/Common/documents_1.xml');
47
-        $this->importDataSet(__DIR__ . '/../../Fixtures/Common/libraries.xml');
48
-        $this->importDataSet(__DIR__ . '/../../Fixtures/Common/metadata.xml');
46
+        $this->importDataSet(__DIR__.'/../../Fixtures/Common/documents_1.xml');
47
+        $this->importDataSet(__DIR__.'/../../Fixtures/Common/libraries.xml');
48
+        $this->importDataSet(__DIR__.'/../../Fixtures/Common/metadata.xml');
49 49
     }
50 50
 
51 51
     /**
@@ -112,9 +112,9 @@  discard block
 block discarded – undo
112 112
     {
113 113
         $core = $this->createSolrCore();
114 114
 
115
-        $this->importDataSet(__DIR__ . '/../../Fixtures/Common/documents_fulltext.xml');
116
-        $this->importSolrDocuments($core->solr, __DIR__ . '/../../Fixtures/Common/documents_1.solr.json');
117
-        $this->importSolrDocuments($core->solr, __DIR__ . '/../../Fixtures/Common/documents_fulltext.solr.json');
115
+        $this->importDataSet(__DIR__.'/../../Fixtures/Common/documents_fulltext.xml');
116
+        $this->importSolrDocuments($core->solr, __DIR__.'/../../Fixtures/Common/documents_1.solr.json');
117
+        $this->importSolrDocuments($core->solr, __DIR__.'/../../Fixtures/Common/documents_fulltext.solr.json');
118 118
 
119 119
         $collections = $this->collectionRepository->findCollectionsBySettings([
120 120
             'index_name' => ['Musik', 'Projekt: Dresdner Hefte'],
Please login to merge, or discard this patch.
Braces   +4 added lines, -8 removed lines patch added patch discarded remove patch
@@ -16,8 +16,7 @@  discard block
 block discarded – undo
16 16
 use TYPO3\CMS\Extbase\Object\ObjectManager;
17 17
 use TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager;
18 18
 
19
-class SolrIndexingTest extends FunctionalTestCase
20
-{
19
+class SolrIndexingTest extends FunctionalTestCase {
21 20
     /** @var PersistenceManager */
22 21
     protected $persistenceManager;
23 22
 
@@ -51,8 +50,7 @@  discard block
 block discarded – undo
51 50
     /**
52 51
      * @test
53 52
      */
54
-    public function canCreateCore()
55
-    {
53
+    public function canCreateCore() {
56 54
         $coreName = uniqid('testCore');
57 55
         $solr = Solr::getInstance($coreName);
58 56
         $this->assertNull($solr->core);
@@ -67,8 +65,7 @@  discard block
 block discarded – undo
67 65
     /**
68 66
      * @test
69 67
      */
70
-    public function canIndexAndSearchDocument()
71
-    {
68
+    public function canIndexAndSearchDocument() {
72 69
         $core = $this->createSolrCore();
73 70
 
74 71
         $document = $this->documentRepository->findByUid(1001);
@@ -108,8 +105,7 @@  discard block
 block discarded – undo
108 105
     /**
109 106
      * @test
110 107
      */
111
-    public function canSearchInCollections()
112
-    {
108
+    public function canSearchInCollections() {
113 109
         $core = $this->createSolrCore();
114 110
 
115 111
         $this->importDataSet(__DIR__ . '/../../Fixtures/Common/documents_fulltext.xml');
Please login to merge, or discard this patch.
Upper-Lower-Casing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -86,17 +86,17 @@
 block discarded – undo
86 86
             'storagePid' => $document->getPid(),
87 87
         ];
88 88
 
89
-        $solrSearch = $this->documentRepository->findSolrByCollection(null, $solrSettings, ['query' => '*']);
89
+        $solrSearch = $this->documentRepository->findSolrByCollection(NULL, $solrSettings, ['query' => '*']);
90 90
         $solrSearch->getQuery()->execute();
91 91
         $this->assertEquals(1, count($solrSearch));
92 92
         $this->assertEquals(15, $solrSearch->getNumFound());
93 93
 
94 94
         // Check that the title stored in Solr matches the title of database entry
95
-        $docTitleInSolr = false;
95
+        $docTitleInSolr = FALSE;
96 96
         foreach ($solrSearch->getSolrResults()['documents'] as $solrDoc) {
97 97
             if ($solrDoc['toplevel'] && $solrDoc['uid'] === $document->getUid()) {
98 98
                 $this->assertEquals($document->getTitle(), $solrDoc['title']);
99
-                $docTitleInSolr = true;
99
+                $docTitleInSolr = TRUE;
100 100
                 break;
101 101
             }
102 102
         }
Please login to merge, or discard this patch.
Classes/Controller/CalendarController.php 3 patches
Braces   +6 added lines, -12 removed lines patch added patch discarded remove patch
@@ -26,8 +26,7 @@  discard block
 block discarded – undo
26 26
  * @subpackage dlf
27 27
  * @access public
28 28
  */
29
-class CalendarController extends AbstractController
30
-{
29
+class CalendarController extends AbstractController {
31 30
     /**
32 31
      * @var StructureRepository
33 32
      */
@@ -36,8 +35,7 @@  discard block
 block discarded – undo
36 35
     /**
37 36
      * @param StructureRepository $structureRepository
38 37
      */
39
-    public function injectStructureRepository(StructureRepository $structureRepository)
40
-    {
38
+    public function injectStructureRepository(StructureRepository $structureRepository) {
41 39
         $this->structureRepository = $structureRepository;
42 40
     }
43 41
 
@@ -54,8 +52,7 @@  discard block
 block discarded – undo
54 52
      *
55 53
      * @return void
56 54
      */
57
-    public function mainAction()
58
-    {
55
+    public function mainAction() {
59 56
         // Set initial document (anchor or year file) if configured.
60 57
         if (empty($this->requestData['id']) && !empty($this->settings['initialDocument'])) {
61 58
             $this->requestData['id'] = $this->settings['initialDocument'];
@@ -100,8 +97,7 @@  discard block
 block discarded – undo
100 97
      *
101 98
      * @return void
102 99
      */
103
-    public function calendarAction()
104
-    {
100
+    public function calendarAction() {
105 101
         // access arguments passed by the mainAction()
106 102
         $mainrequestData = $this->request->getArguments();
107 103
 
@@ -206,8 +202,7 @@  discard block
 block discarded – undo
206 202
      *
207 203
      * @return void
208 204
      */
209
-    public function yearsAction()
210
-    {
205
+    public function yearsAction() {
211 206
         // access arguments passed by the mainAction()
212 207
         $mainrequestData = $this->request->getArguments();
213 208
 
@@ -262,8 +257,7 @@  discard block
 block discarded – undo
262 257
      *
263 258
      * @return string Content for template subpart
264 259
      */
265
-    protected function getCalendarYear(&$calendarData, $calendarIssuesByMonth, $year, $firstMonth = 1, $lastMonth = 12)
266
-    {
260
+    protected function getCalendarYear(&$calendarData, $calendarIssuesByMonth, $year, $firstMonth = 1, $lastMonth = 12) {
267 261
         for ($i = $firstMonth; $i <= $lastMonth; $i++) {
268 262
             $key = $year . '-' . $i;
269 263
 
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
                 foreach ($year['children'] as $month) {
128 128
                     foreach ($month['children'] as $day) {
129 129
                         foreach ($day['children'] as $issue) {
130
-                            $title = $issue['label'] ?: $issue['orderlabel'];
130
+                            $title = $issue['label'] ? : $issue['orderlabel'];
131 131
                             if (strtotime($title) !== false) {
132 132
                                 $title = strftime('%x', strtotime($title));
133 133
                             }
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
                 $_day = date('j', $dateTimestamp);
172 172
                 $calendarIssuesByYear[$_year][$_month][$_day][] = $issue;
173 173
             } else {
174
-                $this->logger->warning('Document with UID ' . $issue['uid'] . 'has no valid date of publication');
174
+                $this->logger->warning('Document with UID '.$issue['uid'].'has no valid date of publication');
175 175
             }
176 176
         }
177 177
         // Sort by years.
@@ -218,8 +218,8 @@  discard block
 block discarded – undo
218 218
         $this->view->assign('calendarData', $calendarData);
219 219
         $this->view->assign('documentId', $this->document->getUid());
220 220
         $this->view->assign('yearLinkTitle', $yearLinkTitle);
221
-        $this->view->assign('parentDocumentId', $this->document->getPartof() ?: $this->document->getDoc()->tableOfContents[0]['points']);
222
-        $this->view->assign('allYearDocTitle', $this->document->getDoc()->getTitle($this->document->getPartof()) ?: $this->document->getDoc()->tableOfContents[0]['label']);
221
+        $this->view->assign('parentDocumentId', $this->document->getPartof() ? : $this->document->getDoc()->tableOfContents[0]['points']);
222
+        $this->view->assign('allYearDocTitle', $this->document->getDoc()->getTitle($this->document->getPartof()) ? : $this->document->getDoc()->tableOfContents[0]['label']);
223 223
     }
224 224
 
225 225
     /**
@@ -255,7 +255,7 @@  discard block
 block discarded – undo
255 255
 
256 256
                 if (empty($yearLabel)) {
257 257
                     // if neither order nor orderlabel is set, use the id...
258
-                    $yearLabel = (string)$id;
258
+                    $yearLabel = (string) $id;
259 259
                 }
260 260
 
261 261
                 $years[] = [
@@ -304,7 +304,7 @@  discard block
 block discarded – undo
304 304
     protected function getCalendarYear(&$calendarData, $calendarIssuesByMonth, $year, $firstMonth = 1, $lastMonth = 12)
305 305
     {
306 306
         for ($i = $firstMonth; $i <= $lastMonth; $i++) {
307
-            $key = $year . '-' . $i;
307
+            $key = $year.'-'.$i;
308 308
 
309 309
             $calendarData[$key] = [
310 310
                 'DAYMON_NAME' => strftime('%a', strtotime('last Monday')),
@@ -314,16 +314,16 @@  discard block
 block discarded – undo
314 314
                 'DAYFRI_NAME' => strftime('%a', strtotime('last Friday')),
315 315
                 'DAYSAT_NAME' => strftime('%a', strtotime('last Saturday')),
316 316
                 'DAYSUN_NAME' => strftime('%a', strtotime('last Sunday')),
317
-                'MONTHNAME'  => strftime('%B', strtotime($year . '-' . $i . '-1')) . ' ' . $year,
317
+                'MONTHNAME'  => strftime('%B', strtotime($year.'-'.$i.'-1')).' '.$year,
318 318
                 'CALYEAR' => ($i == $firstMonth) ? $year : ''
319 319
             ];
320 320
 
321
-            $firstOfMonth = strtotime($year . '-' . $i . '-1');
321
+            $firstOfMonth = strtotime($year.'-'.$i.'-1');
322 322
             $lastOfMonth = strtotime('last day of', ($firstOfMonth));
323 323
             $firstOfMonthStart = strtotime('last Monday', $firstOfMonth);
324 324
             // There are never more than 6 weeks in a month.
325 325
             for ($j = 0; $j <= 5; $j++) {
326
-                $firstDayOfWeek = strtotime('+ ' . $j . ' Week', $firstOfMonthStart);
326
+                $firstDayOfWeek = strtotime('+ '.$j.' Week', $firstOfMonthStart);
327 327
 
328 328
                 $calendarData[$key]['week'][$j] = [
329 329
                     'DAYMON' => ['dayValue' => '&nbsp;'],
@@ -336,7 +336,7 @@  discard block
 block discarded – undo
336 336
                 ];
337 337
                 // Every week has seven days. ;-)
338 338
                 for ($k = 0; $k <= 6; $k++) {
339
-                    $currentDayTime = strtotime('+ ' . $k . ' Day', $firstDayOfWeek);
339
+                    $currentDayTime = strtotime('+ '.$k.' Day', $firstDayOfWeek);
340 340
                     if (
341 341
                         $currentDayTime >= $firstOfMonth
342 342
                         && $currentDayTime <= $lastOfMonth
@@ -367,7 +367,7 @@  discard block
 block discarded – undo
367 367
                             }
368 368
                             $dayLinkDiv = $dayLinksText;
369 369
                         }
370
-                        switch (strftime('%w', strtotime('+ ' . $k . ' Day', $firstDayOfWeek))) {
370
+                        switch (strftime('%w', strtotime('+ '.$k.' Day', $firstDayOfWeek))) {
371 371
                             case '0':
372 372
                                 $calendarData[$key]['week'][$j]['DAYSUN']['dayValue'] = strftime('%d', $currentDayTime);
373 373
                                 if ((int) $dayLinks === (int) date('j', $currentDayTime)) {
Please login to merge, or discard this patch.
Upper-Lower-Casing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 
64 64
         // Load current document.
65 65
         $this->loadDocument($this->requestData);
66
-        if ($this->document === null) {
66
+        if ($this->document === NULL) {
67 67
             // Quit without doing anything if required variables are not set.
68 68
             return '';
69 69
         }
@@ -78,10 +78,10 @@  discard block
 block discarded – undo
78 78
         switch ($type) {
79 79
             case 'newspaper':
80 80
             case 'ephemera':
81
-                $this->forward('years', null, null, $this->requestData);
81
+                $this->forward('years', NULL, NULL, $this->requestData);
82 82
                 break;
83 83
             case 'year':
84
-                $this->forward('calendar', null, null, $this->requestData);
84
+                $this->forward('calendar', NULL, NULL, $this->requestData);
85 85
                 break;
86 86
             case 'issue':
87 87
             default:
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
 
111 111
         // Load current document.
112 112
         $this->loadDocument($this->requestData);
113
-        if ($this->document === null) {
113
+        if ($this->document === NULL) {
114 114
             // Quit without doing anything if required variables are not set.
115 115
             return '';
116 116
         }
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
                     foreach ($month['children'] as $day) {
129 129
                         foreach ($day['children'] as $issue) {
130 130
                             $title = $issue['label'] ?: $issue['orderlabel'];
131
-                            if (strtotime($title) !== false) {
131
+                            if (strtotime($title) !== FALSE) {
132 132
                                 $title = strftime('%x', strtotime($title));
133 133
                             }
134 134
 
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
                     $title = $document->getTitle();
150 150
                 } else {
151 151
                     $title = !empty($document->getMetsLabel()) ? $document->getMetsLabel() : $document->getMetsOrderlabel();
152
-                    if (strtotime($title) !== false) {
152
+                    if (strtotime($title) !== FALSE) {
153 153
                         $title = strftime('%x', strtotime($title));
154 154
                     }
155 155
                 }
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
         $calendarIssuesByYear = [];
166 166
         foreach ($issues as $issue) {
167 167
             $dateTimestamp = strtotime($issue['year']);
168
-            if ($dateTimestamp !== false) {
168
+            if ($dateTimestamp !== FALSE) {
169 169
                 $_year = date('Y', $dateTimestamp);
170 170
                 $_month = date('n', $dateTimestamp);
171 171
                 $_day = date('j', $dateTimestamp);
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
 
240 240
         // Load current document.
241 241
         $this->loadDocument($this->requestData);
242
-        if ($this->document === null) {
242
+        if ($this->document === NULL) {
243 243
             // Quit without doing anything if required variables are not set.
244 244
             return '';
245 245
         }
Please login to merge, or discard this patch.
Classes/Controller/View3DController.php 3 patches
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -21,13 +21,11 @@
 block discarded – undo
21 21
  * @subpackage dlf
22 22
  * @access public
23 23
  */
24
-class View3DController extends AbstractController
25
-{
24
+class View3DController extends AbstractController {
26 25
     /**
27 26
      * @return string|void
28 27
      */
29
-    public function mainAction()
30
-    {
28
+    public function mainAction() {
31 29
         $this->cObj = $this->configurationManager->getContentObject();
32 30
         // Load current document.
33 31
         $this->loadDocument($this->requestData);
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -48,8 +48,8 @@
 block discarded – undo
48 48
 
49 49
             $settingsParts = explode("/", $model);
50 50
             $fileName = end($settingsParts);
51
-            $path = substr($model, 0,  strrpos($model, $fileName));
52
-            $modelSettings = $path . "metadata/" . $fileName . "_viewer";
51
+            $path = substr($model, 0, strrpos($model, $fileName));
52
+            $modelSettings = $path."metadata/".$fileName."_viewer";
53 53
 
54 54
             if (!empty($modelConverted)) {
55 55
                 $model = $modelConverted;
Please login to merge, or discard this patch.
Upper-Lower-Casing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -33,8 +33,8 @@  discard block
 block discarded – undo
33 33
         // Load current document.
34 34
         $this->loadDocument($this->requestData);
35 35
         if (
36
-            $this->document === null
37
-            || $this->document->getDoc() === null
36
+            $this->document === NULL
37
+            || $this->document->getDoc() === NULL
38 38
             || $this->document->getDoc()->metadataArray['LOG_0001']['type'][0] != 'object'
39 39
         ) {
40 40
             // Quit without doing anything if required variables are not set.
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
             }
57 57
 
58 58
             if ($this->settings['useInternalProxy']) {
59
-                $absoluteUri = !empty($this->settings['forceAbsoluteUrl']) ? true : false;
59
+                $absoluteUri = !empty($this->settings['forceAbsoluteUrl']) ? TRUE : FALSE;
60 60
                 
61 61
                 $model = $this->uriBuilder->reset()
62 62
                     ->setTargetPageUid($GLOBALS['TSFE']->id)
Please login to merge, or discard this patch.
Classes/Format/AudioVideoMD.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -48,6 +48,6 @@
 block discarded – undo
48 48
             $metadata['video_duration'] = [$videoDuration];
49 49
         }
50 50
 
51
-        $metadata['duration'] = $metadata['video_duration'] ?: $metadata['audio_duration'] ?: [];
51
+        $metadata['duration'] = $metadata['video_duration'] ? : $metadata['audio_duration'] ? : [];
52 52
     }
53 53
 }
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -35,8 +35,7 @@
 block discarded – undo
35 35
      *
36 36
      * @return void
37 37
      */
38
-    public function extractMetadata(\SimpleXMLElement $xml, array &$metadata)
39
-    {
38
+    public function extractMetadata(\SimpleXMLElement $xml, array &$metadata) {
40 39
         $xml->registerXPathNamespace('audiomd', 'http://www.loc.gov/audioMD/');
41 40
         $xml->registerXPathNamespace('videomd', 'http://www.loc.gov/videoMD/');
42 41
 
Please login to merge, or discard this patch.