Passed
Pull Request — master (#15)
by
unknown
04:23
created
Classes/Plugin/OaiPmh.php 3 patches
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
         // Delete expired resumption tokens.
83 83
         $GLOBALS['TYPO3_DB']->exec_DELETEquery(
84 84
             'tx_dlf_tokens',
85
-            'tx_dlf_tokens.ident="oai" AND tx_dlf_tokens.tstamp<' . intval($GLOBALS['EXEC_TIME'] - $this->conf['expired'])
85
+            'tx_dlf_tokens.ident="oai" AND tx_dlf_tokens.tstamp<'.intval($GLOBALS['EXEC_TIME'] - $this->conf['expired'])
86 86
         );
87 87
         if ($GLOBALS['TYPO3_DB']->sql_affected_rows() === -1) {
88 88
             // Deletion failed.
@@ -150,13 +150,13 @@  discard block
 block discarded – undo
150 150
         $oai_dc = $this->oai->createElementNS($this->formats['oai_dc']['namespace'], 'oai_dc:dc');
151 151
         $oai_dc->setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:dc', 'http://purl.org/dc/elements/1.1/');
152 152
         $oai_dc->setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:xsi', 'http://www.w3.org/2001/XMLSchema-instance');
153
-        $oai_dc->setAttributeNS('http://www.w3.org/2001/XMLSchema-instance', 'xsi:schemaLocation', $this->formats['oai_dc']['namespace'] . ' ' . $this->formats['oai_dc']['schema']);
153
+        $oai_dc->setAttributeNS('http://www.w3.org/2001/XMLSchema-instance', 'xsi:schemaLocation', $this->formats['oai_dc']['namespace'].' '.$this->formats['oai_dc']['schema']);
154 154
         $oai_dc->appendChild($this->oai->createElementNS('http://purl.org/dc/elements/1.1/', 'dc:identifier', htmlspecialchars($metadata['record_id'], ENT_NOQUOTES, 'UTF-8')));
155 155
         if (!empty($metadata['purl'])) {
156 156
             $oai_dc->appendChild($this->oai->createElementNS('http://purl.org/dc/elements/1.1/', 'dc:identifier', htmlspecialchars($metadata['purl'], ENT_NOQUOTES, 'UTF-8')));
157 157
         }
158 158
         if (!empty($metadata['prod_id'])) {
159
-            $oai_dc->appendChild($this->oai->createElementNS('http://purl.org/dc/elements/1.1/', 'dc:identifier', 'kitodo:production:' . htmlspecialchars($metadata['prod_id'], ENT_NOQUOTES, 'UTF-8')));
159
+            $oai_dc->appendChild($this->oai->createElementNS('http://purl.org/dc/elements/1.1/', 'dc:identifier', 'kitodo:production:'.htmlspecialchars($metadata['prod_id'], ENT_NOQUOTES, 'UTF-8')));
160 160
         }
161 161
         if (!empty($metadata['urn'])) {
162 162
             $oai_dc->appendChild($this->oai->createElementNS('http://purl.org/dc/elements/1.1/', 'dc:identifier', htmlspecialchars($metadata['urn'], ENT_NOQUOTES, 'UTF-8')));
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
         }
254 254
         // Add attributes and build XML tree.
255 255
         $epicur->setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:xsi', 'http://www.w3.org/2001/XMLSchema-instance');
256
-        $epicur->setAttributeNS('http://www.w3.org/2001/XMLSchema-instance', 'xsi:schemaLocation', $this->formats['epicur']['namespace'] . ' ' . $this->formats['epicur']['schema']);
256
+        $epicur->setAttributeNS('http://www.w3.org/2001/XMLSchema-instance', 'xsi:schemaLocation', $this->formats['epicur']['namespace'].' '.$this->formats['epicur']['schema']);
257 257
         // Do we update an URN or register a new one?
258 258
         if ($metadata['tstamp'] == $metadata['crdate']) {
259 259
             $update->setAttribute('type', 'urn_new');
@@ -300,10 +300,10 @@  discard block
 block discarded – undo
300 300
                 // Import node into \DOMDocument.
301 301
                 $mets = $this->oai->importNode($root->item(0), true);
302 302
             } else {
303
-                Helper::devLog('No METS part found in document with location "' . $metadata['location'] . '"', DEVLOG_SEVERITY_ERROR);
303
+                Helper::devLog('No METS part found in document with location "'.$metadata['location'].'"', DEVLOG_SEVERITY_ERROR);
304 304
             }
305 305
         } else {
306
-            Helper::devLog('Could not load XML file from "' . $metadata['location'] . '"', DEVLOG_SEVERITY_ERROR);
306
+            Helper::devLog('Could not load XML file from "'.$metadata['location'].'"', DEVLOG_SEVERITY_ERROR);
307 307
         }
308 308
         if ($mets === null) {
309 309
             $mets = $this->oai->createElementNS('http://kitodo.org/', 'kitodo:error', htmlspecialchars($this->pi_getLL('error', 'Error!', false), ENT_NOQUOTES, 'UTF-8'));
@@ -339,15 +339,15 @@  discard block
 block discarded – undo
339 339
             if (substr($this->conf['stylesheet'], 0, 4) == 'EXT:') {
340 340
                 list($extKey, $filePath) = explode('/', substr($this->conf['stylesheet'], 4), 2);
341 341
                 if (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded($extKey)) {
342
-                    $this->conf['stylesheet'] = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath($extKey) . $filePath;
342
+                    $this->conf['stylesheet'] = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath($extKey).$filePath;
343 343
                 }
344 344
             }
345 345
             $stylesheet = \TYPO3\CMS\Core\Utility\GeneralUtility::locationHeaderUrl($this->conf['stylesheet']);
346 346
         } else {
347 347
             // Use default stylesheet if no custom stylesheet is given.
348
-            $stylesheet = \TYPO3\CMS\Core\Utility\GeneralUtility::locationHeaderUrl(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath($this->extKey) . 'Resources/Public/Stylesheets/OaiPmh.xsl');
348
+            $stylesheet = \TYPO3\CMS\Core\Utility\GeneralUtility::locationHeaderUrl(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath($this->extKey).'Resources/Public/Stylesheets/OaiPmh.xsl');
349 349
         }
350
-        $this->oai->appendChild($this->oai->createProcessingInstruction('xml-stylesheet', 'type="text/xsl" href="' . htmlspecialchars($stylesheet, ENT_NOQUOTES, 'UTF-8') . '"'));
350
+        $this->oai->appendChild($this->oai->createProcessingInstruction('xml-stylesheet', 'type="text/xsl" href="'.htmlspecialchars($stylesheet, ENT_NOQUOTES, 'UTF-8').'"'));
351 351
         // Create root element.
352 352
         $root = $this->oai->createElementNS('http://www.openarchives.org/OAI/2.0/', 'OAI-PMH');
353 353
         $root->setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:xsi', 'http://www.w3.org/2001/XMLSchema-instance');
@@ -397,10 +397,10 @@  discard block
 block discarded – undo
397 397
         // Send headers.
398 398
         header('HTTP/1.1 200 OK');
399 399
         header('Cache-Control: no-cache');
400
-        header('Content-Length: ' . strlen($content));
400
+        header('Content-Length: '.strlen($content));
401 401
         header('Content-Type: text/xml; charset=utf-8');
402
-        header('Date: ' . date('r', $GLOBALS['EXEC_TIME']));
403
-        header('Expires: ' . date('r', $GLOBALS['EXEC_TIME'] + $this->conf['expired']));
402
+        header('Date: '.date('r', $GLOBALS['EXEC_TIME']));
403
+        header('Expires: '.date('r', $GLOBALS['EXEC_TIME'] + $this->conf['expired']));
404 404
         echo $content;
405 405
         exit;
406 406
     }
@@ -464,10 +464,10 @@  discard block
 block discarded – undo
464 464
             'tx_dlf_documents',
465 465
             'tx_dlf_relations',
466 466
             'tx_dlf_collections',
467
-            'AND tx_dlf_documents.record_id=' . $GLOBALS['TYPO3_DB']->fullQuoteStr($this->piVars['identifier'], 'tx_dlf_documents')
468
-                . ' AND tx_dlf_documents.pid=' . intval($this->conf['pages'])
469
-                . ' AND tx_dlf_collections.pid=' . intval($this->conf['pages'])
470
-                . ' AND tx_dlf_relations.ident=' . $GLOBALS['TYPO3_DB']->fullQuoteStr('docs_colls', 'tx_dlf_relations')
467
+            'AND tx_dlf_documents.record_id='.$GLOBALS['TYPO3_DB']->fullQuoteStr($this->piVars['identifier'], 'tx_dlf_documents')
468
+                . ' AND tx_dlf_documents.pid='.intval($this->conf['pages'])
469
+                . ' AND tx_dlf_collections.pid='.intval($this->conf['pages'])
470
+                . ' AND tx_dlf_relations.ident='.$GLOBALS['TYPO3_DB']->fullQuoteStr('docs_colls', 'tx_dlf_relations')
471 471
                 . $where
472 472
                 . Helper::whereClause('tx_dlf_collections'),
473 473
             '',
@@ -584,7 +584,7 @@  discard block
 block discarded – undo
584 584
             $timestamp = $resArray['tstamp'];
585 585
             $earliestDatestamp = gmdate('Y-m-d\TH:i:s\Z', $timestamp);
586 586
         } else {
587
-            Helper::devLog('No records found with PID ' . $this->conf['pages'], DEVLOG_SEVERITY_NOTICE);
587
+            Helper::devLog('No records found with PID '.$this->conf['pages'], DEVLOG_SEVERITY_NOTICE);
588 588
         }
589 589
         $linkConf = [
590 590
             'parameter' => $GLOBALS['TSFE']->id,
@@ -844,9 +844,9 @@  discard block
 block discarded – undo
844 844
             }
845 845
             $resArray = $allResults[0];
846 846
             if ($resArray['index_query'] != "") {
847
-                $solr_query .= '(' . $resArray['index_query'] . ')';
847
+                $solr_query .= '('.$resArray['index_query'].')';
848 848
             } else {
849
-                $solr_query .= 'collection:' . '"' . $resArray['index_name'] . '"';
849
+                $solr_query .= 'collection:'.'"'.$resArray['index_name'].'"';
850 850
             }
851 851
         } else {
852 852
             // If no set is specified we have to query for all collections
@@ -854,7 +854,7 @@  discard block
 block discarded – undo
854 854
         }
855 855
         // Check for required fields.
856 856
         foreach ($this->formats[$this->piVars['metadataPrefix']]['requiredFields'] as $required) {
857
-            $solr_query .= ' NOT ' . $required . ':""';
857
+            $solr_query .= ' NOT '.$required.':""';
858 858
         }
859 859
         // toplevel="true" is always required
860 860
         $solr_query .= ' AND toplevel:true';
@@ -867,7 +867,7 @@  discard block
 block discarded – undo
867 867
                 || is_array($date_array = strptime($this->piVars['from'], '%Y-%m-%d'))
868 868
             ) {
869 869
                 $timestamp = gmmktime($date_array['tm_hour'], $date_array['tm_min'], $date_array['tm_sec'], $date_array['tm_mon'] + 1, $date_array['tm_mday'], $date_array['tm_year'] + 1900);
870
-                $from = date("Y-m-d", $timestamp) . 'T' . date("H:i:s", $timestamp) . '.000Z';
870
+                $from = date("Y-m-d", $timestamp).'T'.date("H:i:s", $timestamp).'.000Z';
871 871
             } else {
872 872
                 throw new \Exception('badArgument');
873 873
             }
@@ -881,7 +881,7 @@  discard block
 block discarded – undo
881 881
                 || is_array($date_array = strptime($this->piVars['until'], '%Y-%m-%d'))
882 882
             ) {
883 883
                 $timestamp = gmmktime($date_array['tm_hour'], $date_array['tm_min'], $date_array['tm_sec'], $date_array['tm_mon'] + 1, $date_array['tm_mday'], $date_array['tm_year'] + 1900);
884
-                $until = date("Y-m-d", $timestamp) . 'T' . date("H:i:s", $timestamp) . '.999Z';
884
+                $until = date("Y-m-d", $timestamp).'T'.date("H:i:s", $timestamp).'.999Z';
885 885
                 if ($from != "*" && $from > $until) {
886 886
                     throw new \Exception('badArgument');
887 887
                 }
@@ -898,7 +898,7 @@  discard block
 block discarded – undo
898 898
                 throw new \Exception('badArgument');
899 899
             }
900 900
         }
901
-        $solr_query .= ' AND timestamp:[' . $from . ' TO ' . $until . ']';
901
+        $solr_query .= ' AND timestamp:['.$from.' TO '.$until.']';
902 902
         $documentSet = [];
903 903
         $solr = Solr::getInstance($this->conf['solrcore']);
904 904
         if (intval($this->conf['solr_limit']) > 0) {
@@ -938,10 +938,10 @@  discard block
 block discarded – undo
938 938
             'tx_dlf_documents',
939 939
             'tx_dlf_relations',
940 940
             'tx_dlf_collections',
941
-            'AND tx_dlf_documents.uid IN (' . implode(',', $GLOBALS['TYPO3_DB']->cleanIntArray($documentsToProcess)) . ')'
942
-                . ' AND tx_dlf_documents.pid=' . intval($this->conf['pages'])
943
-                . ' AND tx_dlf_collections.pid=' . intval($this->conf['pages'])
944
-                . ' AND tx_dlf_relations.ident=' . $GLOBALS['TYPO3_DB']->fullQuoteStr('docs_colls', 'tx_dlf_relations')
941
+            'AND tx_dlf_documents.uid IN ('.implode(',', $GLOBALS['TYPO3_DB']->cleanIntArray($documentsToProcess)).')'
942
+                . ' AND tx_dlf_documents.pid='.intval($this->conf['pages'])
943
+                . ' AND tx_dlf_collections.pid='.intval($this->conf['pages'])
944
+                . ' AND tx_dlf_relations.ident='.$GLOBALS['TYPO3_DB']->fullQuoteStr('docs_colls', 'tx_dlf_relations')
945 945
                 . Helper::whereClause('tx_dlf_collections'),
946 946
             'tx_dlf_documents.uid',
947 947
             'tx_dlf_documents.tstamp',
Please login to merge, or discard this patch.
Braces   +18 added lines, -36 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 OaiPmh extends \Kitodo\Dlf\Common\AbstractPlugin
30
-{
29
+class OaiPmh extends \Kitodo\Dlf\Common\AbstractPlugin {
31 30
     public $scriptRelPath = 'Classes/Plugin/OaiPmh.php';
32 31
 
33 32
     /**
@@ -77,8 +76,7 @@  discard block
 block discarded – undo
77 76
      *
78 77
      * @return void
79 78
      */
80
-    protected function deleteExpiredTokens()
81
-    {
79
+    protected function deleteExpiredTokens() {
82 80
         // Delete expired resumption tokens.
83 81
         $GLOBALS['TYPO3_DB']->exec_DELETEquery(
84 82
             'tx_dlf_tokens',
@@ -99,8 +97,7 @@  discard block
 block discarded – undo
99 97
      *
100 98
      * @return \DOMElement XML node to add to the OAI response
101 99
      */
102
-    protected function error($type)
103
-    {
100
+    protected function error($type) {
104 101
         $this->error = true;
105 102
         $error = $this->oai->createElementNS('http://www.openarchives.org/OAI/2.0/', 'error', htmlspecialchars($this->pi_getLL($type, $type, false), ENT_NOQUOTES, 'UTF-8'));
106 103
         $error->setAttribute('code', $type);
@@ -114,8 +111,7 @@  discard block
 block discarded – undo
114 111
      *
115 112
      * @return void
116 113
      */
117
-    protected function getUrlParams()
118
-    {
114
+    protected function getUrlParams() {
119 115
         $allowedParams = [
120 116
             'verb',
121 117
             'identifier',
@@ -145,8 +141,7 @@  discard block
 block discarded – undo
145 141
      *
146 142
      * @return \DOMElement XML node to add to the OAI response
147 143
      */
148
-    protected function getDcData(array $metadata)
149
-    {
144
+    protected function getDcData(array $metadata) {
150 145
         $oai_dc = $this->oai->createElementNS($this->formats['oai_dc']['namespace'], 'oai_dc:dc');
151 146
         $oai_dc->setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:dc', 'http://purl.org/dc/elements/1.1/');
152 147
         $oai_dc->setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:xsi', 'http://www.w3.org/2001/XMLSchema-instance');
@@ -224,8 +219,7 @@  discard block
 block discarded – undo
224 219
      *
225 220
      * @return \DOMElement XML node to add to the OAI response
226 221
      */
227
-    protected function getEpicurData(array $metadata)
228
-    {
222
+    protected function getEpicurData(array $metadata) {
229 223
         // Define all XML elements with or without qualified namespace.
230 224
         if (empty($this->conf['unqualified_epicur'])) {
231 225
             $epicur = $this->oai->createElementNS($this->formats['epicur']['namespace'], 'epicur:epicur');
@@ -288,8 +282,7 @@  discard block
 block discarded – undo
288 282
      *
289 283
      * @return \DOMElement XML node to add to the OAI response
290 284
      */
291
-    protected function getMetsData(array $metadata)
292
-    {
285
+    protected function getMetsData(array $metadata) {
293 286
         $mets = null;
294 287
         // Load METS file.
295 288
         $xml = new \DOMDocument();
@@ -321,8 +314,7 @@  discard block
 block discarded – undo
321 314
      *
322 315
      * @return void
323 316
      */
324
-    public function main($content, $conf)
325
-    {
317
+    public function main($content, $conf) {
326 318
         // Initialize plugin.
327 319
         $this->init($conf);
328 320
         // Turn cache off.
@@ -412,8 +404,7 @@  discard block
 block discarded – undo
412 404
      *
413 405
      * @return \DOMElement XML node to add to the OAI response
414 406
      */
415
-    protected function resume()
416
-    {
407
+    protected function resume() {
417 408
         $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
418 409
             ->getQueryBuilderForTable('tx_dlf_tokens');
419 410
 
@@ -447,8 +438,7 @@  discard block
 block discarded – undo
447 438
      *
448 439
      * @return \DOMElement XML node to add to the OAI response
449 440
      */
450
-    protected function verbGetRecord()
451
-    {
441
+    protected function verbGetRecord() {
452 442
         if (count($this->piVars) != 3 || empty($this->piVars['metadataPrefix']) || empty($this->piVars['identifier'])) {
453 443
             return $this->error('badArgument');
454 444
         }
@@ -527,8 +517,7 @@  discard block
 block discarded – undo
527 517
      *
528 518
      * @return \DOMElement XML node to add to the OAI response
529 519
      */
530
-    protected function verbIdentify()
531
-    {
520
+    protected function verbIdentify() {
532 521
         // Check for invalid arguments.
533 522
         if (count($this->piVars) > 1) {
534 523
             return $this->error('badArgument');
@@ -610,8 +599,7 @@  discard block
 block discarded – undo
610 599
      *
611 600
      * @return \DOMElement XML node to add to the OAI response
612 601
      */
613
-    protected function verbListIdentifiers()
614
-    {
602
+    protected function verbListIdentifiers() {
615 603
         // If we have a resumption token we can continue our work
616 604
         if (!empty($this->piVars['resumptionToken'])) {
617 605
             // "resumptionToken" is an exclusive argument.
@@ -650,8 +638,7 @@  discard block
 block discarded – undo
650 638
      *
651 639
      * @return \DOMElement XML node to add to the OAI response
652 640
      */
653
-    protected function verbListMetadataFormats()
654
-    {
641
+    protected function verbListMetadataFormats() {
655 642
         $resArray = [];
656 643
         // Check for invalid arguments.
657 644
         if (count($this->piVars) > 1) {
@@ -709,8 +696,7 @@  discard block
 block discarded – undo
709 696
      *
710 697
      * @return \DOMElement XML node to add to the OAI response
711 698
      */
712
-    protected function verbListRecords()
713
-    {
699
+    protected function verbListRecords() {
714 700
         // Check for invalid arguments.
715 701
         if (!empty($this->piVars['resumptionToken'])) {
716 702
             // "resumptionToken" is an exclusive argument.
@@ -750,8 +736,7 @@  discard block
 block discarded – undo
750 736
      *
751 737
      * @return \DOMElement XML node to add to the OAI response
752 738
      */
753
-    protected function verbListSets()
754
-    {
739
+    protected function verbListSets() {
755 740
         $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
756 741
             ->getQueryBuilderForTable('tx_dlf_collections');
757 742
 
@@ -807,8 +792,7 @@  discard block
 block discarded – undo
807 792
      * @return array Array of matching records
808 793
      * @throws \Exception
809 794
      */
810
-    protected function fetchDocumentUIDs()
811
-    {
795
+    protected function fetchDocumentUIDs() {
812 796
         $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
813 797
             ->getQueryBuilderForTable('tx_dlf_collections');
814 798
 
@@ -929,8 +913,7 @@  discard block
 block discarded – undo
929 913
      *
930 914
      * @return \DOMElement XML of enriched records
931 915
      */
932
-    protected function generateOutputForDocumentList(DocumentList $documentListSet)
933
-    {
916
+    protected function generateOutputForDocumentList(DocumentList $documentListSet) {
934 917
         $documentsToProcess = $documentListSet->removeRange(0, intval($this->conf['limit']));
935 918
         $verb = $this->piVars['verb'];
936 919
         $documents = $GLOBALS['TYPO3_DB']->exec_SELECT_mm_query(
@@ -1016,8 +999,7 @@  discard block
 block discarded – undo
1016 999
      *
1017 1000
      * @return \DOMElement XML for resumption token
1018 1001
      */
1019
-    protected function generateResumptionTokenForDocumentListSet(DocumentList $documentListSet)
1020
-    {
1002
+    protected function generateResumptionTokenForDocumentListSet(DocumentList $documentListSet) {
1021 1003
         if ($documentListSet->count() != 0) {
1022 1004
             $token = uniqid();
1023 1005
             $GLOBALS['TYPO3_DB']->exec_INSERTquery(
Please login to merge, or discard this patch.
Upper-Lower-Casing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
      * @var bool
37 37
      * @access protected
38 38
      */
39
-    protected $error = false;
39
+    protected $error = FALSE;
40 40
 
41 41
     /**
42 42
      * This holds the OAI DOM object
@@ -101,8 +101,8 @@  discard block
 block discarded – undo
101 101
      */
102 102
     protected function error($type)
103 103
     {
104
-        $this->error = true;
105
-        $error = $this->oai->createElementNS('http://www.openarchives.org/OAI/2.0/', 'error', htmlspecialchars($this->pi_getLL($type, $type, false), ENT_NOQUOTES, 'UTF-8'));
104
+        $this->error = TRUE;
105
+        $error = $this->oai->createElementNS('http://www.openarchives.org/OAI/2.0/', 'error', htmlspecialchars($this->pi_getLL($type, $type, FALSE), ENT_NOQUOTES, 'UTF-8'));
106 106
         $error->setAttribute('code', $type);
107 107
         return $error;
108 108
     }
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
      */
291 291
     protected function getMetsData(array $metadata)
292 292
     {
293
-        $mets = null;
293
+        $mets = NULL;
294 294
         // Load METS file.
295 295
         $xml = new \DOMDocument();
296 296
         if ($xml->load($metadata['location'])) {
@@ -298,15 +298,15 @@  discard block
 block discarded – undo
298 298
             $root = $xml->getElementsByTagNameNS($this->formats['mets']['namespace'], 'mets');
299 299
             if ($root->item(0) instanceof \DOMNode) {
300 300
                 // Import node into \DOMDocument.
301
-                $mets = $this->oai->importNode($root->item(0), true);
301
+                $mets = $this->oai->importNode($root->item(0), TRUE);
302 302
             } else {
303 303
                 Helper::devLog('No METS part found in document with location "' . $metadata['location'] . '"', DEVLOG_SEVERITY_ERROR);
304 304
             }
305 305
         } else {
306 306
             Helper::devLog('Could not load XML file from "' . $metadata['location'] . '"', DEVLOG_SEVERITY_ERROR);
307 307
         }
308
-        if ($mets === null) {
309
-            $mets = $this->oai->createElementNS('http://kitodo.org/', 'kitodo:error', htmlspecialchars($this->pi_getLL('error', 'Error!', false), ENT_NOQUOTES, 'UTF-8'));
308
+        if ($mets === NULL) {
309
+            $mets = $this->oai->createElementNS('http://kitodo.org/', 'kitodo:error', htmlspecialchars($this->pi_getLL('error', 'Error!', FALSE), ENT_NOQUOTES, 'UTF-8'));
310 310
         }
311 311
         return $mets;
312 312
     }
@@ -326,7 +326,7 @@  discard block
 block discarded – undo
326 326
         // Initialize plugin.
327 327
         $this->init($conf);
328 328
         // Turn cache off.
329
-        $this->setCache(false);
329
+        $this->setCache(FALSE);
330 330
         // Get GET and POST variables.
331 331
         $this->getUrlParams();
332 332
         // Delete expired resumption tokens.
Please login to merge, or discard this patch.