Completed
Push — master ( 5da9ea...eef579 )
by Angel Fernando Quiroz
50:18 queued 17:36
created
src/Chamilo/UserBundle/Entity/Manager/UserManager.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@
 block discarded – undo
31 31
      */
32 32
     public function findUserByOfficialCode($code)
33 33
     {
34
-        $criteria = ['officialCode' => $code ];
34
+        $criteria = ['officialCode' => $code];
35 35
         return $this->findUserBy($criteria);
36 36
     }
37 37
 }
Please login to merge, or discard this patch.
plugin/bbb/listing.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -11,12 +11,12 @@  discard block
 block discarded – undo
11 11
 $tool_name = $plugin->get_lang('Videoconference');
12 12
 
13 13
 $htmlHeadXtra[] = api_get_js('plugins/bbb/utils.js');
14
-$htmlHeadXtra[] = "<script>var _p = {web_plugin: '" . api_get_path(WEB_PLUGIN_PATH). "'}</script>";
14
+$htmlHeadXtra[] = "<script>var _p = {web_plugin: '".api_get_path(WEB_PLUGIN_PATH)."'}</script>";
15 15
 
16 16
 $tpl = new Template($tool_name);
17 17
 
18 18
 $isGlobal = isset($_GET['global']) ? true : false;
19
-$isGlobalPerUser = isset($_GET['user_id']) ? (int) $_GET['user_id']: false;
19
+$isGlobalPerUser = isset($_GET['user_id']) ? (int) $_GET['user_id'] : false;
20 20
 
21 21
 $bbb = new bbb('', '', $isGlobal, $isGlobalPerUser);
22 22
 $action = isset($_GET['action']) ? $_GET['action'] : null;
@@ -88,21 +88,21 @@  discard block
 block discarded – undo
88 88
             $bbb->endMeeting($_GET['id']);
89 89
             Display::addFlash(
90 90
                 Display::return_message(
91
-                    $plugin->get_lang('MeetingClosed') . '<br />' .
91
+                    $plugin->get_lang('MeetingClosed').'<br />'.
92 92
                     $plugin->get_lang('MeetingClosedComment'),
93 93
                     'success',
94 94
                     false
95 95
                 )
96 96
             );
97 97
 
98
-            if (file_exists(__DIR__ . '/config.vm.php')) {
99
-                require __DIR__ . '/../../vendor/autoload.php';
100
-                require __DIR__ . '/lib/vm/AbstractVM.php';
101
-                require __DIR__ . '/lib/vm/VMInterface.php';
102
-                require __DIR__ . '/lib/vm/DigitalOceanVM.php';
103
-                require __DIR__ . '/lib/VM.php';
98
+            if (file_exists(__DIR__.'/config.vm.php')) {
99
+                require __DIR__.'/../../vendor/autoload.php';
100
+                require __DIR__.'/lib/vm/AbstractVM.php';
101
+                require __DIR__.'/lib/vm/VMInterface.php';
102
+                require __DIR__.'/lib/vm/DigitalOceanVM.php';
103
+                require __DIR__.'/lib/VM.php';
104 104
 
105
-                $config = require __DIR__ . '/config.vm.php';
105
+                $config = require __DIR__.'/config.vm.php';
106 106
 
107 107
                 $vm = new VM($config);
108 108
                 $vm->resizeToMinLimit();
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
     $actionLinks = [
204 204
         Display::toolbarButton(
205 205
             $plugin->get_lang('AdminView'),
206
-            api_get_path(WEB_PLUGIN_PATH) . 'bbb/admin.php?'.api_get_cidreq(),
206
+            api_get_path(WEB_PLUGIN_PATH).'bbb/admin.php?'.api_get_cidreq(),
207 207
             'list',
208 208
             'primary'
209 209
         )
Please login to merge, or discard this patch.
plugin/before_login/plugin.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@
 block discarded – undo
42 42
 
43 43
 $plugin_info['templates'] = array('template.tpl');
44 44
 if (file_exists(__DIR__.'/custom.template.tpl')) {
45
-    $plugin_info['templates'] = array( 'custom.template.tpl');
45
+    $plugin_info['templates'] = array('custom.template.tpl');
46 46
 }
47 47
 $form->setDefaults($defaults);
48 48
 
Please login to merge, or discard this patch.
plugin/add_cas_login_button/plugin.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@
 block discarded – undo
29 29
 
30 30
 $defaults = array();
31 31
 $defaults['cas_button_label'] = api_get_plugin_setting('add_cas_login_button', 'cas_button_label');
32
-$defaults['cas_button_comment'] = api_get_plugin_setting('add_cas_login_button','cas_button_comment');
32
+$defaults['cas_button_comment'] = api_get_plugin_setting('add_cas_login_button', 'cas_button_comment');
33 33
 $defaults['cas_image_url'] = api_get_plugin_setting('add_cas_login_button', 'cas_image_url');
34 34
 $form->setDefaults($defaults);
35 35
 //display form
Please login to merge, or discard this patch.
main/inc/lib/formvalidator/Element/Color.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@
 block discarded – undo
34 34
      */
35 35
     public function toHtml()
36 36
     {
37
-        return parent::toHtml() . <<<JS
37
+        return parent::toHtml().<<<JS
38 38
             <script>
39 39
                 $(document).on('ready', function () {
40 40
                     var txtColor = $('#{$this->getAttribute('id')}'),
Please login to merge, or discard this patch.
main/survey/survey_question.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
         if ($surveyData['survey_type'] == 1) {
65 65
             $table_survey_question_group = Database::get_course_table(TABLE_SURVEY_QUESTION_GROUP);
66 66
             $sql = 'SELECT id,name FROM '.$table_survey_question_group.'
67
-                    WHERE survey_id = '.(int)$_GET['survey_id'].'
67
+                    WHERE survey_id = '.(int) $_GET['survey_id'].'
68 68
                     ORDER BY name';
69 69
             $rs = Database::query($sql);
70 70
             $glist = null;
@@ -75,15 +75,15 @@  discard block
 block discarded – undo
75 75
             $grouplist = $grouplist1 = $grouplist2 = $glist;
76 76
 
77 77
             if (!empty($formData['assigned'])) {
78
-                $grouplist = str_replace('<option value="'.$formData['assigned'].'"','<option value="'.$formData['assigned'].'" selected',$glist);
78
+                $grouplist = str_replace('<option value="'.$formData['assigned'].'"', '<option value="'.$formData['assigned'].'" selected', $glist);
79 79
             }
80 80
 
81 81
             if (!empty($formData['assigned1'])) {
82
-                $grouplist1 = str_replace('<option value="'.$formData['assigned1'].'"','<option value="'.$formData['assigned1'].'" selected',$glist);
82
+                $grouplist1 = str_replace('<option value="'.$formData['assigned1'].'"', '<option value="'.$formData['assigned1'].'" selected', $glist);
83 83
             }
84 84
 
85 85
             if (!empty($formData['assigned2'])) {
86
-                $grouplist2 = str_replace('<option value="'.$formData['assigned2'].'"','<option value="'.$formData['assigned2'].'" selected',$glist);
86
+                $grouplist2 = str_replace('<option value="'.$formData['assigned2'].'"', '<option value="'.$formData['assigned2'].'" selected', $glist);
87 87
             }
88 88
 
89 89
             $this->html .= '	<tr><td colspan="">
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 
96 96
             $this->html .= '
97 97
 			<b>'.get_lang('Secondary').'</b><br />
98
-			'.'<input type="radio" name="choose" value="2" '.(($formData['choose']==2)?'checked':'').
98
+			'.'<input type="radio" name="choose" value="2" '.(($formData['choose'] == 2) ? 'checked' : '').
99 99
                 '><select name="assigned1">'.$grouplist1.'</select> '.
100 100
                 '<select name="assigned2">'.$grouplist2.'</select>'
101 101
                 .'</fieldset><br />';
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
                     <div class="form-group">
132 132
                         <label class="col-sm-2 control-label"></label>
133 133
                         <div class="col-sm-8">
134
-                            <div class="alert alert-info">' . get_lang('YouCantNotEditThisQuestionBecauseAlreadyExistAnswers') . '</div>
134
+                            <div class="alert alert-info">' . get_lang('YouCantNotEditThisQuestionBecauseAlreadyExistAnswers').'</div>
135 135
                         </div>
136 136
                         <div class="col-sm-2"></div>
137 137
                     </div>
Please login to merge, or discard this patch.
main/inc/lib/agenda.lib.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -3151,12 +3151,12 @@
 block discarded – undo
3151 3151
                     $end->format('e')
3152 3152
                 );
3153 3153
                 $title = api_convert_encoding(
3154
-                    (string)$event->summary,
3154
+                    (string) $event->summary,
3155 3155
                     $charset,
3156 3156
                     'UTF-8'
3157 3157
                 );
3158 3158
                 $description = api_convert_encoding(
3159
-                    (string)$event->description,
3159
+                    (string) $event->description,
3160 3160
                     $charset,
3161 3161
                     'UTF-8'
3162 3162
                 );
Please login to merge, or discard this patch.
plugin/vchamilo/cli/clilib.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -6,12 +6,12 @@  discard block
 block discarded – undo
6 6
 * @param string $location
7 7
 *
8 8
 */
9
-function vchamilo_parse_csv_nodelist($nodelistlocation = '', $plugin = null){
9
+function vchamilo_parse_csv_nodelist($nodelistlocation = '', $plugin = null) {
10 10
     global $_configuration;
11 11
 
12 12
     $vnodes = array();
13 13
 
14
-    if (empty($nodelistlocation)){
14
+    if (empty($nodelistlocation)) {
15 15
         $nodelistlocation = $_configuratioh['root_sys'].'/plugin/vchamilo/nodelist.csv';
16 16
     }
17 17
 
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
     // Jump any empty or comment line
71 71
     $text = fgets($fp, 1024);
72 72
     $i = 0;
73
-    while(vchamilo_is_empty_line_or_format($text, $i == 0)){
73
+    while (vchamilo_is_empty_line_or_format($text, $i == 0)) {
74 74
         $text = fgets($fp, 1024);
75 75
         $i++;
76 76
     }
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
     // Check for valid field names
81 81
     foreach ($headers as $h) {
82 82
         $header[] = trim($h);
83
-        $patternized = implode('|', $patterns) . "\\d+";
83
+        $patternized = implode('|', $patterns)."\\d+";
84 84
         $metapattern = implode('|', $metas);
85 85
         if (!(isset($required[$h]) ||
86 86
                 isset($optionalDefaults[$h]) ||
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
     $linenum = 2; // Since header is line 1.
110 110
 
111 111
     // Take some from admin profile, other fixed by hardcoded defaults.
112
-    while (!feof ($fp)) {
112
+    while (!feof($fp)) {
113 113
 
114 114
         // Make a new base record.
115 115
         $vnode = new StdClass();
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
  * @param bool $casesensitive true if options are case sensitive
197 197
  * @return string entered text
198 198
  */
199
-function cli_input($prompt, $default='', array $options=null, $casesensitiveoptions=false) {
199
+function cli_input($prompt, $default = '', array $options = null, $casesensitiveoptions = false) {
200 200
     echo $prompt;
201 201
     echo "\n: ";
202 202
     $input = fread(STDIN, 2048);
@@ -222,8 +222,8 @@  discard block
 block discarded – undo
222 222
  * @param array $shortmapping array describing mapping of short to long style options ex:('h'=>'help', 'v'=>'verbose')
223 223
  * @return array array of arrays, options, unrecognised as optionlongname=>value
224 224
  */
225
-function cli_get_params(array $longoptions, array $shortmapping=null) {
226
-    $shortmapping = (array)$shortmapping;
225
+function cli_get_params(array $longoptions, array $shortmapping = null) {
226
+    $shortmapping = (array) $shortmapping;
227 227
     $options      = array();
228 228
     $unrecognized = array();
229 229
 
@@ -292,7 +292,7 @@  discard block
 block discarded – undo
292 292
  * @param bool $return false means print, true return as string
293 293
  * @return mixed void or string
294 294
  */
295
-function cli_separator($return=false) {
295
+function cli_separator($return = false) {
296 296
     $separator = str_repeat('-', 79)."\n";
297 297
     if ($return) {
298 298
         return $separator;
@@ -307,7 +307,7 @@  discard block
 block discarded – undo
307 307
  * @param bool $return false means print, true return as string
308 308
  * @return mixed void or string
309 309
  */
310
-function cli_heading($string, $return=false) {
310
+function cli_heading($string, $return = false) {
311 311
     $string = "== $string ==\n";
312 312
     if ($return) {
313 313
         return $string;
Please login to merge, or discard this patch.
plugin/vchamilo/vcron.php 1 patch
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -30,13 +30,13 @@  discard block
 block discarded – undo
30 30
 global $VCRON;
31 31
 
32 32
 $VCRON = new stdClass();
33
-$VCRON->ACTIVATION = 'cli';                         // choose how individual cron are launched, 'cli' or 'web'
34
-$VCRON->STRATEGY = ROUND_ROBIN ;                    // choose vcron rotation mode
35
-$VCRON->PERIOD = 15 * MINSECS ;                     // used if LOWEST_POSSIBLE_GAP to setup the max gap
36
-$VCRON->TIMEOUT = 300;                              // time out for CURL call to effective cron
33
+$VCRON->ACTIVATION = 'cli'; // choose how individual cron are launched, 'cli' or 'web'
34
+$VCRON->STRATEGY = ROUND_ROBIN; // choose vcron rotation mode
35
+$VCRON->PERIOD = 15 * MINSECS; // used if LOWEST_POSSIBLE_GAP to setup the max gap
36
+$VCRON->TIMEOUT = 300; // time out for CURL call to effective cron
37 37
 // $VCRON->TRACE = $_configuration['root_sys'].'plugin/vchamilo/log/vcrontrace.log';   // Trace file where to collect cron outputs
38
-$VCRON->TRACE = '/data/log/chamilo/vcrontrace.log';   // Trace file where to collect cron outputs
39
-$VCRON->TRACE_ENABLE = true;                        // enables tracing
38
+$VCRON->TRACE = '/data/log/chamilo/vcrontrace.log'; // Trace file where to collect cron outputs
39
+$VCRON->TRACE_ENABLE = true; // enables tracing
40 40
 
41 41
 if (!is_dir($_configuration['root_sys'].'plugin/vchamilo/log')) {
42 42
     mkdir($_configuration['root_sys'].'plugin/vchamilo/log', 0777, true);
@@ -97,32 +97,32 @@  discard block
 block discarded – undo
97 97
     $timestamp_receive = time();
98 98
 
99 99
     if ($rawresponse === false) {
100
-        $error = curl_errno($ch) .':'. curl_error($ch);
101
-        if ($VCRON->TRACE_ENABLE){
102
-            if ($CRONTRACE){
103
-                fputs($CRONTRACE, "VCron start on $vhost->root_web : ".api_time_to_hms($timestamp_send)."\n" );
100
+        $error = curl_errno($ch).':'.curl_error($ch);
101
+        if ($VCRON->TRACE_ENABLE) {
102
+            if ($CRONTRACE) {
103
+                fputs($CRONTRACE, "VCron start on $vhost->root_web : ".api_time_to_hms($timestamp_send)."\n");
104 104
                 fputs($CRONTRACE, "VCron Error : $error \n");
105
-                fputs($CRONTRACE, "VCron stop on $vhost->root_web : $timestamp_receive\n#################\n\n" );
105
+                fputs($CRONTRACE, "VCron stop on $vhost->root_web : $timestamp_receive\n#################\n\n");
106 106
                 fclose($CRONTRACE);
107 107
             }
108 108
         }
109
-        echo("VCron started on $vhost->root_web : ".api_time_to_hms($timestamp_send)."\n" );
109
+        echo("VCron started on $vhost->root_web : ".api_time_to_hms($timestamp_send)."\n");
110 110
         echo("VCron Error : $error \n");
111
-        echo("VCron stop on $vhost->root_web : ".api_time_to_hms($timestamp_receive)."\n#################\n\n" );
111
+        echo("VCron stop on $vhost->root_web : ".api_time_to_hms($timestamp_receive)."\n#################\n\n");
112 112
         return false;
113 113
     }
114 114
 
115 115
     if ($VCRON->TRACE_ENABLE) {
116 116
         if ($CRONTRACE) {
117
-            fputs($CRONTRACE, "VCron start on $vhost->vhostname : ".api_time_to_hms($timestamp_send)."\n" );
117
+            fputs($CRONTRACE, "VCron start on $vhost->vhostname : ".api_time_to_hms($timestamp_send)."\n");
118 118
             fputs($CRONTRACE, $rawresponse."\n");
119
-            fputs($CRONTRACE, "VCron stop on $vhost->vhostname : ".api_time_to_hms($timestamp_receive)."\n#################\n\n" );
119
+            fputs($CRONTRACE, "VCron stop on $vhost->vhostname : ".api_time_to_hms($timestamp_receive)."\n#################\n\n");
120 120
             fclose($CRONTRACE);
121 121
         }
122 122
     }
123
-    echo("VCron start on $vhost->root_web : ".api_time_to_hms($timestamp_send)."\n" );
123
+    echo("VCron start on $vhost->root_web : ".api_time_to_hms($timestamp_send)."\n");
124 124
     echo($rawresponse."\n");
125
-    echo("VCron stop on $vhost->root_web : ".api_time_to_hms($timestamp_receive)."\n#################\n\n" );
125
+    echo("VCron stop on $vhost->root_web : ".api_time_to_hms($timestamp_receive)."\n#################\n\n");
126 126
     $vhost->lastcrongap = time() - $vhost->lastcron;
127 127
     $vhost->lastcron = $timestamp_send;
128 128
     $vhost->croncount++;
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
     $vhostid = $vhost->id;
131 131
     unset($vhost->id);
132 132
 
133
-    Database::update('vchamilo', (array)$vhost, array('id = ?' => $vhostid));
133
+    Database::update('vchamilo', (array) $vhost, array('id = ?' => $vhostid));
134 134
 
135 135
 }
136 136
 
@@ -154,9 +154,9 @@  discard block
 block discarded – undo
154 154
 
155 155
     if ($VCRON->TRACE_ENABLE) {
156 156
         if ($CRONTRACE) {
157
-            fputs($CRONTRACE, "VCron start on $vhost->root_web : $timestamp_send\n" );
157
+            fputs($CRONTRACE, "VCron start on $vhost->root_web : $timestamp_send\n");
158 158
             fputs($CRONTRACE, $rawresponse."\n");
159
-            fputs($CRONTRACE, "VCron stop on $vhost->root_web : $timestamp_receive\n#################\n\n" );
159
+            fputs($CRONTRACE, "VCron stop on $vhost->root_web : $timestamp_receive\n#################\n\n");
160 160
             fclose($CRONTRACE);
161 161
         }
162 162
     }
@@ -209,14 +209,14 @@  discard block
 block discarded – undo
209 209
         $match = trim($match);
210 210
 
211 211
         // try for IP match (Left side)
212
-        $lhs = substr($host,0,strlen($match));
213
-        if (strcasecmp($match,$lhs)==0) {
212
+        $lhs = substr($host, 0, strlen($match));
213
+        if (strcasecmp($match, $lhs) == 0) {
214 214
             return true;
215 215
         }
216 216
 
217 217
         // try for host match (Right side)
218
-        $rhs = substr($host,-strlen($match));
219
-        if (strcasecmp($match,$rhs)==0) {
218
+        $rhs = substr($host, -strlen($match));
219
+        if (strcasecmp($match, $rhs) == 0) {
220 220
             return true;
221 221
         }
222 222
     }
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
 
228 228
 // Main execution sequence
229 229
 
230
-if (!$vchamilos = Database::select('*', 'vchamilo', array(), 'all')){
230
+if (!$vchamilos = Database::select('*', 'vchamilo', array(), 'all')) {
231 231
     die("Nothing to do. No Vhosts");
232 232
 }
233 233
 
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
 if ($VCRON->STRATEGY == ROUND_ROBIN) {
241 241
     $rr = 0;
242 242
     foreach ($allvhosts as $vhostassoc) {
243
-        $vhost = (object)$vhostassoc;
243
+        $vhost = (object) $vhostassoc;
244 244
         if ($rr == 1) {
245 245
             api_set_setting('vchamilo_cron_lasthost', $vhost->id);
246 246
             echo("Round Robin : ".$vhost->root_web."\n");
@@ -252,13 +252,13 @@  discard block
 block discarded – undo
252 252
 
253 253
             die('Done.');
254 254
         }
255
-        if ($vhost->id == api_get_setting('vchamilo_cron_lasthost', 'vchamilo')){
255
+        if ($vhost->id == api_get_setting('vchamilo_cron_lasthost', 'vchamilo')) {
256 256
             $rr = 1; // take next one
257 257
         }
258 258
     }
259 259
 
260 260
     // We were at last. Loop back and take first.
261
-    $firsthost = (object)$allvhosts[0];
261
+    $firsthost = (object) $allvhosts[0];
262 262
     api_set_setting('vchamilo_cron_lasthost', $firsthost->id, 'vchamilo');
263 263
     echo("Round Robin : ".$firsthost->root_web."\n");
264 264
     if ($VCRON->ACTIVATION == 'cli') {
@@ -277,7 +277,7 @@  discard block
 block discarded – undo
277 277
     $hostsperturn = max(1, $VCRON->PERIOD / api_get_setting('vcrontickperiod', 'vchamilo') * count($allvhosts));
278 278
     $i = 0;
279 279
     foreach ($allvhosts as $vhostassoc) {
280
-        $vhost = (object)$vhostassoc;
280
+        $vhost = (object) $vhostassoc;
281 281
         if ((time() - $vhost->lastcron) > $VCRON->PERIOD) {
282 282
             if ($VCRON->ACTIVATION == 'cli') {
283 283
                 exec_vhost_cron($vhost);
Please login to merge, or discard this patch.