Completed
Push — master ( f1d582...f0d0d9 )
by Henri
02:52
created
controller/Controller.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,9 +1,9 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Copyright (c) 2012-2013 Aalto University and University of Helsinki
4
- * MIT License
5
- * see LICENSE.txt for more information
6
- */
3
+     * Copyright (c) 2012-2013 Aalto University and University of Helsinki
4
+     * MIT License
5
+     * see LICENSE.txt for more information
6
+     */
7 7
 
8 8
 /* Register text: namespace needed for jena-text queries */
9 9
 EasyRdf_Namespace::set('text', 'http://jena.apache.org/text#');
Please login to merge, or discard this patch.
index.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,9 +1,9 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Copyright (c) 2012-2013 Aalto University and University of Helsinki
4
- * MIT License
5
- * see LICENSE.txt for more information
6
- */
3
+     * Copyright (c) 2012-2013 Aalto University and University of Helsinki
4
+     * MIT License
5
+     * see LICENSE.txt for more information
6
+     */
7 7
 
8 8
 /* Register text: namespace needed for jena-text queries */
9 9
 EasyRdf_Namespace::set('text', 'http://jena.apache.org/text#');
Please login to merge, or discard this patch.
model/ConceptSearchParameters.php 2 patches
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.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -118,7 +118,7 @@
 block discarded – undo
118 118
         return $type;
119 119
     }
120 120
 
121
-    private function getQueryParam($name, $explode=false) {
121
+    private function getQueryParam($name, $explode = false) {
122 122
         if ($explode) {
123 123
             return $this->request->getQueryParam($name) ? explode(' ', $this->request->getQueryParam($name)) : null;
124 124
         }
Please login to merge, or discard this patch.
model/sparql/GenericSparql.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -585,7 +585,7 @@
 block discarded – undo
585 585
 
586 586
     /**
587 587
      * Generate a VALUES clause for limiting the targeted graphs.
588
-     * @param array $vocabs array of Vocabulary objects to target
588
+     * @param Vocabulary[] $vocabs array of Vocabulary objects to target
589 589
      * @return string VALUES clause, or "" if not necessary to limit
590 590
      */
591 591
     protected function formatValuesGraph($vocabs) {
Please login to merge, or discard this patch.
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -56,12 +56,16 @@
 block discarded – undo
56 56
         $this->model = $model;
57 57
 
58 58
         // set graphClause so that it can be used by all queries
59
-        if ($this->isDefaultEndpoint()) // default endpoint; query any graph (and catch it in a variable)
59
+        if ($this->isDefaultEndpoint()) {
60
+          // default endpoint; query any graph (and catch it in a variable)
60 61
         {
61 62
             $this->graphClause = "GRAPH $graph";
62
-        } elseif ($graph) // query a specific graph
63
+        }
64
+        } elseif ($graph) {
65
+          // query a specific graph
63 66
         {
64 67
             $this->graphClause = "GRAPH <$graph>";
68
+        }
65 69
         } else // query the default graph
66 70
         {
67 71
             $this->graphClause = "";
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -651,7 +651,7 @@  discard block
 block discarded – undo
651 651
             }
652 652
         }
653 653
 
654
-        return implode(' UNION ', $type_patterns);;
654
+        return implode(' UNION ', $type_patterns); ;
655 655
     }
656 656
 
657 657
     /**
@@ -829,7 +829,7 @@  discard block
 block discarded – undo
829 829
 
830 830
         $schemecond = '';
831 831
         if (!empty($schemes)) {
832
-            foreach($schemes as $scheme) {
832
+            foreach ($schemes as $scheme) {
833 833
                 $schemecond .= "?s skos:inScheme <$scheme> . ";
834 834
             }
835 835
         }
@@ -918,7 +918,7 @@  discard block
 block discarded – undo
918 918
                 $hit['type'][] = $qnamecache[$typeuri];
919 919
             }
920 920
 
921
-            if(!empty($fields)) {
921
+            if (!empty($fields)) {
922 922
                 foreach ($fields as $prop) {
923 923
                     $propname = $prop . 's';
924 924
                     if (isset($row->$propname)) {
Please login to merge, or discard this patch.
controller/RestController.php 3 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
         // convert to vocids array to support multi-vocabulary search
169 169
         $vocids = ($vocabs !== null && $vocabs !== '') ? explode(' ', $vocabs) : array();
170 170
         $vocabObjects = array();
171
-        foreach($vocids as $vocid) {
171
+        foreach ($vocids as $vocid) {
172 172
             $vocabObjects[] = $this->model->getVocabulary($vocid);
173 173
         }
174 174
         $parameters->setVocabularies($vocabObjects);
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
         if ($request->getQueryParam('labellang')) {
202 202
             $ret['@context']['@language'] = $request->getQueryParam('labellang');
203 203
         } elseif ($request->getQueryParam('lang')) {
204
-            $ret['@context']['@language'] = $request->getQueryParam('lang');;
204
+            $ret['@context']['@language'] = $request->getQueryParam('lang'); ;
205 205
         }
206 206
 
207 207
         return $this->returnJson($ret);
Please login to merge, or discard this patch.
Doc Comments   +6 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
Please login to merge, or discard this patch.
Braces   +9 added lines, -3 removed lines patch added patch discarded remove patch
@@ -407,7 +407,9 @@  discard block
 block discarded – undo
407 407
                 $hits[] = $res;
408 408
             }
409 409
         }
410
-        if (sizeof($hits) > 0) return $hits;
410
+        if (sizeof($hits) > 0) {
411
+          return $hits;
412
+        }
411 413
 
412 414
         // case 2: case-insensitive match on preferred label
413 415
         foreach ($results as $res) {
@@ -415,7 +417,9 @@  discard block
 block discarded – undo
415 417
                 $hits[] = $res;
416 418
             }
417 419
         }
418
-        if (sizeof($hits) > 0) return $hits;
420
+        if (sizeof($hits) > 0) {
421
+          return $hits;
422
+        }
419 423
 
420 424
         // case 3: exact match on alternate label
421 425
         foreach ($results as $res) {
@@ -423,7 +427,9 @@  discard block
 block discarded – undo
423 427
                 $hits[] = $res;
424 428
             }
425 429
         }
426
-        if (sizeof($hits) > 0) return $hits;
430
+        if (sizeof($hits) > 0) {
431
+          return $hits;
432
+        }
427 433
 
428 434
 
429 435
         // case 4: case-insensitive match on alternate label
Please login to merge, or discard this patch.
model/NamespaceExposingTurtleParser.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,9 +1,9 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Copyright (c) 2016 University of Helsinki
4
- * MIT License
5
- * see LICENSE.txt for more information
6
- */
3
+     * Copyright (c) 2016 University of Helsinki
4
+     * MIT License
5
+     * see LICENSE.txt for more information
6
+     */
7 7
 
8 8
 class NamespaceExposingTurtleParser extends EasyRdf_Parser_Turtle
9 9
 {
Please login to merge, or discard this patch.
model/GlobalConfig.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@
 block discarded – undo
6 6
 class GlobalConfig {
7 7
     private $languages;
8 8
 
9
-    public function __construct($config_name='/../config.inc') 
9
+    public function __construct($config_name = '/../config.inc') 
10 10
     {
11 11
         try {
12 12
             $file_path = dirname(__FILE__) . $config_name;
Please login to merge, or discard this 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 2 patches
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.
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,9 +1,9 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Copyright (c) 2012-2013 Aalto University and University of Helsinki
4
- * MIT License
5
- * see LICENSE.txt for more information
6
- */
3
+     * Copyright (c) 2012-2013 Aalto University and University of Helsinki
4
+     * MIT License
5
+     * see LICENSE.txt for more information
6
+     */
7 7
 
8 8
 /**
9 9
  * Dataobject wraps EasyRdf resources and provides access to the data.
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
      */
115 115
     public function getEnvLang()    
116 116
     {
117
-       // get language from locale, same as used by gettext, set by Controller
118
-       return substr(getenv("LC_ALL"), 0, 2); // @codeCoverageIgnore
117
+        // get language from locale, same as used by gettext, set by Controller
118
+        return substr(getenv("LC_ALL"), 0, 2); // @codeCoverageIgnore
119 119
     }
120 120
 }
Please login to merge, or discard this patch.
model/Concept.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -459,11 +459,11 @@
 block discarded – undo
459 459
             trigger_error($e->getMessage(), E_USER_WARNING);
460 460
             $ret = '';
461 461
             if ($this->resource->get('dc:modified')) {
462
-                $modified = (string) $this->resource->get('dc:modified');
462
+                $modified = (string)$this->resource->get('dc:modified');
463 463
                 $ret = gettext('skosmos:modified') . ' ' . $modified; 
464 464
             }
465 465
             if ($this->resource->get('dc:created')) {
466
-                $created .= (string) $this->resource->get('dc:created');
466
+                $created .= (string)$this->resource->get('dc:created');
467 467
                 $ret .= ' ' . gettext('skosmos:created') . ' ' . $created; 
468 468
             }
469 469
         }
Please login to merge, or discard this patch.