Completed
Push — master ( 9ce988...4489b9 )
by Henri
09:55 queued 06:00
created
model/Request.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -167,9 +167,11 @@
 block discarded – undo
167 167
      */
168 168
     public function setVocab($vocabid)
169 169
     {
170
-        if (strpos($vocabid, ' ') !== false) // if there are multiple vocabularies just storing the string
170
+        if (strpos($vocabid, ' ') !== false) {
171
+          // if there are multiple vocabularies just storing the string
171 172
         {
172 173
             $this->setVocabids($vocabid);
174
+        }
173 175
         } else {
174 176
             $this->vocab = $this->model->getVocabulary($vocabid);
175 177
         }
Please login to merge, or discard this patch.
model/Vocabulary.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -76,10 +76,12 @@
 block discarded – undo
76 76
      */
77 77
     public function getUriSpace()
78 78
     {
79
-        if ($this->urispace === null) // initialize cache
79
+        if ($this->urispace === null) {
80
+          // initialize cache
80 81
         {
81 82
             $this->urispace = $this->resource->getLiteral('void:uriSpace')->getValue();
82 83
         }
84
+        }
83 85
 
84 86
         return $this->urispace;
85 87
     }
Please login to merge, or discard this patch.
model/ConceptSearchParameters.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -67,8 +67,9 @@
 block discarded – undo
67 67
     public function getSearchTerm() 
68 68
     {
69 69
         $term = $this->request->getQueryParam('q') ? $this->request->getQueryParam('q') : $this->request->getQueryParam('query');
70
-        if (!$term && $this->rest)
71
-            $term = $this->request->getQueryParam('label');
70
+        if (!$term && $this->rest) {
71
+                    $term = $this->request->getQueryParam('label');
72
+        }
72 73
         $term = trim($term); // surrounding whitespace is not considered significant
73 74
         return strpos($term, "*") === false ? $term . "*" : $term; // default to prefix search
74 75
     }
Please login to merge, or discard this patch.
model/VocabularyCategory.php 1 patch
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -10,6 +10,9 @@
 block discarded – undo
10 10
  */
11 11
 class VocabularyCategory extends DataObject
12 12
 {
13
+    /**
14
+     * @param Model $model
15
+     */
13 16
     public function __construct($model, $resource)
14 17
     {
15 18
         if (!($model instanceof Model)) {
Please login to merge, or discard this patch.
model/GlobalConfig.php 1 patch
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -23,6 +23,9 @@
 block discarded – undo
23 23
         }
24 24
     }
25 25
     
26
+    /**
27
+     * @param string $name
28
+     */
26 29
     private function getConstant($name, $default)
27 30
     {
28 31
         if (defined($name) && constant($name)) {
Please login to merge, or discard this patch.
model/DataObject.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -68,10 +68,12 @@
 block discarded – undo
68 68
         if ($sortable !== null) {
69 69
             uksort($sortable, array($this, 'mycompare'));
70 70
             foreach ($sortable as $prop => $vals) {
71
-                if (is_array($prop)) // the ConceptProperty objects have their own sorting methods
71
+                if (is_array($prop)) {
72
+                  // the ConceptProperty objects have their own sorting methods
72 73
                 {
73 74
                     ksort($sortable[$prop]);
74 75
                 }
76
+                }
75 77
 
76 78
             }
77 79
         }
Please login to merge, or discard this patch.
model/Concept.php 1 patch
Doc Comments   +2 added lines patch added patch discarded remove patch
@@ -55,6 +55,7 @@  discard block
 block discarded – undo
55 55
      * @param Vocabulary $vocab
56 56
      * @param EasyRdf_Resource $resource
57 57
      * @param EasyRdf_Graph $graph
58
+     * @param string|null $clang
58 59
      */
59 60
     public function __construct($model, $vocab, $resource, $graph, $clang)
60 61
     {
@@ -512,6 +513,7 @@  discard block
 block discarded – undo
512 513
 
513 514
     /**
514 515
      * Gets the groups/arrays the concept belongs to.
516
+     * @param boolean $includeArrays
515 517
      */
516 518
     public function getReverseResources($includeArrays) {
517 519
         $groups = array();
Please login to merge, or discard this patch.
controller/RestController.php 2 patches
Doc Comments   +26 added lines patch added patch discarded remove patch
@@ -114,6 +114,9 @@  discard block
 block discarded – undo
114 114
         return $this->returnJson($ret);
115 115
     }
116 116
     
117
+    /**
118
+     * @param Request $request
119
+     */
117 120
     private function constructSearchParameters($request)
118 121
     {
119 122
         $parameters = new ConceptSearchParameters($request, $this->model->getConfig(), true);
@@ -129,6 +132,9 @@  discard block
 block discarded – undo
129 132
         return $parameters;    
130 133
     }
131 134
 
135
+    /**
136
+     * @param Request $request
137
+     */
132 138
     private function transformSearchResults($request, $results)
133 139
     {
134 140
         // before serializing to JSON, get rid of the Vocabulary object that came with each resource
@@ -504,6 +510,9 @@  discard block
 block discarded – undo
504 510
         return $this->returnJson($ret);
505 511
     }
506 512
 
513
+    /**
514
+     * @param Request $request
515
+     */
507 516
     private function redirectToVocabData($request) {
508 517
         $urls = $request->getVocab()->getConfig()->getDataURLs();
509 518
         if (sizeof($urls) == 0) {
@@ -519,6 +528,9 @@  discard block
 block discarded – undo
519 528
         header("Location: " . $urls[$format]);
520 529
     }
521 530
     
531
+    /**
532
+     * @param string $format
533
+     */
522 534
     private function returnDataResults($results, $format) {
523 535
         if ($format == 'application/ld+json' || $format == 'application/json') {
524 536
             // further compact JSON-LD document using a context
@@ -606,6 +618,12 @@  discard block
 block discarded – undo
606 618
         return $this->returnJson($ret);
607 619
     }
608 620
     
621
+    /**
622
+     * @param string $uri
623
+     * @param string $lang
624
+     * @param string $propname
625
+     * @param string $propuri
626
+     */
609 627
     private function transformPropertyResults($uri, $lang, $objects, $propname, $propuri)
610 628
     {
611 629
         foreach ($objects as $objuri => $vals) {
@@ -620,6 +638,14 @@  discard block
 block discarded – undo
620 638
         return $ret;    
621 639
     }
622 640
     
641
+    /**
642
+     * @param string $uri
643
+     * @param string $lang
644
+     * @param string $tpropname
645
+     * @param string $tpropuri
646
+     * @param string $dpropname
647
+     * @param string $dpropuri
648
+     */
623 649
     private function transformTransitivePropertyResults($uri, $lang, $objects, $tpropname, $tpropuri, $dpropname, $dpropuri)
624 650
     {
625 651
         $results = array();
Please login to merge, or discard this patch.
Braces   +18 added lines, -6 removed lines patch added patch discarded remove patch
@@ -387,7 +387,9 @@  discard block
 block discarded – undo
387 387
                 $hits[] = $res;
388 388
             }
389 389
         }
390
-        if (sizeof($hits) > 0) return $hits;
390
+        if (sizeof($hits) > 0) {
391
+          return $hits;
392
+        }
391 393
 
392 394
         // case 2: case-insensitive match on preferred label
393 395
         foreach ($results as $res) {
@@ -395,7 +397,9 @@  discard block
 block discarded – undo
395 397
                 $hits[] = $res;
396 398
             }
397 399
         }
398
-        if (sizeof($hits) > 0) return $hits;
400
+        if (sizeof($hits) > 0) {
401
+          return $hits;
402
+        }
399 403
         
400 404
         if ($lang === null) {
401 405
             // case 1A: exact match on preferred label in any language
@@ -406,7 +410,9 @@  discard block
 block discarded – undo
406 410
                     $hits[] = $res;
407 411
                 }
408 412
             }
409
-            if (sizeof($hits) > 0) return $hits;
413
+            if (sizeof($hits) > 0) {
414
+              return $hits;
415
+            }
410 416
             
411 417
             // case 2A: case-insensitive match on preferred label in any language
412 418
             foreach ($results as $res) {
@@ -416,7 +422,9 @@  discard block
 block discarded – undo
416 422
                     $hits[] = $res;
417 423
                 }
418 424
             }
419
-            if (sizeof($hits) > 0) return $hits;
425
+            if (sizeof($hits) > 0) {
426
+              return $hits;
427
+            }
420 428
         }
421 429
 
422 430
         // case 3: exact match on alternate label
@@ -425,7 +433,9 @@  discard block
 block discarded – undo
425 433
                 $hits[] = $res;
426 434
             }
427 435
         }
428
-        if (sizeof($hits) > 0) return $hits;
436
+        if (sizeof($hits) > 0) {
437
+          return $hits;
438
+        }
429 439
 
430 440
 
431 441
         // case 4: case-insensitive match on alternate label
@@ -434,7 +444,9 @@  discard block
 block discarded – undo
434 444
                 $hits[] = $res;
435 445
             }
436 446
         }
437
-        if (sizeof($hits) > 0) return $hits;
447
+        if (sizeof($hits) > 0) {
448
+          return $hits;
449
+        }
438 450
 
439 451
         return $hits;   
440 452
     }
Please login to merge, or discard this patch.
model/sparql/GenericSparql.php 2 patches
Braces   +7 added lines, -4 removed lines patch added patch discarded remove patch
@@ -64,12 +64,16 @@  discard block
 block discarded – undo
64 64
         $this->model = $model;
65 65
 
66 66
         // set graphClause so that it can be used by all queries
67
-        if ($this->isDefaultEndpoint()) // default endpoint; query any graph (and catch it in a variable)
67
+        if ($this->isDefaultEndpoint()) {
68
+          // default endpoint; query any graph (and catch it in a variable)
68 69
         {
69 70
             $this->graphClause = "GRAPH $graph";
70
-        } elseif ($graph) // query a specific graph
71
+        }
72
+        } elseif ($graph) {
73
+          // query a specific graph
71 74
         {
72 75
             $this->graphClause = "GRAPH <$graph>";
76
+        }
73 77
         } else // query the default graph
74 78
         {
75 79
             $this->graphClause = "";
@@ -1711,8 +1715,7 @@  discard block
 block discarded – undo
1711 1715
         if (sizeof($ret) > 0) {
1712 1716
             // existing concept, with children
1713 1717
             return $ret;
1714
-        }
1715
-        else {
1718
+        } else {
1716 1719
             // nonexistent concept
1717 1720
             return null;
1718 1721
         }
Please login to merge, or discard this patch.
Doc Comments   +4 added lines, -3 removed lines patch added patch discarded remove patch
@@ -400,7 +400,7 @@  discard block
 block discarded – undo
400 400
      * Returns information (as a graph) for one or more concept URIs
401 401
      * @param mixed $uris concept URI (string) or array of URIs
402 402
      * @param string|null $arrayClass the URI for thesaurus array class, or null if not used
403
-     * @param \Vocabulary[]|null $vocabs vocabularies to target
403
+     * @param Vocabulary[] $vocabs vocabularies to target
404 404
      * @return \Concept[]
405 405
      */
406 406
     public function queryConceptInfoGraph($uris, $arrayClass = null, $vocabs = array()) {
@@ -626,7 +626,7 @@  discard block
 block discarded – undo
626 626
 
627 627
     /**
628 628
      * Generate a VALUES clause for limiting the targeted graphs.
629
-     * @param Vocabulary[]|null $vocabs array of Vocabulary objects to target
629
+     * @param Vocabulary[] $vocabs array of Vocabulary objects to target
630 630
      * @return string VALUES clause, or "" if not necessary to limit
631 631
      */
632 632
     protected function formatValuesGraph($vocabs) {
@@ -806,6 +806,7 @@  discard block
 block discarded – undo
806 806
      * @param string $searchLang language code used for matching labels (null means any language)
807 807
      * @param string[] $props properties to target e.g. array('skos:prefLabel','skos:altLabel')
808 808
      * @param boolean $unique restrict results to unique concepts (default: false)
809
+     * @param string $filterGraph
809 810
      * @return string sparql query
810 811
      */
811 812
     protected function generateConceptSearchQueryInner($term, $lang, $searchLang, $props, $unique, $filterGraph)
@@ -1372,7 +1373,7 @@  discard block
 block discarded – undo
1372 1373
     /**
1373 1374
      * Query a single transitive property of a concept.
1374 1375
      * @param string $uri
1375
-     * @param string $prop the name of the property eg. 'skos:broader'.
1376
+     * @param string $props the name of the property eg. 'skos:broader'.
1376 1377
      * @param string $lang
1377 1378
      * @param integer $limit
1378 1379
      * @param boolean $anylang if you want a label even when it isn't available in the language you requested.
Please login to merge, or discard this patch.