Completed
Push — master ( b71895...c089ba )
by Henri
18:56
created
model/ConceptPropertyValue.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 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;
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
     public function getReifiedPropertyValues() {
121 121
         $ret = array();
122 122
         $props = $this->resource->propertyUris();
123
-        foreach($props as $prop) {
123
+        foreach ($props as $prop) {
124 124
             $prop = (EasyRdf_Namespace::shorten($prop) !== null) ? EasyRdf_Namespace::shorten($prop) : $prop;
125 125
             foreach ($this->resource->allLiterals($prop) as $val) {
126 126
                 if ($prop !== 'rdf:value' && $this->resource->get($prop)) { // shown elsewhere
Please login to merge, or discard this patch.
model/Cache.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@
 block discarded – undo
22 22
     /**
23 23
      * Wraps apc_store() and apcu_store()
24 24
      */
25
-    public function store($key, $value, $ttl=3600) {
25
+    public function store($key, $value, $ttl = 3600) {
26 26
         if (function_exists('apc_store')) {
27 27
             return apc_store($key, $value);
28 28
         } 
Please login to merge, or discard this 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.
controller/Honeypot.php 2 patches
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.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -32,9 +32,9 @@  discard block
 block discarded – undo
32 32
     {
33 33
         // Encrypt the current time
34 34
         $honey_time_encrypted = $this->getEncryptedTime();
35
-        $html = '<div id="' . $honey_name . '_wrap" style="display:none;">' . "\r\n" .
36
-                    '<input name="' . $honey_name . '" type="text" value="" id="' . $honey_name . '"/>' . "\r\n" .
37
-                    '<input name="' . $honey_time . '" type="text" value="' . $honey_time_encrypted . '"/>' . "\r\n" .
35
+        $html = '<div id="'.$honey_name.'_wrap" style="display:none;">'."\r\n".
36
+                    '<input name="'.$honey_name.'" type="text" value="" id="'.$honey_name.'"/>'."\r\n".
37
+                    '<input name="'.$honey_time.'" type="text" value="'.$honey_time_encrypted.'"/>'."\r\n".
38 38
                 '</div>';
39 39
         return $html;
40 40
     }
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
         // Get the decrypted time
68 68
         $value = $this->decryptTime($value);
69 69
         // The current time should be greater than the time the form was built + the speed option
70
-        return ( is_numeric($value) && time() > ($value + $parameters[0]) );
70
+        return (is_numeric($value) && time() > ($value + $parameters[0]));
71 71
     }
72 72
     /**
73 73
      * Get encrypted time
Please login to merge, or discard this patch.
model/SkosmosTurtleParser.php 2 patches
Doc Comments   +1 added lines patch added patch discarded remove patch
@@ -55,6 +55,7 @@
 block discarded – undo
55 55
 
56 56
     /**
57 57
      * Steps back, restoring the previous character or statement read() to the input buffer.
58
+     * @param string $chars
58 59
      */
59 60
     protected function unread($chars)
60 61
     {
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
      */
22 22
     protected function peek()
23 23
     {
24
-        if(!$this->dataLength) { $this->dataLength = strlen($this->data); }
24
+        if (!$this->dataLength) { $this->dataLength = strlen($this->data); }
25 25
         if ($this->dataLength > $this->bytePos) {
26 26
             $slice = substr($this->data, $this->bytePos, 4);
27 27
             return mb_substr($slice, 0, 1, "UTF-8");
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
     {
79 79
         if ($this->bytePos - 4 > 0) {
80 80
             $slice = substr($this->data, $this->bytePos - 4, 4);
81
-            while($slice != '') {
81
+            while ($slice != '') {
82 82
                 if (!self::isWhitespace(mb_substr($slice, -1, 1, "UTF-8"))) {
83 83
                     return;
84 84
                 }
Please login to merge, or discard this patch.
controller/WebController.php 1 patch
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
 
66 66
         // register a Twig filter for generating URLs for vocabulary resources (concepts and groups)
67 67
         $controller = $this; // for use by anonymous function below
68
-        $urlFilter = new Twig_SimpleFilter('link_url', function ($uri, $vocab, $lang, $type = 'page', $clang = null, $term = null) use ($controller) {
68
+        $urlFilter = new Twig_SimpleFilter('link_url', function($uri, $vocab, $lang, $type = 'page', $clang = null, $term = null) use ($controller) {
69 69
             // $vocab can either be null, a vocabulary id (string) or a Vocabulary object
70 70
             if ($vocab === null) {
71 71
                 // target vocabulary is unknown, best bet is to link to the plain URI
@@ -90,23 +90,23 @@  discard block
 block discarded – undo
90 90
             $localname = $vocab->getLocalName($uri);
91 91
             if ($localname !== $uri && $localname === urlencode($localname)) {
92 92
                 // check that the prefix stripping worked, and there are no problematic chars in localname
93
-                $paramstr = sizeof($params) > 0 ? '?' . http_build_query($params) : '';
93
+                $paramstr = sizeof($params) > 0 ? '?'.http_build_query($params) : '';
94 94
                 if ($type && $type !== '' && $type !== 'vocab' && !($localname === '' && $type === 'page')) {
95
-                    return "$vocid/$lang/$type/$localname" . $paramstr;
95
+                    return "$vocid/$lang/$type/$localname".$paramstr;
96 96
                 }
97 97
 
98
-                return "$vocid/$lang/$localname" . $paramstr;
98
+                return "$vocid/$lang/$localname".$paramstr;
99 99
             }
100 100
 
101 101
             // case 2: URI outside vocabulary namespace, or has problematic chars
102 102
             // pass the full URI as parameter instead
103 103
             $params['uri'] = $uri;
104
-            return "$vocid/$lang/$type/?" . http_build_query($params);
104
+            return "$vocid/$lang/$type/?".http_build_query($params);
105 105
         });
106 106
         $this->twig->addFilter($urlFilter);
107 107
 
108 108
         // register a Twig filter for generating strings from language codes with CLDR
109
-        $langFilter = new Twig_SimpleFilter('lang_name', function ($langcode, $lang) {
109
+        $langFilter = new Twig_SimpleFilter('lang_name', function($langcode, $lang) {
110 110
             return Language::getName($langcode, $lang);
111 111
         });
112 112
         $this->twig->addFilter($langFilter);
@@ -273,12 +273,12 @@  discard block
 block discarded – undo
273 273
     private function createFeedbackHeaders($fromName, $fromEmail, $toMail)
274 274
     {
275 275
         $headers = "MIME-Version: 1.0″ . '\r\n";
276
-        $headers .= "Content-type: text/html; charset=UTF-8" . "\r\n";
276
+        $headers .= "Content-type: text/html; charset=UTF-8"."\r\n";
277 277
         if ($toMail) {
278
-            $headers .= "Cc: " . $this->model->getConfig()->getFeedbackAddress() . "\r\n";
278
+            $headers .= "Cc: ".$this->model->getConfig()->getFeedbackAddress()."\r\n";
279 279
         }
280 280
 
281
-        $headers .= "From: $fromName <$fromEmail>" . "\r\n" . 'X-Mailer: PHP/' . phpversion();
281
+        $headers .= "From: $fromName <$fromEmail>"."\r\n".'X-Mailer: PHP/'.phpversion();
282 282
         return $headers;
283 283
     }
284 284
 
@@ -293,20 +293,20 @@  discard block
 block discarded – undo
293 293
     {
294 294
         $toAddress = ($toMail) ? $toMail : $this->model->getConfig()->getFeedbackAddress();
295 295
         if ($fromVocab !== null && $fromVocab !== '') {
296
-            $message = 'Feedback from vocab: ' . strtoupper($fromVocab) . "<br />" . $message;
296
+            $message = 'Feedback from vocab: '.strtoupper($fromVocab)."<br />".$message;
297 297
         }
298 298
 
299
-        $subject = SERVICE_NAME . " feedback";
299
+        $subject = SERVICE_NAME." feedback";
300 300
         $headers = $this->createFeedbackHeaders($fromName, $fromEmail, $toMail);
301 301
         $envelopeSender = FEEDBACK_ENVELOPE_SENDER;
302 302
         $params = empty($envelopeSender) ? '' : "-f $envelopeSender";
303 303
 
304 304
         // adding some information about the user for debugging purposes.
305
-        $message = $message . "<br /><br /> Debugging information:"
306
-            . "<br />Timestamp: " . date(DATE_RFC2822)
307
-            . "<br />User agent: " . $request->getServerConstant('HTTP_USER_AGENT')
308
-            . "<br />IP address: " . $request->getServerConstant('REMOTE_ADDR')
309
-            . "<br />Referer: " . $request->getServerConstant('HTTP_REFERER');
305
+        $message = $message."<br /><br /> Debugging information:"
306
+            . "<br />Timestamp: ".date(DATE_RFC2822)
307
+            . "<br />User agent: ".$request->getServerConstant('HTTP_USER_AGENT')
308
+            . "<br />IP address: ".$request->getServerConstant('REMOTE_ADDR')
309
+            . "<br />Referer: ".$request->getServerConstant('HTTP_REFERER');
310 310
 
311 311
         try {
312 312
             mail($toAddress, $subject, $message, $headers, $params);
@@ -314,7 +314,7 @@  discard block
 block discarded – undo
314 314
             header("HTTP/1.0 404 Not Found");
315 315
             $template = $this->twig->loadTemplate('error-page.twig');
316 316
             if ($this->model->getConfig()->getLogCaughtExceptions()) {
317
-                error_log('Caught exception: ' . $e->getMessage());
317
+                error_log('Caught exception: '.$e->getMessage());
318 318
             }
319 319
 
320 320
             echo $template->render(
@@ -361,7 +361,7 @@  discard block
 block discarded – undo
361 361
         $vocids = ($vocabs !== null && $vocabs !== '') ? explode(' ', $vocabs) : null;
362 362
         $vocabObjects = array();
363 363
         if ($vocids) {
364
-            foreach($vocids as $vocid) {
364
+            foreach ($vocids as $vocid) {
365 365
                 $vocabObjects[] = $this->model->getVocabulary($vocid);
366 366
             }
367 367
         }
@@ -372,7 +372,7 @@  discard block
 block discarded – undo
372 372
         } catch (Exception $e) {
373 373
             header("HTTP/1.0 404 Not Found");
374 374
             if ($this->model->getConfig()->getLogCaughtExceptions()) {
375
-                error_log('Caught exception: ' . $e->getMessage());
375
+                error_log('Caught exception: '.$e->getMessage());
376 376
             }
377 377
             $this->invokeGenericErrorPage($request, $e->getMessage());
378 378
             return;
@@ -388,7 +388,7 @@  discard block
 block discarded – undo
388 388
                 'search_count' => $counts,
389 389
                 'languages' => $this->languages,
390 390
                 'search_results' => $searchResults,
391
-                'rest' => $parameters->getOffset()>0,
391
+                'rest' => $parameters->getOffset() > 0,
392 392
                 'global_search' => true,
393 393
                 'term' => $request->getQueryParam('q'),
394 394
                 'lang_list' => $langList,
@@ -413,7 +413,7 @@  discard block
 block discarded – undo
413 413
         } catch (Exception $e) {
414 414
             header("HTTP/1.0 404 Not Found");
415 415
             if ($this->model->getConfig()->getLogCaughtExceptions()) {
416
-                error_log('Caught exception: ' . $e->getMessage());
416
+                error_log('Caught exception: '.$e->getMessage());
417 417
             }
418 418
 
419 419
             echo $template->render(
@@ -434,7 +434,7 @@  discard block
 block discarded – undo
434 434
         } catch (Exception $e) {
435 435
             header("HTTP/1.0 404 Not Found");
436 436
             if ($this->model->getConfig()->getLogCaughtExceptions()) {
437
-                error_log('Caught exception: ' . $e->getMessage());
437
+                error_log('Caught exception: '.$e->getMessage());
438 438
             }
439 439
 
440 440
             echo $template->render(
@@ -451,7 +451,7 @@  discard block
 block discarded – undo
451 451
                 'vocab' => $vocab,
452 452
                 'search_results' => $searchResults,
453 453
                 'search_count' => $counts,
454
-                'rest' => $parameters->getOffset()>0,
454
+                'rest' => $parameters->getOffset() > 0,
455 455
                 'limit_parent' => $parameters->getParentLimit(),
456 456
                 'limit_type' =>  $request->getQueryParam('type') ? explode('+', $request->getQueryParam('type')) : null,
457 457
                 'limit_group' => $parameters->getGroupLimit(),
@@ -576,7 +576,7 @@  discard block
 block discarded – undo
576 576
      * Loads and renders the view containing a list of recent changes in the vocabulary.
577 577
      * @param Request $request
578 578
      */
579
-    public function invokeChangeList($request, $prop='dc:created')
579
+    public function invokeChangeList($request, $prop = 'dc:created')
580 580
     {
581 581
         // set language parameters for gettext
582 582
         $this->setLanguageProperties($request->getLang());
Please login to merge, or discard this patch.