Minor - flint fixes, update php_cs "increment_style" attribute

pull/2588/merge
Julio Montoya 7 years ago
parent f568a74a89
commit 52d1071617
  1. 2
      .php_cs.dist
  2. 4
      main/calendar/ical_export.php
  3. 3
      main/exercise/exercise.class.php
  4. 2
      main/gradebook/lib/fe/flatviewtable.class.php
  5. 2
      main/lp/openoffice_text.class.php
  6. 2
      main/lp/openoffice_text_document.class.php
  7. 2
      main/work/work.lib.php

@ -17,7 +17,7 @@ $rules = [
'yoda_style' => false, 'yoda_style' => false,
'phpdoc_to_comment' => false, 'phpdoc_to_comment' => false,
'phpdoc_no_package' => false, 'phpdoc_no_package' => false,
'increment_style' => false, 'increment_style' => ['style' => 'post'],
'no_useless_else' => false, 'no_useless_else' => false,
//'no_php4_constructor' => true, //'no_php4_constructor' => true,
'single_quote' => false, 'single_quote' => false,

@ -90,7 +90,7 @@ if (!empty($event)) {
$s2 = $s; $s2 = $s;
if ($M2 > 60) { if ($M2 > 60) {
$M2 = $M2 - 60; $M2 = $M2 - 60;
$h2 += 1; $h2++;
} }
} else { } else {
list($y2, $m2, $d2, $h2, $M2, $s2) = preg_split('/[\s:-]/', $event['end_date']); list($y2, $m2, $d2, $h2, $M2, $s2) = preg_split('/[\s:-]/', $event['end_date']);
@ -129,7 +129,7 @@ if (!empty($event)) {
$s2 = $s; $s2 = $s;
if ($M2 > 60) { if ($M2 > 60) {
$M2 = $M2 - 60; $M2 = $M2 - 60;
$h2 += 1; $h2++;
} }
} else { } else {
list($y2, $m2, $d2, $h2, $M2, $s2) = preg_split('/[\s:-]/', $event['end_date']); list($y2, $m2, $d2, $h2, $M2, $s2) = preg_split('/[\s:-]/', $event['end_date']);

@ -2,7 +2,6 @@
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
use Chamilo\CoreBundle\Entity\TrackEHotspot; use Chamilo\CoreBundle\Entity\TrackEHotspot;
use Chamilo\CourseBundle\Entity\CQuizCategory;
use ChamiloSession as Session; use ChamiloSession as Session;
/** /**
@ -1753,7 +1752,7 @@ class Exercise
// random all questions // random all questions
if ($this->isRandom() && $this->isRandomByCat() == 0) { if ($this->isRandom() && $this->isRandomByCat() == 0) {
if (count($this->questionList) >= $this->random && $this->random > 0) { if (count($this->questionList) >= $this->random && $this->random > 0) {
$this->random -= 1; $this->random--;
$this->save(); $this->save();
} }
} }

@ -148,7 +148,7 @@ class FlatViewTable extends SortableTable
if (!isset($resource_list[$key][$userResult])) { if (!isset($resource_list[$key][$userResult])) {
$resource_list[$key][$userResult] = 0; $resource_list[$key][$userResult] = 0;
} }
$resource_list[$key][$userResult] += 1; $resource_list[$key][$userResult]++;
$key_list[] = $userResult; $key_list[] = $userResult;
} }

@ -223,7 +223,7 @@ class OpenofficeText extends OpenofficeDocument
$first_item = 0; $first_item = 0;
foreach ($pages as $key => $page_content) { foreach ($pages as $key => $page_content) {
// For every pages, we create a new file. // For every pages, we create a new file.
$key += 1; $key++;
$page_content = $this->format_page_content($header, $page_content, $this->base_work_dir.$this->created_dir); $page_content = $this->format_page_content($header, $page_content, $this->base_work_dir.$this->created_dir);
$html_file = $this->created_dir.'-'.$key.'.html'; $html_file = $this->created_dir.'-'.$key.'.html';
$handle = fopen($this->base_work_dir.$this->created_dir.'/'.$html_file, 'w+'); $handle = fopen($this->base_work_dir.$this->created_dir.'/'.$html_file, 'w+');

@ -213,7 +213,7 @@ class OpenOfficeTextDocument extends OpenofficeDocument
$pages = explode('||page_break||', $body); $pages = explode('||page_break||', $body);
foreach ($pages as $key => $page_content) { foreach ($pages as $key => $page_content) {
// For every pages, we create a new file. // For every pages, we create a new file.
$key += 1; $key++;
$page_content = $this->format_page_content( $page_content = $this->format_page_content(
$header, $header,
$page_content, $page_content,

@ -710,7 +710,7 @@ function create_unexisting_work_directory($workDir, $desiredDirName)
$workDir = (substr($workDir, -1, 1) == '/' ? $workDir : $workDir.'/'); $workDir = (substr($workDir, -1, 1) == '/' ? $workDir : $workDir.'/');
$checkDirName = $desiredDirName; $checkDirName = $desiredDirName;
while (file_exists($workDir.$checkDirName)) { while (file_exists($workDir.$checkDirName)) {
$counter += 1; $counter++;
$checkDirName = $desiredDirName.$counter; $checkDirName = $desiredDirName.$counter;
} }

Loading…
Cancel
Save