Completed
Pull Request — master (#877)
by
unknown
02:08
created
controller/RestController.php 2 patches
Doc Comments   +35 added lines patch added patch discarded remove patch
@@ -97,6 +97,9 @@  discard block
 block discarded – undo
97 97
         return $this->returnJson($ret);
98 98
     }
99 99
 
100
+    /**
101
+     * @param Request $request
102
+     */
100 103
     private function constructSearchParameters($request)
101 104
     {
102 105
         $parameters = new ConceptSearchParameters($request, $this->model->getConfig(), true);
@@ -112,6 +115,10 @@  discard block
 block discarded – undo
112 115
         return $parameters;
113 116
     }
114 117
 
118
+    /**
119
+     * @param Request $request
120
+     * @param ConceptSearchParameters $parameters
121
+     */
115 122
     private function transformSearchResults($request, $results, $parameters)
116 123
     {
117 124
         // before serializing to JSON, get rid of the Vocabulary object that came with each resource
@@ -407,6 +414,10 @@  discard block
 block discarded – undo
407 414
         return $this->returnJson($ret);
408 415
     }
409 416
 
417
+    /**
418
+     * @param string $label
419
+     * @param string $lang
420
+     */
410 421
     private function findLookupHits($results, $label, $lang)
411 422
     {
412 423
         $hits = array();
@@ -468,6 +479,9 @@  discard block
 block discarded – undo
468 479
         return $hits;
469 480
     }
470 481
 
482
+    /**
483
+     * @param string $lang
484
+     */
471 485
     private function transformLookupResults($lang, $hits)
472 486
     {
473 487
         if (sizeof($hits) == 0) {
@@ -539,6 +553,9 @@  discard block
 block discarded – undo
539 553
         return $this->returnJson($ret);
540 554
     }
541 555
 
556
+    /**
557
+     * @param Request $request
558
+     */
542 559
     private function redirectToVocabData($request) {
543 560
         $urls = $request->getVocab()->getConfig()->getDataURLs();
544 561
         if (sizeof($urls) == 0) {
@@ -564,6 +581,10 @@  discard block
 block discarded – undo
564 581
 		}
565 582
     }
566 583
 
584
+    /**
585
+     * @param string $results
586
+     * @param string $format
587
+     */
567 588
     private function returnDataResults($results, $format) {
568 589
         if ($format == 'application/ld+json' || $format == 'application/json') {
569 590
             // further compact JSON-LD document using a context
@@ -693,6 +714,12 @@  discard block
 block discarded – undo
693 714
         return $this->returnJson($ret);
694 715
     }
695 716
 
717
+    /**
718
+     * @param string $uri
719
+     * @param string $lang
720
+     * @param string $propname
721
+     * @param string $propuri
722
+     */
696 723
     private function transformPropertyResults($uri, $lang, $objects, $propname, $propuri)
697 724
     {
698 725
         $results = array();
@@ -708,6 +735,14 @@  discard block
 block discarded – undo
708 735
         return $ret;
709 736
     }
710 737
 
738
+    /**
739
+     * @param string $uri
740
+     * @param string $lang
741
+     * @param string $tpropname
742
+     * @param string $tpropuri
743
+     * @param string $dpropname
744
+     * @param string $dpropuri
745
+     */
711 746
     private function transformTransitivePropertyResults($uri, $lang, $objects, $tpropname, $tpropuri, $dpropname, $dpropuri)
712 747
     {
713 748
         $results = array();
Please login to merge, or discard this patch.
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -550,18 +550,18 @@
 block discarded – undo
550 550
         if (!$format) {
551 551
             return $this->returnError(406, 'Not Acceptable', "Unsupported format. Supported MIME types are: " . implode(' ', array_keys($urls)));
552 552
         }
553
-		if (is_array($urls[$format])) {
554
-			$arr = $urls[$format];
555
-			$dataLang = $request->getLang();
556
-			if (isset($arr[$dataLang])) {
553
+    if (is_array($urls[$format])) {
554
+      $arr = $urls[$format];
555
+      $dataLang = $request->getLang();
556
+      if (isset($arr[$dataLang])) {
557 557
                 header("Location: " . $arr[$dataLang]);
558
-			} else {
559
-				$vocid = $request->getVocab()->getId();
560
-				return $this->returnError('404', 'Not Found', "No download source URL known for vocabulary $vocid in language $dataLang");
561
-			}
562
-		} else {
558
+      } else {
559
+        $vocid = $request->getVocab()->getId();
560
+        return $this->returnError('404', 'Not Found', "No download source URL known for vocabulary $vocid in language $dataLang");
561
+      }
562
+    } else {
563 563
             header("Location: " . $urls[$format]);
564
-		}
564
+    }
565 565
     }
566 566
 
567 567
     private function returnDataResults($results, $format) {
Please login to merge, or discard this patch.