Completed
Push — master ( 0807cd...8d8c90 )
by Henri
03:22
created
model/sparql/GenericSparql.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -648,7 +648,7 @@  discard block
 block discarded – undo
648 648
         foreach ($graphs as $graph) {
649 649
           $conditions[] = "?graph=<$graph>";
650 650
         }
651
-        return "FILTER (" . implode('||', $conditions) . ")";
651
+        return "FILTER (".implode('||', $conditions).")";
652 652
     }
653 653
 
654 654
     /**
@@ -658,16 +658,16 @@  discard block
 block discarded – undo
658 658
      * @return string sparql query clauses
659 659
      */
660 660
     protected function formatLimitAndOffset($limit, $offset) {
661
-        $limit = ($limit) ? 'LIMIT ' . $limit : '';
662
-        $offset = ($offset) ? 'OFFSET ' . $offset : '';
661
+        $limit = ($limit) ? 'LIMIT '.$limit : '';
662
+        $offset = ($offset) ? 'OFFSET '.$offset : '';
663 663
         // eliminating whitespace and line changes when the conditions aren't needed.
664 664
         $limitandoffset = '';
665 665
         if ($limit && $offset) {
666
-            $limitandoffset = "\n" . $limit . "\n" . $offset;
666
+            $limitandoffset = "\n".$limit."\n".$offset;
667 667
         } elseif ($limit) {
668
-            $limitandoffset = "\n" . $limit;
668
+            $limitandoffset = "\n".$limit;
669 669
         } elseif ($offset) {
670
-            $limitandoffset = "\n" . $offset;
670
+            $limitandoffset = "\n".$offset;
671 671
         }
672 672
 
673 673
         return $limitandoffset;
@@ -687,7 +687,7 @@  discard block
 block discarded – undo
687 687
             }
688 688
         }
689 689
 
690
-        return implode(' UNION ', $typePatterns);;
690
+        return implode(' UNION ', $typePatterns); ;
691 691
     }
692 692
 
693 693
     /**
@@ -815,7 +815,7 @@  discard block
 block discarded – undo
815 815
         // if search language and UI/display language differ, must also consider case where there is no prefLabel in
816 816
         // the display language; in that case, should use the label with the same language as the matched label
817 817
         $labelcondFallback = ($searchLang != $lang) ?
818
-          "OPTIONAL { # in case previous OPTIONAL block gives no labels\n" .
818
+          "OPTIONAL { # in case previous OPTIONAL block gives no labels\n".
819 819
           "?s skos:prefLabel ?label . FILTER (LANGMATCHES(LANG(?label), LANG(?match))) }" : "";
820 820
 
821 821
         /*
@@ -867,15 +867,15 @@  discard block
 block discarded – undo
867 867
 
868 868
         $schemecond = '';
869 869
         if (!empty($schemes)) {
870
-            foreach($schemes as $scheme) {
870
+            foreach ($schemes as $scheme) {
871 871
                 $schemecond .= "?s skos:inScheme <$scheme> . ";
872 872
             }
873 873
         }
874 874
 
875 875
         // extra conditions for parent and group, if specified
876
-        $parentcond = ($params->getParentLimit()) ? "?s skos:broader+ <" . $params->getParentLimit() . "> ." : "";
877
-        $groupcond = ($params->getGroupLimit()) ? "<" . $params->getGroupLimit() . "> skos:member ?s ." : "";
878
-        $pgcond = $parentcond . $groupcond;
876
+        $parentcond = ($params->getParentLimit()) ? "?s skos:broader+ <".$params->getParentLimit()."> ." : "";
877
+        $groupcond = ($params->getGroupLimit()) ? "<".$params->getGroupLimit()."> skos:member ?s ." : "";
878
+        $pgcond = $parentcond.$groupcond;
879 879
 
880 880
         $orderextra = $this->isDefaultEndpoint() ? $this->graph : '';
881 881
 
@@ -943,9 +943,9 @@  discard block
 block discarded – undo
943 943
             $hit['type'][] = $this->shortenUri($typeuri);
944 944
         }
945 945
 
946
-        if(!empty($fields)) {
946
+        if (!empty($fields)) {
947 947
             foreach ($fields as $prop) {
948
-                $propname = $prop . 's';
948
+                $propname = $prop.'s';
949 949
                 if (isset($row->$propname)) {
950 950
                     foreach (explode("\n", $row->$propname->getValue()) as $line) {
951 951
                         $rdata = str_getcsv($line, ',', '"', '"');
@@ -960,7 +960,7 @@  discard block
 block discarded – undo
960 960
                             $propvals = $rdata[2];
961 961
                         }
962 962
 
963
-                        $hit['skos:' . $prop][] = $propvals;
963
+                        $hit['skos:'.$prop][] = $propvals;
964 964
                     }
965 965
                 }
966 966
             }
@@ -1426,7 +1426,7 @@  discard block
 block discarded – undo
1426 1426
                 if (!isset($row->label) || $row->label->getLang() === $lang) {
1427 1427
                     $ret[$row->object->getUri()] = $val;
1428 1428
                 } elseif ($row->label->getLang() === $fallbacklang) {
1429
-                    $val['label'] .= ' (' . $row->label->getLang() . ')';
1429
+                    $val['label'] .= ' ('.$row->label->getLang().')';
1430 1430
                     $ret[$row->object->getUri()] = $val;
1431 1431
                 }
1432 1432
             }
@@ -1527,7 +1527,7 @@  discard block
 block discarded – undo
1527 1527
                 if ($row->label->getLang() == $lang) {
1528 1528
                     $label = $row->label->getValue();
1529 1529
                 } else {
1530
-                    $label = $row->label->getValue() . " (" . $row->label->getLang() . ")";
1530
+                    $label = $row->label->getValue()." (".$row->label->getLang().")";
1531 1531
                 }
1532 1532
 
1533 1533
             }
@@ -1696,7 +1696,7 @@  discard block
 block discarded – undo
1696 1696
                 if (isset($row->childlabel)) {
1697 1697
                     $label = $row->childlabel->getValue();
1698 1698
                     if ($row->childlabel->getLang() !== $lang) {
1699
-                        $label .= " (" . $row->childlabel->getLang() . ")";
1699
+                        $label .= " (".$row->childlabel->getLang().")";
1700 1700
                     }
1701 1701
 
1702 1702
                 }
@@ -1718,7 +1718,7 @@  discard block
 block discarded – undo
1718 1718
             if (isset($row->label)) {
1719 1719
                 $preflabel = $row->label->getValue();
1720 1720
                 if ($row->label->getLang() !== $lang) {
1721
-                    $preflabel .= ' (' . $row->label->getLang() . ')';
1721
+                    $preflabel .= ' ('.$row->label->getLang().')';
1722 1722
                 }
1723 1723
 
1724 1724
                 $ret[$uri]['prefLabel'] = $preflabel;
@@ -1882,7 +1882,7 @@  discard block
 block discarded – undo
1882 1882
                     if ($row->label->getLang() == $lang) {
1883 1883
                         $values[$row->conc->getURI()]['prefLabel'] = $row->label->getValue();
1884 1884
                     } else {
1885
-                        $values[$row->conc->getURI()]['prefLabel'] = $row->label->getValue() . " (" . $row->label->getLang() . ")";
1885
+                        $values[$row->conc->getURI()]['prefLabel'] = $row->label->getValue()." (".$row->label->getLang().")";
1886 1886
                     }
1887 1887
 
1888 1888
                 }
@@ -1923,7 +1923,7 @@  discard block
 block discarded – undo
1923 1923
      */
1924 1924
     private function generateChangeListQuery($lang, $offset, $prop) {
1925 1925
         $gcl = $this->graphClause;
1926
-        $offset = ($offset) ? 'OFFSET ' . $offset : '';
1926
+        $offset = ($offset) ? 'OFFSET '.$offset : '';
1927 1927
 
1928 1928
         $query = <<<EOQ
1929 1929
 SELECT DISTINCT ?concept ?date ?label
Please login to merge, or discard this patch.