From 79aaddbb66b33667ca2547ea4505b12e9785a6b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 9 Aug 2018 11:50:07 +0200 Subject: [PATCH] test phpcs v3 --- htdocs/core/db/Database.interface.php | 2 +- htdocs/core/js/lib_photosresize.js | 8 ++--- htdocs/core/lib/ajax.lib.php | 13 ++++--- htdocs/core/lib/date.lib.php | 19 +++++------ htdocs/core/lib/functions.lib.php | 34 +++++++++---------- htdocs/core/modules/DolibarrModules.class.php | 6 ++-- .../fourn/class/fournisseur.product.class.php | 3 +- htdocs/main.inc.php | 2 +- htdocs/ticket/class/ticket.class.php | 8 ++--- 9 files changed, 46 insertions(+), 49 deletions(-) diff --git a/htdocs/core/db/Database.interface.php b/htdocs/core/db/Database.interface.php index 65699585f4a..b0ad770532b 100644 --- a/htdocs/core/db/Database.interface.php +++ b/htdocs/core/db/Database.interface.php @@ -196,7 +196,7 @@ interface Database * * @param string $query SQL query string * @param int $usesavepoint 0=Default mode, 1=Run a savepoint before and a rollback to savepoint if error (this allow to have some request with errors inside global transactions). - * Note that with Mysql, this parameter is not used as Myssql can already commit a transaction even if one request is in error, without using savepoints. + * Note that with Mysql, this parameter is not used as Myssql can already commit a transaction even if one request is in error, without using savepoints. * @param string $type Type of SQL order ('ddl' for insert, update, select, delete or 'dml' for create, alter...) * @return resource Resultset of answer */ diff --git a/htdocs/core/js/lib_photosresize.js b/htdocs/core/js/lib_photosresize.js index 9c4c6671b1e..37fb21a4a01 100644 --- a/htdocs/core/js/lib_photosresize.js +++ b/htdocs/core/js/lib_photosresize.js @@ -21,10 +21,10 @@ /* Enable jcrop plugin onto id cropbox */ jQuery(function() { - jQuery('#cropbox').Jcrop({ - onSelect: updateCoords, - onChange: updateCoords - }); + jQuery('#cropbox').Jcrop({ + onSelect: updateCoords, + onChange: updateCoords + }); }); /* Update fields that store new size */ diff --git a/htdocs/core/lib/ajax.lib.php b/htdocs/core/lib/ajax.lib.php index 3c308c2c12d..8fec9a5c160 100644 --- a/htdocs/core/lib/ajax.lib.php +++ b/htdocs/core/lib/ajax.lib.php @@ -35,12 +35,12 @@ * @param string $urloption More parameters on URL request * @param int $minLength Minimum number of chars to trigger that Ajax search * @param int $autoselect Automatic selection if just one value - * @param array $ajaxoptions Multiple options array - * Ex: array('update'=>array('field1','field2'...)) will reset field1 and field2 once select done - * Ex: array('disabled'=> ) - * Ex: array('show'=> ) - * Ex: array('update_textarea'=> ) - * Ex: array('option_disabled'=> id to disable and warning to show if we select a disabled value (this is possible when using autocomplete ajax) + * @param array $ajaxoptions Multiple options array + * - Ex: array('update'=>array('field1','field2'...)) will reset field1 and field2 once select done + * - Ex: array('disabled'=> ) + * - Ex: array('show'=> ) + * - Ex: array('update_textarea'=> ) + * - Ex: array('option_disabled'=> id to disable and warning to show if we select a disabled value (this is possible when using autocomplete ajax) * @return string Script */ function ajax_autocompleter($selected, $htmlname, $url, $urloption='', $minLength=2, $autoselect=0, $ajaxoptions=array()) @@ -622,4 +622,3 @@ function ajax_object_onoff($object, $code, $field, $text_on, $text_off, $input=a return $out; } - diff --git a/htdocs/core/lib/date.lib.php b/htdocs/core/lib/date.lib.php index ea1dbe237de..084c06a08e1 100644 --- a/htdocs/core/lib/date.lib.php +++ b/htdocs/core/lib/date.lib.php @@ -162,15 +162,15 @@ function convertTime2Seconds($iHours=0,$iMinutes=0,$iSeconds=0) * * @param int $iSecond Number of seconds * @param string $format Output format ('all': total delay days hour:min like "2 days 12:30", - * 'allwithouthour': total delay days without hour part like "2 days", - * 'allhourmin': total delay with format hours:min like "60:30", - * 'allhour': total delay hours without min/sec like "60:30", - * 'fullhour': total delay hour decimal like "60.5" for 60:30, - * 'hour': only hours part "12", - * 'min': only minutes part "30", - * 'sec': only seconds part, - * 'month': only month part, - * 'year': only year part); + * - 'allwithouthour': total delay days without hour part like "2 days", + * - 'allhourmin': total delay with format hours:min like "60:30", + * - 'allhour': total delay hours without min/sec like "60:30", + * - 'fullhour': total delay hour decimal like "60.5" for 60:30, + * - 'hour': only hours part "12", + * - 'min': only minutes part "30", + * - 'sec': only seconds part, + * - 'month': only month part, + * - 'year': only year part); * @param int $lengthOfDay Length of day (default 86400 seconds for 1 day, 28800 for 8 hour) * @param int $lengthOfWeek Length of week (default 7) * @return string Formated text of duration @@ -964,4 +964,3 @@ function monthArray($outputlangs,$short=0) return $montharray; } - diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 7fb0c645081..cf8c298f443 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -253,19 +253,19 @@ function GETPOSTISSET($paramname) * Use the property $user->default_values[path]['creatform'] and/or $user->default_values[path]['filters'] and/or $user->default_values[path]['sortorder'] * Note: The property $user->default_values is loaded by main.php when loading the user. * - * @param string $paramname Name of parameter to found - * @param string $check Type of check - * ''=no check (deprecated) - * 'none'=no check (only for param that should have very rich content) - * 'int'=check it's numeric (integer or float) - * 'intcomma'=check it's integer+comma ('1,2,3,4...') - * 'alpha'=check it's text and sign - * 'aZ'=check it's a-z only - * 'aZ09'=check it's simple alpha string (recommended for keys) - * 'array'=check it's array - * 'san_alpha'=Use filter_var with FILTER_SANITIZE_STRING (do not use this for free text string) - * 'nohtml', 'alphanohtml'=check there is no html content - * 'custom'= custom filter specify $filter and $options) + * @param string $paramname Name of parameter to found + * @param string $check Type of check + * ''=no check (deprecated) + * 'none'=no check (only for param that should have very rich content) + * 'int'=check it's numeric (integer or float) + * 'intcomma'=check it's integer+comma ('1,2,3,4...') + * 'alpha'=check it's text and sign + * 'aZ'=check it's a-z only + * 'aZ09'=check it's simple alpha string (recommended for keys) + * 'array'=check it's array + * 'san_alpha'=Use filter_var with FILTER_SANITIZE_STRING (do not use this for free text string) + * 'nohtml', 'alphanohtml'=check there is no html content + * 'custom'= custom filter specify $filter and $options) * @param int $method Type of method (0 = get then post, 1 = only get, 2 = only post, 3 = post then get, 4 = post then get then cookie) * @param int $filter Filter to apply when $check is set to 'custom'. (See http://php.net/manual/en/filter.filters.php for détails) * @param mixed $options Options to pass to filter_var when $check is set to 'custom' @@ -7174,11 +7174,11 @@ function dol_getmypid() /** * Generate natural SQL search string for a criteria (this criteria can be tested on one or several fields) * - * @param string|string[] $fields String or array of strings, filled with the name of all fields in the SQL query we must check (combined with a OR). Example: array("p.field1","p.field2") - * @param string $value The value to look for. + * @param string|string[] $fields String or array of strings, filled with the name of all fields in the SQL query we must check (combined with a OR). Example: array("p.field1","p.field2") + * @param string $value The value to look for. * If param $mode is 0, can contains several keywords separated with a space or | - * like "keyword1 keyword2" = We want record field like keyword1 AND field like keyword2 - * or like "keyword1|keyword2" = We want record field like keyword1 OR field like keyword2 + * like "keyword1 keyword2" = We want record field like keyword1 AND field like keyword2 + * or like "keyword1|keyword2" = We want record field like keyword1 OR field like keyword2 * If param $mode is 1, can contains an operator <, > or = like "<10" or ">=100.5 < 1000" * If param $mode is 2, can contains a list of int id separated by comma like "1,3,4" * If param $mode is 3, can contains a list of string separated by comma like "a,b,c" diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index d222e54703a..8df3f28da3e 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -377,8 +377,8 @@ class DolibarrModules // Can not be abstract, because we need to insta * * @param array $array_sql SQL requests to be executed when enabling module * @param string $options String with options when disabling module: - * 'noboxes' = Do not insert boxes - * 'newboxdefonly' = For boxes, insert def of boxes only and not boxes activation + * - 'noboxes' = Do not insert boxes + * - 'newboxdefonly' = For boxes, insert def of boxes only and not boxes activation * * @return int 1 if OK, 0 if KO */ @@ -468,7 +468,7 @@ class DolibarrModules // Can not be abstract, because we need to insta * * @param string[] $array_sql SQL requests to be executed when module is disabled * @param string $options Options when disabling module: - * 'newboxdefonly|noboxes' = We don't remove boxes. + * - 'newboxdefonly|noboxes' = We don't remove boxes. * * @return int 1 if OK, 0 if KO */ diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php index 5c50597195a..4cd4f6cb8a8 100644 --- a/htdocs/fourn/class/fournisseur.product.class.php +++ b/htdocs/fourn/class/fournisseur.product.class.php @@ -803,7 +803,7 @@ class ProductFournisseur extends Product * @param int $showsuptitle Show "Supplier" into output string * @param int $maxlen Max length of name * @param integer $notooltip 1=Disable tooltip - * @param array $productFournList list of ProductFournisseur objects + * @param array $productFournList list of ProductFournisseur objects * to display in table format. * @return string String with supplier price */ @@ -850,4 +850,3 @@ class ProductFournisseur extends Product } } - diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 12e0aa53d2f..acb04734234 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1653,7 +1653,7 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a * @param array $menu_array_before Table of menu entries to show before entries of menu handler. This param is deprectaed and must be provided to ''. * @param string $helppagename Name of wiki page for help ('' by default). * Syntax is: For a wiki page: EN:EnglishPage|FR:FrenchPage|ES:SpanishPage - * For other external page: http://server/url + * For other external page: http://server/url * @param string $notused Deprecated. Used in past to add content into left menu. Hooks can be used now. * @param array $menu_array_after Table of menu entries to show after entries of menu handler * @param int $leftmenuwithoutmainarea Must be set to 1. 0 by default for backward compatibility with old modules. diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index 1fde15c5b29..4430ae3e0f0 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -555,7 +555,7 @@ class Ticket extends CommonObject * @param int $offset Offset for query * @param int $arch archive or not (not used) * @param array $filter Filter for query - * output + * output * @return int <0 if KO, >0 if OK */ public function fetchAll($user, $sortorder = 'ASC', $sortfield = 't.datec', $limit = '', $offset = 0, $arch = '', $filter = '') @@ -1614,11 +1614,11 @@ class Ticket extends CommonObject } include_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php'; $mailfile = new CMailFile($subject, $info_sendto['email'], $from, $message, $filepath, $mimetype, $filename, $sendtocc, '', $deliveryreceipt, 0); - if ($mailfile->error || $mailfile->errors) + if ($mailfile->error || $mailfile->errors) { setEventMessages($mailfile->error, $mailfile->errors, 'errors'); - } - else + } + else { $result = $mailfile->sendfile(); if ($result > 0) {