Completed
Push — master ( 14362b...22ff57 )
by Henri
03:08
created
model/Model.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -65,15 +65,15 @@  discard block
 block discarded – undo
65 65
     private function initializeVocabularies()
66 66
     {
67 67
         if (!file_exists($this->getConfig()->getVocabularyConfigFile())) {
68
-            throw new Exception($this->getConfig()->getVocabularyConfigFile() . ' is missing, please provide one.');
68
+            throw new Exception($this->getConfig()->getVocabularyConfigFile().' is missing, please provide one.');
69 69
         }
70 70
 
71 71
         try {
72 72
             // use APC user cache to store parsed vocabularies.ttl configuration
73 73
             if (function_exists('apc_store') && function_exists('apc_fetch')) {
74 74
                 // @codeCoverageIgnoreStart
75
-                $key = realpath($this->getConfig()->getVocabularyConfigFile()) . ", " . filemtime($this->getConfig()->getVocabularyConfigFile());
76
-                $nskey = "namespaces of " . $key;
75
+                $key = realpath($this->getConfig()->getVocabularyConfigFile()).", ".filemtime($this->getConfig()->getVocabularyConfigFile());
76
+                $nskey = "namespaces of ".$key;
77 77
                 $this->graph = apc_fetch($key);
78 78
                 $this->namespaces = apc_fetch($nskey);
79 79
                 if ($this->graph === false || $this->namespaces === false) { // was not found in cache
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
                 $this->parseVocabularies($this->getConfig()->getVocabularyConfigFile());
87 87
             }
88 88
         } catch (Exception $e) {
89
-            echo "Error: " . $e->getMessage();
89
+            echo "Error: ".$e->getMessage();
90 90
         }
91 91
     }
92 92
 
@@ -424,7 +424,7 @@  discard block
 block discarded – undo
424 424
     public function getVocabularyCategories()
425 425
     {
426 426
         $cats = $this->graph->allOfType('skos:Concept');
427
-        if(empty($cats)) {
427
+        if (empty($cats)) {
428 428
             return array(new VocabularyCategory($this, null));
429 429
         }
430 430
 
@@ -571,7 +571,7 @@  discard block
 block discarded – undo
571 571
         // using apc cache for the resource if available
572 572
         if (function_exists('apc_store') && function_exists('apc_fetch')) {
573 573
             // @codeCoverageIgnoreStart
574
-            $key = 'fetch: ' . EasyRdf_Utils::removeFragmentFromUri($uri);
574
+            $key = 'fetch: '.EasyRdf_Utils::removeFragmentFromUri($uri);
575 575
             $resource = apc_fetch($key);
576 576
             if ($resource === null || $resource === false) { // was not found in cache, or previous request failed
577 577
                 $resource = $this->fetchResourceFromUri($uri);
@@ -592,7 +592,7 @@  discard block
 block discarded – undo
592 592
      */
593 593
     public function getSparqlImplementation($dialect, $endpoint, $graph)
594 594
     {
595
-        $classname = $dialect . "Sparql";
595
+        $classname = $dialect."Sparql";
596 596
 
597 597
         return new $classname($endpoint, $graph, $this);
598 598
     }
Please login to merge, or discard this patch.
model/VocabularyConfig.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
 {
8 8
     private $plugins;
9 9
 
10
-    public function __construct($resource, $globalPlugins=array()) 
10
+    public function __construct($resource, $globalPlugins = array()) 
11 11
     {
12 12
         $this->resource = $resource;
13 13
         $plugins = $this->resource->allLiterals('skosmos:usePlugin');
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
      * @param string $property the property to query
41 41
      * @param string $lang preferred language for the literal,
42 42
      */
43
-    private function getLiteral($property, $lang=null)
43
+    private function getLiteral($property, $lang = null)
44 44
     {
45 45
         if (!isset($lang)) {;
46 46
             $lang = $this->getEnvLang();
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
         $langs = $this->getLanguages();
73 73
         $deflang = reset($langs); // picking the first one from the list with reset since the keys are not numeric
74 74
         if (sizeof($langs) > 1) {
75
-            trigger_error("Default language for vocabulary '" . $this->getShortName() . "' unknown, choosing '$deflang'.", E_USER_WARNING);
75
+            trigger_error("Default language for vocabulary '".$this->getShortName()."' unknown, choosing '$deflang'.", E_USER_WARNING);
76 76
         }
77 77
 
78 78
         return $deflang;
Please login to merge, or discard this patch.
model/ConceptProperty.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
      * @param string $prop property type eg. 'rdf:type'.
22 22
      * @param string $label
23 23
      */
24
-    public function __construct($prop, $label, $super=null)
24
+    public function __construct($prop, $label, $super = null)
25 25
     {
26 26
         $this->prop = $prop;
27 27
         $this->label = $label;
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
      */
60 60
     public function getDescription()
61 61
     {
62
-        $helpprop = $this->prop . "_help";
62
+        $helpprop = $this->prop."_help";
63 63
 
64 64
         return gettext($helpprop); // can't use string constant, it'd be picked up by xgettext
65 65
     }
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 
79 79
     public function addValue($value)
80 80
     {
81
-        $this->values[$value->getLabel() . $value->getUri()] = $value;
81
+        $this->values[$value->getLabel().$value->getUri()] = $value;
82 82
         $this->is_sorted = false;
83 83
     }
84 84
 
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
     {
87 87
         if (!empty($this->values)) {
88 88
             uksort($this->values, function($a, $b) {
89
-                return strnatcasecmp($a,$b);
89
+                return strnatcasecmp($a, $b);
90 90
             });
91 91
         }
92 92
         $this->is_sorted = true;
Please login to merge, or discard this patch.
model/ConceptPropertyValue.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
24 24
     {
25 25
         $label = is_string($this->getLabel()) ? $this->getLabel() : $this->getLabel()->getValue();
26 26
         if ($this->vocab->getConfig()->sortByNotation()) {
27
-            $label = $this->getNotation() . $label;
27
+            $label = $this->getNotation().$label;
28 28
         }
29 29
 
30 30
         return $label;
Please login to merge, or discard this patch.
model/Vocabulary.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
             return $lname;
98 98
         }
99 99
         // already a full URI
100
-        return $this->getUriSpace() . $lname;
100
+        return $this->getUriSpace().$lname;
101 101
     }
102 102
 
103 103
     /**
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
                 $prop = (substr($prop, 0, 5) == 'dc11:') ? str_replace('dc11:', 'dc:', $prop) : $prop;
160 160
                     $value = $val->getValue();
161 161
                     if ($value instanceof DateTime) {
162
-                        $val = Punic\Calendar::formatDate($value, 'full', $lang) . ' ' . Punic\Calendar::format($value, 'HH:mm:ss', $lang);
162
+                        $val = Punic\Calendar::formatDate($value, 'full', $lang).' '.Punic\Calendar::format($value, 'HH:mm:ss', $lang);
163 163
                     }
164 164
                     $ret[$prop][] = $val;
165 165
                 }
@@ -270,7 +270,7 @@  discard block
 block discarded – undo
270 270
         }
271 271
         // don't know how to parse
272 272
         $rev = $parts[2];
273
-        $datestr = $parts[3] . ' ' . $parts[4];
273
+        $datestr = $parts[3].' '.$parts[4];
274 274
 
275 275
         return "$datestr (r$rev)";
276 276
     }
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
      * Counts the statistics of the vocabulary.
280 280
      * @return array of the concept/group counts
281 281
      */
282
-    public function getStatistics($lang = '', $array=null, $group=null)
282
+    public function getStatistics($lang = '', $array = null, $group = null)
283 283
     {
284 284
         $sparql = $this->getSparql();
285 285
         // find the number of concepts
@@ -595,14 +595,14 @@  discard block
 block discarded – undo
595 595
     {
596 596
       $changelist = $this->getSparql()->queryChangeList($clang, $offset, $prop);
597 597
       $bydate = array();
598
-      foreach($changelist as $concept) {
598
+      foreach ($changelist as $concept) {
599 599
         $concept['datestring'] = Punic\Calendar::formatDate($concept['date'], 'medium', $lang);
600
-        $bydate[Punic\Calendar::getMonthName($concept['date'], 'wide', $lang, true) . Punic\Calendar::format($concept['date'], ' y', $lang) ][strtolower($concept['prefLabel'])] = $concept;
600
+        $bydate[Punic\Calendar::getMonthName($concept['date'], 'wide', $lang, true).Punic\Calendar::format($concept['date'], ' y', $lang)][strtolower($concept['prefLabel'])] = $concept;
601 601
       }
602 602
       return $bydate;
603 603
     }
604 604
 
605
-    public function getTitle($lang=null) {
605
+    public function getTitle($lang = null) {
606 606
       return $this->config->getTitle($lang);
607 607
     }
608 608
     
Please login to merge, or discard this patch.
model/PluginRegister.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@  discard block
 block discarded – undo
3 3
 class PluginRegister {
4 4
     private $requestedPlugins;
5 5
 
6
-    public function __construct($requestedPlugins=array()) {
6
+    public function __construct($requestedPlugins = array()) {
7 7
         $this->requestedPlugins = $requestedPlugins;
8 8
     }
9 9
     
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
                 if (isset($files[$type])) {
39 39
                     $ret[$name] = array();
40 40
                     foreach ($files[$type] as $file) {
41
-                        array_push($ret[$name], 'plugins/' . $name . '/' . $file);
41
+                        array_push($ret[$name], 'plugins/'.$name.'/'.$file);
42 42
                     }
43 43
                 }
44 44
             } 
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
      * @param array $names the plugin name strings (foldernames) in an array 
69 69
      * @return array
70 70
      */
71
-    public function getPluginsJS($names=null) {
71
+    public function getPluginsJS($names = null) {
72 72
         if ($names) {
73 73
             $names = array_merge($this->requestedPlugins, $names);
74 74
             return $this->filterPluginsByName('js', $names);
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
      * @param array $names the plugin name strings (foldernames) in an array 
82 82
      * @return array
83 83
      */
84
-    public function getPluginsCSS($names=null) {
84
+    public function getPluginsCSS($names = null) {
85 85
         if ($names) {
86 86
             $names = array_merge($this->requestedPlugins, $names);
87 87
             return $this->filterPluginsByName('css', $names);
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
      * @param array $names the plugin name strings (foldernames) in an array 
95 95
      * @return array
96 96
      */
97
-    public function getPluginsTemplates($names=null) {
97
+    public function getPluginsTemplates($names = null) {
98 98
         if ($names) {
99 99
             $names = array_merge($this->requestedPlugins, $names);
100 100
             return $this->filterPluginsByName('templates', $names);
@@ -107,15 +107,15 @@  discard block
 block discarded – undo
107 107
      * @param array $names the plugin name strings (foldernames) in an array 
108 108
      * @return array
109 109
      */
110
-    public function getTemplates($names=null) {
110
+    public function getTemplates($names = null) {
111 111
         $templateStrings = array();
112 112
         $plugins = $this->getPluginsTemplates($names);
113 113
         foreach ($plugins as $folder => $templates) {
114 114
             foreach ($templates as $path) {
115 115
                 if (file_exists($path)) {
116 116
                     $filename = explode('/', $path);
117
-                    $filename = $filename[sizeof($filename)-1];
118
-                    $id = $folder . '-' . substr($filename, 0 , (strrpos($filename, ".")));
117
+                    $filename = $filename[sizeof($filename) - 1];
118
+                    $id = $folder.'-'.substr($filename, 0, (strrpos($filename, ".")));
119 119
                     $templateStrings[$id] = file_get_contents($path);
120 120
                 }
121 121
             }
Please login to merge, or discard this patch.
model/ConceptMappingPropertyValue.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@
 block discarded – undo
22 22
     {
23 23
         $label = $this->getLabel();
24 24
         $notation = $this->getNotation();
25
-        return $notation . $label;
25
+        return $notation.$label;
26 26
     }
27 27
 
28 28
     public function getType()
Please login to merge, or discard this patch.
model/GlobalConfig.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -6,10 +6,10 @@  discard block
 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
-            $file_path = dirname(__FILE__) . $config_name;
12
+            $file_path = dirname(__FILE__).$config_name;
13 13
             if (!file_exists($file_path)) {
14 14
                 throw new Exception('config.inc file is missing, please provide one.');
15 15
             }
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
                 $this->languages = $LANGUAGES;
19 19
             }
20 20
         } catch (Exception $e) {
21
-            echo "Error: " . $e->getMessage();
21
+            echo "Error: ".$e->getMessage();
22 22
             return;
23 23
         }
24 24
     }
Please login to merge, or discard this patch.
controller/EntityController.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
         $baseurl = $this->getBaseHref();
22 22
         $vocid = $vocab->getId();
23 23
         $query = http_build_query(array('uri'=>$uri, 'format'=>$targetFormat));
24
-        $url = $baseurl . "rest/v1/$vocid/data?$query";
24
+        $url = $baseurl."rest/v1/$vocid/data?$query";
25 25
         $this->redirect303($url);
26 26
     }
27 27
     
@@ -32,11 +32,11 @@  discard block
 block discarded – undo
32 32
         $localname = $vocab->getLocalName($uri);
33 33
         if ($localname !== $uri && $localname === urlencode($localname)) {
34 34
             // the URI can be shortened
35
-            $url = $baseurl . "$vocid/page/$localname";
35
+            $url = $baseurl."$vocid/page/$localname";
36 36
         } else {
37 37
             // must use full URI
38 38
             $query = http_build_query(array('uri'=>$uri));
39
-            $url = $baseurl . "$vocid/page/?" . $query;
39
+            $url = $baseurl."$vocid/page/?".$query;
40 40
         }
41 41
         $this->redirect303($url);
42 42
     }
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
             // guess vocabulary based on URI
57 57
             $vocab = $this->model->guessVocabularyFromURI($request->getUri());
58 58
             if ($vocab === null) {
59
-                return $this->returnError('404', 'Not Found', 'Unrecognized URI ' . $request->getUri());
59
+                return $this->returnError('404', 'Not Found', 'Unrecognized URI '.$request->getUri());
60 60
             }
61 61
             $request->setVocab($vocab->getId());
62 62
         }
Please login to merge, or discard this patch.