Passed
Pull Request — master (#1201)
by
unknown
03:22
created
model/sparql/GenericSparql.php 1 patch
Braces   +8 added lines, -6 removed lines patch added patch discarded remove patch
@@ -47,12 +47,16 @@  discard block
 block discarded – undo
47 47
         $this->client = new EasyRdf\Sparql\Client($endpoint);
48 48
 
49 49
         // set graphClause so that it can be used by all queries
50
-        if ($this->isDefaultEndpoint()) // default endpoint; query any graph (and catch it in a variable)
50
+        if ($this->isDefaultEndpoint()) {
51
+          // default endpoint; query any graph (and catch it in a variable)
51 52
         {
52 53
             $this->graphClause = "GRAPH $graph";
53
-        } elseif ($graph !== null) // query a specific graph
54
+        }
55
+        } elseif ($graph !== null) {
56
+          // query a specific graph
54 57
         {
55 58
             $this->graphClause = "GRAPH <$graph>";
59
+        }
56 60
         } else // query the default graph
57 61
         {
58 62
             $this->graphClause = "";
@@ -1274,8 +1278,7 @@  discard block
 block discarded – undo
1274 1278
             if (isset($row->qualifier)) {
1275 1279
                 if ($row->qualifier instanceof EasyRdf\Literal) {
1276 1280
                     $hit['qualifier'] = $row->qualifier->getValue();
1277
-                }
1278
-                else {
1281
+                } else {
1279 1282
                     $hit['qualifier'] = $row->qualifier->localName();
1280 1283
                 }
1281 1284
             }
@@ -1955,8 +1958,7 @@  discard block
 block discarded – undo
1955 1958
         if (sizeof($ret) > 0) {
1956 1959
             // existing concept, with children
1957 1960
             return $ret;
1958
-        }
1959
-        else {
1961
+        } else {
1960 1962
             // nonexistent concept
1961 1963
             return null;
1962 1964
         }
Please login to merge, or discard this patch.
model/Model.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -354,10 +354,12 @@
 block discarded – undo
354 354
                 // register vocabulary ids as RDF namespace prefixes
355 355
                 $prefix = preg_replace('/\W+/', '', $voc->getId()); // strip non-word characters
356 356
                 try {
357
-                    if ($prefix != '' && EasyRdf\RdfNamespace::get($prefix) === null) // if not already defined
357
+                    if ($prefix != '' && EasyRdf\RdfNamespace::get($prefix) === null) {
358
+                      // if not already defined
358 359
                     {
359 360
                         EasyRdf\RdfNamespace::set($prefix, $voc->getUriSpace());
360 361
                     }
362
+                    }
361 363
 
362 364
                 } catch (Exception $e) {
363 365
                     // not valid as namespace identifier, ignore
Please login to merge, or discard this patch.
controller/WebController.php 1 patch
Braces   +9 added lines, -3 removed lines patch added patch discarded remove patch
@@ -266,11 +266,17 @@
 block discarded – undo
266 266
         $envelopeSender = $this->model->getConfig()->getFeedbackEnvelopeSender();
267 267
         // determine the sender address of the message
268 268
         $sender = $this->model->getConfig()->getFeedbackSender();
269
-        if (empty($sender)) $sender = $envelopeSender;
270
-        if (empty($sender)) $sender = $this->model->getConfig()->getFeedbackAddress();
269
+        if (empty($sender)) {
270
+          $sender = $envelopeSender;
271
+        }
272
+        if (empty($sender)) {
273
+          $sender = $this->model->getConfig()->getFeedbackAddress();
274
+        }
271 275
 
272 276
         // determine sender name - default to "anonymous user" if not given by user
273
-        if (empty($fromName)) $fromName = "anonymous user";
277
+        if (empty($fromName)) {
278
+          $fromName = "anonymous user";
279
+        }
274 280
         $headers = $this->createFeedbackHeaders($fromName, $fromEmail, $toMail, $sender);
275 281
         $params = empty($envelopeSender) ? '' : "-f $envelopeSender";
276 282
         // adding some information about the user for debugging purposes.
Please login to merge, or discard this patch.
model/VocabularyConfig.php 1 patch
Braces   +16 added lines, -9 removed lines patch added patch discarded remove patch
@@ -52,8 +52,7 @@  discard block
 block discarded – undo
52 52
                 if ($plugin instanceof EasyRdf\Literal) {
53 53
                     $pluginName = $plugin->getValue();
54 54
                     array_push($pluginArray, $pluginName);
55
-                }
56
-                else {
55
+                } else {
57 56
                     array_push($pluginArray, $plugin->getLiteral('skosmos:usePlugin')->getValue());
58 57
                 }
59 58
             }
@@ -206,8 +205,9 @@  discard block
 block discarded – undo
206 205
     public function getShortName()
207 206
     {
208 207
         $shortname = $this->getLiteral('skosmos:shortName');
209
-        if ($shortname)
210
-          return $shortname;
208
+        if ($shortname) {
209
+                  return $shortname;
210
+        }
211 211
 
212 212
         // if no shortname exists fall back to the id
213 213
         return $this->getId();
@@ -357,10 +357,12 @@  discard block
 block discarded – undo
357 357
         $ret = array();
358 358
         foreach ($resources as $res) {
359 359
             $prop = $res->getURI();
360
-            if (EasyRdf\RdfNamespace::shorten($prop) !== null) // shortening property labels if possible
360
+            if (EasyRdf\RdfNamespace::shorten($prop) !== null) {
361
+              // shortening property labels if possible
361 362
             {
362 363
                 $prop = EasyRdf\RdfNamespace::shorten($prop);
363 364
             }
365
+            }
364 366
 
365 367
             $ret[] = $prop;
366 368
         }
@@ -377,10 +379,12 @@  discard block
 block discarded – undo
377 379
         $resources = $this->resource->allResources("skosmos:hasMultiLingualProperty");
378 380
         foreach ($resources as $res) {
379 381
             $prop = $res->getURI();
380
-            if (EasyRdf\RdfNamespace::shorten($prop) !== null) // shortening property labels if possible
382
+            if (EasyRdf\RdfNamespace::shorten($prop) !== null) {
383
+              // shortening property labels if possible
381 384
             {
382 385
                 $prop = EasyRdf\RdfNamespace::shorten($prop);
383 386
             }
387
+            }
384 388
 
385 389
             if ($prop === $property) {
386 390
                 return true;
@@ -526,11 +530,12 @@  discard block
 block discarded – undo
526 530
     public function getId()
527 531
     {
528 532
         $uriparts = explode("#", $this->resource->getURI());
529
-        if (count($uriparts) != 1)
530
-        // hash namespace
533
+        if (count($uriparts) != 1) {
534
+                // hash namespace
531 535
         {
532 536
             return $uriparts[1];
533 537
         }
538
+        }
534 539
 
535 540
         // slash namespace
536 541
         $uriparts = explode("/", $this->resource->getURI());
@@ -558,10 +563,12 @@  discard block
 block discarded – undo
558 563
         $ret = array();
559 564
         foreach ($resources as $res) {
560 565
             $prop = $res->getURI();
561
-            if (EasyRdf\RdfNamespace::shorten($prop) !== null) // prefixing if possible
566
+            if (EasyRdf\RdfNamespace::shorten($prop) !== null) {
567
+              // prefixing if possible
562 568
             {
563 569
                 $prop = EasyRdf\RdfNamespace::shorten($prop);
564 570
             }
571
+            }
565 572
 
566 573
             $ret[] = $prop;
567 574
         }
Please login to merge, or discard this patch.