Completed
Push — master ( 858968...6eab88 )
by Henri
03:37
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.
controller/Honeypot.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -39,11 +39,11 @@
 block discarded – undo
39 39
         return $html;
40 40
     }
41 41
     /**
42
-    * Validate honeypot is empty
43
-    *
44
-    * @param  mixed $value
45
-    * @return boolean
46
-    */
42
+     * Validate honeypot is empty
43
+     *
44
+     * @param  mixed $value
45
+     * @return boolean
46
+     */
47 47
     public function validateHoneypot($value)
48 48
     {
49 49
         if ($this->disabled) {
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
@@ -79,10 +79,12 @@
 block discarded – undo
79 79
         if ($sortable !== null) {
80 80
             uksort($sortable, array($this, 'mycompare'));
81 81
             foreach ($sortable as $prop => $vals) {
82
-                if (is_array($prop)) // the ConceptProperty objects have their own sorting methods
82
+                if (is_array($prop)) {
83
+                  // the ConceptProperty objects have their own sorting methods
83 84
                 {
84 85
                     ksort($sortable[$prop]);
85 86
                 }
87
+                }
86 88
             }
87 89
         }
88 90
         return $sortable;
Please login to merge, or discard this patch.
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -124,7 +124,7 @@
 block discarded – undo
124 124
      */
125 125
     public function getEnvLang()
126 126
     {
127
-       // get language from locale, same as used by gettext, set by Controller
128
-       return substr(getenv("LC_ALL"), 0, 2); // @codeCoverageIgnore
127
+        // get language from locale, same as used by gettext, set by Controller
128
+        return substr(getenv("LC_ALL"), 0, 2); // @codeCoverageIgnore
129 129
     }
130 130
 }
Please login to merge, or discard this patch.
model/sparql/GenericSparql.php 2 patches
Braces   +10 added lines, -6 removed lines patch added patch discarded remove patch
@@ -46,12 +46,16 @@  discard block
 block discarded – undo
46 46
         $this->client = new EasyRdf\Sparql\Client($endpoint);
47 47
 
48 48
         // set graphClause so that it can be used by all queries
49
-        if ($this->isDefaultEndpoint()) // default endpoint; query any graph (and catch it in a variable)
49
+        if ($this->isDefaultEndpoint()) {
50
+          // default endpoint; query any graph (and catch it in a variable)
50 51
         {
51 52
             $this->graphClause = "GRAPH $graph";
52
-        } elseif ($graph) // query a specific graph
53
+        }
54
+        } elseif ($graph) {
55
+          // query a specific graph
53 56
         {
54 57
             $this->graphClause = "GRAPH <$graph>";
58
+        }
55 59
         } else // query the default graph
56 60
         {
57 61
             $this->graphClause = "";
@@ -100,8 +104,9 @@  discard block
 block discarded – undo
100 104
             }
101 105
         }
102 106
         foreach ($graphs as $graph) {
103
-            if($graph !== NULL)
104
-                $clause .= "FROM NAMED <$graph> "; 
107
+            if($graph !== NULL) {
108
+                            $clause .= "FROM NAMED <$graph> ";
109
+            }
105 110
         }
106 111
         return $clause;
107 112
     }
@@ -1847,8 +1852,7 @@  discard block
 block discarded – undo
1847 1852
         if (sizeof($ret) > 0) {
1848 1853
             // existing concept, with children
1849 1854
             return $ret;
1850
-        }
1851
-        else {
1855
+        } else {
1852 1856
             // nonexistent concept
1853 1857
             return null;
1854 1858
         }
Please login to merge, or discard this patch.
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1744,7 +1744,7 @@  discard block
 block discarded – undo
1744 1744
 
1745 1745
     /**
1746 1746
      * Generates a sparql query for finding the hierarchy for a concept.
1747
-	 * A concept may be a top concept in multiple schemes, returned as a single whitespace-separated literal.
1747
+     * A concept may be a top concept in multiple schemes, returned as a single whitespace-separated literal.
1748 1748
      * @param string $uri concept uri.
1749 1749
      * @param string $lang
1750 1750
      * @param string $fallback language to use if label is not available in the preferred language
@@ -1821,11 +1821,11 @@  discard block
 block discarded – undo
1821 1821
                 $ret[$uri]['exact'] = $row->exact->getUri();
1822 1822
             }
1823 1823
             if (isset($row->tops)) {
1824
-               $topConceptsList=array();
1825
-               $topConceptsList=explode(" ", $row->tops->getValue());
1826
-               // sort to garantee an alphabetical ordering of the URI
1827
-               sort($topConceptsList);
1828
-               $ret[$uri]['tops'] = $topConceptsList;
1824
+                $topConceptsList=array();
1825
+                $topConceptsList=explode(" ", $row->tops->getValue());
1826
+                // sort to garantee an alphabetical ordering of the URI
1827
+                sort($topConceptsList);
1828
+                $ret[$uri]['tops'] = $topConceptsList;
1829 1829
             }
1830 1830
             if (isset($row->children)) {
1831 1831
                 if (!isset($ret[$uri]['narrower'])) {
Please login to merge, or discard this patch.
model/Model.php 1 patch
Braces   +9 added lines, -4 removed lines patch added patch discarded remove patch
@@ -108,10 +108,12 @@  discard block
 block discarded – undo
108 108
     
109 109
     private function initializeNamespaces() {
110 110
         foreach ($this->namespaces as $prefix => $fullUri) {
111
-            if ($prefix != '' && EasyRdf\RdfNamespace::get($prefix) === null) // if not already defined
111
+            if ($prefix != '' && EasyRdf\RdfNamespace::get($prefix) === null) {
112
+              // if not already defined
112 113
             {
113 114
                 EasyRdf\RdfNamespace::set($prefix, $fullUri);
114 115
             }
116
+            }
115 117
         }
116 118
     }
117 119
     
@@ -425,10 +427,12 @@  discard block
 block discarded – undo
425 427
                 // register vocabulary ids as RDF namespace prefixes
426 428
                 $prefix = preg_replace('/\W+/', '', $voc->getId()); // strip non-word characters
427 429
                 try {
428
-                    if ($prefix != '' && EasyRdf\RdfNamespace::get($prefix) === null) // if not already defined
430
+                    if ($prefix != '' && EasyRdf\RdfNamespace::get($prefix) === null) {
431
+                      // if not already defined
429 432
                     {
430 433
                         EasyRdf\RdfNamespace::set($prefix, $voc->getUriSpace());
431 434
                     }
435
+                    }
432 436
 
433 437
                 } catch (Exception $e) {
434 438
                     // not valid as namespace identifier, ignore
@@ -551,8 +555,9 @@  discard block
 block discarded – undo
551 555
         
552 556
         // no preferred vocabulary, or it was not found, search in which vocabulary the concept has a label
553 557
         foreach ($vocabs as $vocab) {
554
-            if ($vocab->getConceptLabel($uri, null) !== null)
555
-                return $vocab;
558
+            if ($vocab->getConceptLabel($uri, null) !== null) {
559
+                            return $vocab;
560
+            }
556 561
         }
557 562
 
558 563
         // if the URI couldn't be found, fall back to the first vocabulary
Please login to merge, or discard this patch.
model/Cache.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -25,8 +25,7 @@
 block discarded – undo
25 25
     public function store($key, $value, $ttl=3600) {
26 26
         if (function_exists('apc_store')) {
27 27
             return apc_store($key, $value);
28
-        }
29
-        else if (function_exists('apcu_store')) {
28
+        } else if (function_exists('apcu_store')) {
30 29
             return apcu_store($key, $value, $ttl);
31 30
         }
32 31
     }
Please login to merge, or discard this patch.
model/VocabularyConfig.php 1 patch
Braces   +18 added lines, -9 removed lines patch added patch discarded remove patch
@@ -53,8 +53,9 @@  discard block
 block discarded – undo
53 53
 
54 54
         // not found with selected language, try any language
55 55
         $literal = $this->resource->getLiteral($property);
56
-        if ($literal)
57
-          return $literal->getValue();
56
+        if ($literal) {
57
+                  return $literal->getValue();
58
+        }
58 59
     }
59 60
 
60 61
     /**
@@ -95,8 +96,9 @@  discard block
 block discarded – undo
95 96
     public function getShortName()
96 97
     {
97 98
         $shortname = $this->getLiteral('skosmos:shortName');
98
-        if ($shortname)
99
-          return $shortname;
99
+        if ($shortname) {
100
+                  return $shortname;
101
+        }
100 102
 
101 103
         // if no shortname exists fall back to the id
102 104
         return $this->getId();
@@ -231,10 +233,12 @@  discard block
 block discarded – undo
231 233
         $ret = array();
232 234
         foreach ($resources as $res) {
233 235
             $prop = $res->getURI();
234
-            if (EasyRdf\RdfNamespace::shorten($prop) !== null) // shortening property labels if possible
236
+            if (EasyRdf\RdfNamespace::shorten($prop) !== null) {
237
+              // shortening property labels if possible
235 238
             {
236 239
                 $prop = EasyRdf\RdfNamespace::shorten($prop);
237 240
             }
241
+            }
238 242
 
239 243
             $ret[] = $prop;
240 244
         }
@@ -251,10 +255,12 @@  discard block
 block discarded – undo
251 255
         $resources = $this->resource->allResources("skosmos:hasMultiLingualProperty");
252 256
         foreach ($resources as $res) {
253 257
             $prop = $res->getURI();
254
-            if (EasyRdf\RdfNamespace::shorten($prop) !== null) // shortening property labels if possible
258
+            if (EasyRdf\RdfNamespace::shorten($prop) !== null) {
259
+              // shortening property labels if possible
255 260
             {
256 261
                 $prop = EasyRdf\RdfNamespace::shorten($prop);
257 262
             }
263
+            }
258 264
 
259 265
             if ($prop === $property) {
260 266
                 return true;
@@ -362,11 +368,12 @@  discard block
 block discarded – undo
362 368
     public function getId()
363 369
     {
364 370
         $uriparts = explode("#", $this->resource->getURI());
365
-        if (count($uriparts) != 1)
366
-        // hash namespace
371
+        if (count($uriparts) != 1) {
372
+                // hash namespace
367 373
         {
368 374
             return $uriparts[1];
369 375
         }
376
+        }
370 377
 
371 378
         // slash namespace
372 379
         $uriparts = explode("/", $this->resource->getURI());
@@ -394,10 +401,12 @@  discard block
 block discarded – undo
394 401
         $ret = array();
395 402
         foreach ($resources as $res) {
396 403
             $prop = $res->getURI();
397
-            if (EasyRdf\RdfNamespace::shorten($prop) !== null) // prefixing if possible
404
+            if (EasyRdf\RdfNamespace::shorten($prop) !== null) {
405
+              // prefixing if possible
398 406
             {
399 407
                 $prop = EasyRdf\RdfNamespace::shorten($prop);
400 408
             }
409
+            }
401 410
 
402 411
             $ret[] = $prop;
403 412
         }
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
@@ -69,8 +69,9 @@
 block discarded – undo
69 69
     public function getSearchTerm()
70 70
     {
71 71
         $term = $this->request->getQueryParamRaw('q') ? $this->request->getQueryParamRaw('q') : $this->request->getQueryParamRaw('query');
72
-        if (!$term && $this->rest)
73
-            $term = $this->request->getQueryParamRaw('label');
72
+        if (!$term && $this->rest) {
73
+                    $term = $this->request->getQueryParamRaw('label');
74
+        }
74 75
         $term = trim($term); // surrounding whitespace is not considered significant
75 76
         if ($this->rest) {
76 77
             return $term;
Please login to merge, or discard this patch.