Passed
Push — 1.10.x ( d9a04b...aeb152 )
by Yannick
123:06 queued 74:04
created
plugin/olpc_peru_filter/lib/olpc_peru_filter_plugin.class.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
         $list = $this->get_blacklist_options();
34 34
         foreach ($list as $k => $v) {
35 35
             $this->course_settings[] =
36
-              array('group'=> 'olpc_peru_filter_filter', 'name' => $k,  'type' => 'checkbox', 'init_value' => $v);
36
+              array('group'=> 'olpc_peru_filter_filter', 'name' => $k, 'type' => 'checkbox', 'init_value' => $v);
37 37
         }
38 38
         require_once dirname(__FILE__).'/../config.php';
39 39
         if (!empty($blacklist_enabled_file)) {
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
     }
66 66
 
67 67
     function course_settings_updated($values = array()) {
68
-        if (!is_array($values) or count($values)==0) {
68
+        if (!is_array($values) or count($values) == 0) {
69 69
             return false;
70 70
         }
71 71
         $this->set_blacklist_options($values['olpc_peru_filter_filter']);
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
         }
87 87
         $list = scandir($this->blacklists_dir);
88 88
         foreach ($list as $file) {
89
-            if (substr($file,0,1) == '.' or $file == 'custom_blacklist' or is_dir($this->blacklists_dir.'/'.$file)) {
89
+            if (substr($file, 0, 1) == '.' or $file == 'custom_blacklist' or is_dir($this->blacklists_dir.'/'.$file)) {
90 90
                 continue;
91 91
             }
92 92
             $categories[] = $file;
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
                 $new_blacklist .= $k."\n";
122 122
             }
123 123
         }
124
-        $r = @file_put_contents($this->blacklist_enabled_file,$new_blacklist);
124
+        $r = @file_put_contents($this->blacklist_enabled_file, $new_blacklist);
125 125
         //todo check the value or $r in $php_errormsg
126 126
         return true;
127 127
     }
Please login to merge, or discard this patch.
plugin/clockworksms/config.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@
 block discarded – undo
7 7
  * @package chamilo.plugin.clockworksms
8 8
  * @author  Imanol Losada <[email protected]>
9 9
  */
10
-require_once __DIR__ . '/../../main/inc/global.inc.php';
10
+require_once __DIR__.'/../../main/inc/global.inc.php';
11 11
 
12 12
 require_once 'lib/clockworksms.lib.php';
13 13
 require_once 'vendor/clockworksms_api.php';
Please login to merge, or discard this patch.
plugin/clockworksms/vendor/clockworksms_api.php 1 patch
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
 * @version     1.3.0
10 10
 */
11 11
 
12
-if ( !class_exists('ClockworkException') ) {
12
+if (!class_exists('ClockworkException')) {
13 13
   require_once('exception.php');
14 14
 }
15 15
 
@@ -24,25 +24,25 @@  discard block
 block discarded – undo
24 24
   /*
25 25
   * Version of this class
26 26
   */
27
-  const VERSION           = '1.3.1';
27
+  const VERSION = '1.3.1';
28 28
 
29 29
   /**
30 30
   * All Clockwork API calls start with BASE_URL
31 31
   * @author  Martin Steel
32 32
   */
33
-  const API_BASE_URL      = 'api.clockworksms.com/xml/';
33
+  const API_BASE_URL = 'api.clockworksms.com/xml/';
34 34
 
35 35
   /**
36 36
   * string to append to API_BASE_URL to check authentication
37 37
   * @author  Martin Steel
38 38
   */
39
-  const API_AUTH_METHOD   = 'authenticate';
39
+  const API_AUTH_METHOD = 'authenticate';
40 40
 
41 41
   /**
42 42
   * string to append to API_BASE_URL for sending SMS
43 43
   * @author  Martin Steel
44 44
   */
45
-  const API_SMS_METHOD    = 'sms';
45
+  const API_SMS_METHOD = 'sms';
46 46
 
47 47
   /**
48 48
   * string to append to API_BASE_URL for checking message credit
@@ -258,13 +258,13 @@  discard block
 block discarded – undo
258 258
     $err_no = null;
259 259
     $err_desc = null;
260 260
 
261
-    foreach($resp_doc->documentElement->childNodes AS $doc_child) {
262
-      switch(strtolower($doc_child->nodeName)) {
261
+    foreach ($resp_doc->documentElement->childNodes AS $doc_child) {
262
+      switch (strtolower($doc_child->nodeName)) {
263 263
         case 'sms_resp':
264 264
         $resp = array();
265 265
         $wrapper_id = null;
266
-        foreach($doc_child->childNodes AS $resp_node) {
267
-          switch(strtolower($resp_node->nodeName)) {
266
+        foreach ($doc_child->childNodes AS $resp_node) {
267
+          switch (strtolower($resp_node->nodeName)) {
268 268
             case 'messageid':
269 269
             $resp['id'] = $resp_node->nodeValue;
270 270
             break;
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
             break;
280 280
           }
281 281
         }
282
-        if( array_key_exists('error_code', $resp ) ) 
282
+        if (array_key_exists('error_code', $resp)) 
283 283
         {
284 284
           $resp['success'] = 0;
285 285
         } else {
@@ -415,7 +415,7 @@  discard block
 block discarded – undo
415 415
       throw new ClockworkException($err_desc, $err_no);
416 416
     }
417 417
         
418
-    return array( 'symbol' => $symbol, 'balance' => $balance, 'code' => $code );
418
+    return array('symbol' => $symbol, 'balance' => $balance, 'code' => $code);
419 419
   }
420 420
 
421 421
   /**
@@ -480,14 +480,14 @@  discard block
 block discarded – undo
480 480
       $this->logXML("API $method Request XML", $data);
481 481
     }
482 482
     
483
-    if( isset( $this->ssl ) ) {
483
+    if (isset($this->ssl)) {
484 484
       $ssl = $this->ssl;
485 485
     } else {
486 486
       $ssl = $this->sslSupport();
487 487
     }
488 488
 
489 489
     $url = $ssl ? 'https://' : 'http://';
490
-    $url .= self::API_BASE_URL . $method;
490
+    $url .= self::API_BASE_URL.$method;
491 491
 
492 492
     $response = $this->xmlPost($url, $data);
493 493
 
@@ -509,12 +509,12 @@  discard block
 block discarded – undo
509 509
   * @author  Martin Steel
510 510
   */
511 511
   protected function xmlPost($url, $data) {
512
-    if(extension_loaded('curl')) {
512
+    if (extension_loaded('curl')) {
513 513
       $ch = curl_init($url);
514 514
       curl_setopt($ch, CURLOPT_POST, 1);
515 515
       curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
516 516
       curl_setopt($ch, CURLOPT_HTTPHEADER, Array("Content-Type: text/xml"));
517
-      curl_setopt($ch, CURLOPT_USERAGENT, 'Clockwork PHP Wrapper/1.0' . self::VERSION);
517
+      curl_setopt($ch, CURLOPT_USERAGENT, 'Clockwork PHP Wrapper/1.0'.self::VERSION);
518 518
       curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
519 519
       if (isset($this->proxy_host) && isset($this->proxy_port)) {
520 520
         curl_setopt($ch, CURLOPT_PROXY, $this->proxy_host);
@@ -525,9 +525,9 @@  discard block
 block discarded – undo
525 525
       $info = curl_getinfo($ch);
526 526
 
527 527
       if ($response === false || $info['http_code'] != 200) {
528
-        throw new Exception('HTTP Error calling Clockwork API - HTTP Status: ' . $info['http_code'] . ' - cURL Erorr: ' . curl_error($ch));
528
+        throw new Exception('HTTP Error calling Clockwork API - HTTP Status: '.$info['http_code'].' - cURL Erorr: '.curl_error($ch));
529 529
       } elseif (curl_errno($ch) > 0) {
530
-        throw new Exception('HTTP Error calling Clockwork API - cURL Error: ' . curl_error($ch));
530
+        throw new Exception('HTTP Error calling Clockwork API - cURL Error: '.curl_error($ch));
531 531
       }
532 532
 
533 533
       curl_close($ch);
@@ -536,31 +536,31 @@  discard block
 block discarded – undo
536 536
     } elseif (function_exists('stream_get_contents')) {
537 537
       // Enable error Track Errors
538 538
       $track = ini_get('track_errors');
539
-      ini_set('track_errors',true);
539
+      ini_set('track_errors', true);
540 540
 
541 541
       $params = array('http' => array(
542 542
       'method'  => 'POST',
543
-      'header'  => "Content-Type: text/xml\r\nUser-Agent: mediaburst PHP Wrapper/" . self::VERSION . "\r\n",
543
+      'header'  => "Content-Type: text/xml\r\nUser-Agent: mediaburst PHP Wrapper/".self::VERSION."\r\n",
544 544
       'content' => $data
545 545
       ));
546 546
 
547 547
       if (isset($this->proxy_host) && isset($this->proxy_port)) {
548
-        $params['http']['proxy'] = 'tcp://'.$this->proxy_host . ':' . $this->proxy_port;
548
+        $params['http']['proxy'] = 'tcp://'.$this->proxy_host.':'.$this->proxy_port;
549 549
         $params['http']['request_fulluri'] = True;
550 550
       }
551 551
 
552 552
       $ctx = stream_context_create($params);
553 553
       $fp = @fopen($url, 'rb', false, $ctx);
554 554
       if (!$fp) {
555
-        ini_set('track_errors',$track);
555
+        ini_set('track_errors', $track);
556 556
         throw new Exception("HTTP Error calling Clockwork API - fopen Error: $php_errormsg");
557 557
       }
558 558
       $response = @stream_get_contents($fp);
559 559
       if ($response === false) {
560
-        ini_set('track_errors',$track);
560
+        ini_set('track_errors', $track);
561 561
         throw new Exception("HTTP Error calling Clockwork API - stream Error: $php_errormsg");
562 562
       }
563
-      ini_set('track_errors',$track);
563
+      ini_set('track_errors', $track);
564 564
       return $response;
565 565
     } else {
566 566
       throw new Exception("Clockwork requires PHP5 with cURL or HTTP stream support");
@@ -624,7 +624,7 @@  discard block
 block discarded – undo
624 624
   * @author  Martin Steel
625 625
   */
626 626
   protected function is_assoc($array) {
627
-    return (bool)count(array_filter(array_keys($array), 'is_string'));
627
+    return (bool) count(array_filter(array_keys($array), 'is_string'));
628 628
   }
629 629
   
630 630
   /**
@@ -637,7 +637,7 @@  discard block
 block discarded – undo
637 637
    * @todo Take an optional country code and check that the number starts with it
638 638
    */
639 639
   public static function is_valid_msisdn($val) {
640
-    return preg_match( '/^[1-9][0-9]{7,12}$/', $val );
640
+    return preg_match('/^[1-9][0-9]{7,12}$/', $val);
641 641
   }
642 642
 
643 643
 }
Please login to merge, or discard this patch.
plugin/clockworksms/vendor/exception.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -20,8 +20,8 @@
 block discarded – undo
20 20
  */
21 21
 class ClockworkException extends Exception {
22 22
 
23
-    public function __construct( $message, $code = 0 ) {
23
+    public function __construct($message, $code = 0) {
24 24
         // make sure everything is assigned properly
25
-        parent::__construct( $message, $code );
25
+        parent::__construct($message, $code);
26 26
     }
27 27
 }
Please login to merge, or discard this patch.
plugin/static/plugin.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@
 block discarded – undo
6 6
  * @author Laurent Opprecht
7 7
  */
8 8
 
9
-require_once api_get_path(LIBRARY_PATH) . 'plugin.class.php';
10
-require_once dirname(__FILE__) . '/lib/static_plugin.class.php';
9
+require_once api_get_path(LIBRARY_PATH).'plugin.class.php';
10
+require_once dirname(__FILE__).'/lib/static_plugin.class.php';
11 11
 
12 12
 $plugin_info = StaticPlugin::create()->get_info();
13 13
\ No newline at end of file
Please login to merge, or discard this patch.
plugin/search_course/index.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-require_once dirname(__FILE__) . '/lib/search_course_widget.class.php';
3
+require_once dirname(__FILE__).'/lib/search_course_widget.class.php';
4 4
 $widget = new SearchCourseWidget();
5 5
 $widget->run();
Please login to merge, or discard this patch.
plugin/search_course/plugin.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@
 block discarded – undo
5 5
  * @author Laurent Opprecht
6 6
  */
7 7
 
8
-require_once api_get_path(LIBRARY_PATH) . 'plugin.class.php';
9
-require_once dirname(__FILE__) . '/lib/search_course_plugin.class.php';
8
+require_once api_get_path(LIBRARY_PATH).'plugin.class.php';
9
+require_once dirname(__FILE__).'/lib/search_course_plugin.class.php';
10 10
 
11 11
 $plugin_info = SearchCoursePlugin::create()->get_info();
12 12
\ No newline at end of file
Please login to merge, or discard this patch.
plugin/search_course/lib/search_course_widget.class.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-require_once dirname(__FILE__) . '/register_course_widget.class.php';
3
+require_once dirname(__FILE__).'/register_course_widget.class.php';
4 4
 
5 5
 /**
6 6
  * Search course widget.
@@ -60,12 +60,12 @@  discard block
 block discarded – undo
60 60
         $url = self::server('REQUEST_URI');
61 61
         $url = explode('?', $url);
62 62
         $url = reset($url);
63
-        $url = self::server('SERVER_NAME') . $url;
63
+        $url = self::server('SERVER_NAME').$url;
64 64
 
65 65
         $root = api_get_path('WEB_PATH');
66 66
         $root = str_replace('https://', '', $root);
67 67
         $root = str_replace('http://', '', $root);
68
-        $index_url = $root . 'index.php';
68
+        $index_url = $root.'index.php';
69 69
 
70 70
         return $url == $index_url || $url == $root;
71 71
     }
@@ -80,12 +80,12 @@  discard block
 block discarded – undo
80 80
         $url = self::server('REQUEST_URI');
81 81
         $url = explode('?', $url);
82 82
         $url = reset($url);
83
-        $url = self::server('SERVER_NAME') . $url;
83
+        $url = self::server('SERVER_NAME').$url;
84 84
 
85 85
         $root = api_get_path('WEB_PATH');
86 86
         $root = str_replace('https://', '', $root);
87 87
         $root = str_replace('http://', '', $root);
88
-        $index_url = $root . 'user_portal.php';
88
+        $index_url = $root.'user_portal.php';
89 89
 
90 90
         return $url == $index_url || $url == $root;
91 91
     }
@@ -153,8 +153,8 @@  discard block
 block discarded – undo
153 153
             $parameters[self::PARAM_ACTION] = $action;
154 154
         }
155 155
         $parameters = implode('&', $parameters);
156
-        $parameters = $parameters ? '?' . $parameters : '';
157
-        return $self . $parameters;
156
+        $parameters = $parameters ? '?'.$parameters : '';
157
+        return $self.$parameters;
158 158
     }
159 159
 
160 160
     /**
@@ -241,8 +241,8 @@  discard block
 block discarded – undo
241 241
             $details = implode(' - ', $details);
242 242
             $title = $course['title'];
243 243
 
244
-            $href = api_get_path(WEB_COURSE_PATH).$course['code'] .'/index.php';
245
-            echo '<tr><td><b><a href="' . $href . '">' . "$title</a></b><br/>$details</td><td>";
244
+            $href = api_get_path(WEB_COURSE_PATH).$course['code'].'/index.php';
245
+            echo '<tr><td><b><a href="'.$href.'">'."$title</a></b><br/>$details</td><td>";
246 246
             if (!api_is_anonymous()) {
247 247
                 if ($course['registration_code']) {
248 248
                     Display::display_icon(
@@ -336,13 +336,13 @@  discard block
 block discarded – undo
336 336
 
337 337
         if (api_is_anonymous())
338 338
         {
339
-            $course_fiter = 'visibility = ' . COURSE_VISIBILITY_OPEN_WORLD;
339
+            $course_fiter = 'visibility = '.COURSE_VISIBILITY_OPEN_WORLD;
340 340
         }
341 341
         else
342 342
         {
343
-            $course_fiter = 'visibility = ' . COURSE_VISIBILITY_OPEN_WORLD . ' OR ';
344
-            $course_fiter .= 'visibility = ' . COURSE_VISIBILITY_OPEN_PLATFORM . ' OR ';
345
-            $course_fiter .= '(visibility = ' . COURSE_VISIBILITY_REGISTERED . ' AND subscribe = 1)';
343
+            $course_fiter = 'visibility = '.COURSE_VISIBILITY_OPEN_WORLD.' OR ';
344
+            $course_fiter .= 'visibility = '.COURSE_VISIBILITY_OPEN_PLATFORM.' OR ';
345
+            $course_fiter .= '(visibility = '.COURSE_VISIBILITY_REGISTERED.' AND subscribe = 1)';
346 346
         }
347 347
 
348 348
         $sql = <<<EOT
Please login to merge, or discard this patch.
plugin/add_cas_logout_button/index.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,20 +1,20 @@
 block discarded – undo
1 1
 <?php
2 2
 // Show the CAS button to logout to your CAS session
3 3
 global $_user;
4
-$_template['show_message']   = false;
4
+$_template['show_message'] = false;
5 5
 
6 6
 if (!api_is_anonymous() &&
7 7
     api_get_setting('cas_activate') == 'true' &&
8 8
     $_user['auth_source'] == CAS_AUTH_SOURCE
9 9
 ) {
10
-    $_template['show_message']   = true;
10
+    $_template['show_message'] = true;
11 11
     // the default title
12 12
     $logout_label = "Deconnexion de CAS";
13 13
     if (!empty($plugin_info['settings']['add_cas_logout_button_cas_logout_label'])) {
14 14
         $logout_label = api_htmlentities($plugin_info['settings']['add_cas_logout_button_cas_logout_label']);
15 15
     }
16 16
     // the comm
17
-    $logout_comment = api_htmlentities($plugin_info['settings']['add_cas_logout_button_cas_logout_comment']);;
17
+    $logout_comment = api_htmlentities($plugin_info['settings']['add_cas_logout_button_cas_logout_comment']); ;
18 18
     // URL of the image
19 19
     $logout_image_url = $plugin_info['settings']['add_cas_logout_button_cas_logout_image_url'];
20 20
 
Please login to merge, or discard this patch.