From df066c374195adbd2a73cc4bf2e3a7a71bd90e4f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 5 Dec 2014 20:34:36 +0100 Subject: [PATCH] Fix: PHPCS --- .travis.yml | 2 +- dev/codesniffer/ruleset.xml | 7 +++++-- htdocs/cashdesk/javascript/dhtml.js | 20 ++++---------------- htdocs/cashdesk/javascript/facturation1.js | 17 ++++++++--------- htdocs/core/db/mysqli.class.php | 1 - 5 files changed, 18 insertions(+), 29 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4db9ff10b2f..c97b547e499 100644 --- a/.travis.yml +++ b/.travis.yml @@ -104,7 +104,7 @@ script: - phpunit -d memory_limit=-1 --configuration test/phpunit/phpunittest.xml test/phpunit/AllTests.php - date # - phpcs -p --warning-severity=0 -s --report-summary --standard=dev/codesniffer/ruleset.xml --tab-width=4 --ignore=/build/html/,/dev/vagrant/,/documents/,/includes/,/test/report/ htdocs/core/class/dolgraph.class.php 2>&1 - - phpcs -p --warning-severity=0 -s --report-checkstyle --report-summary --standard=dev/codesniffer/ruleset.xml --tab-width=4 --ignore=/build/html/,/dev/vagrant/,/documents/,/includes/,/test/report/ . 2>&1 + - phpcs -p --warning-severity=0 -s --report-checkstyle --report-summary --standard=dev/codesniffer/ruleset.xml --tab-width=4 --ignore=/htdocs/conf/conf.php,/build/html/,/dev/vagrant/,/documents/,/includes/,/test/report/ . 2>&1 - date after_script: diff --git a/dev/codesniffer/ruleset.xml b/dev/codesniffer/ruleset.xml index 8d6705a83f8..ffbc1bace39 100755 --- a/dev/codesniffer/ruleset.xml +++ b/dev/codesniffer/ruleset.xml @@ -6,6 +6,7 @@ */conf.php */includes/* */documents/* + */dev/vagrant/* */custom/* */nltechno* @@ -260,7 +261,10 @@ 0 - + + 0 + + 0 @@ -275,7 +279,6 @@ 0 - diff --git a/htdocs/cashdesk/javascript/dhtml.js b/htdocs/cashdesk/javascript/dhtml.js index eb0ef03f257..caf0cd94abd 100644 --- a/htdocs/cashdesk/javascript/dhtml.js +++ b/htdocs/cashdesk/javascript/dhtml.js @@ -16,7 +16,7 @@ */ // Instanciation et initialisation de l'objet xmlhttprequest -function file (fichier) { +function file(fichier) { // Instanciation de l'objet pour Mozilla, Konqueror, Opera, Safari, etc ... if (window.XMLHttpRequest) { @@ -51,7 +51,7 @@ function file (fichier) { // Affichage des donnees aTexte dans le bloc identifie par aId -function afficheDonnees (aId, aTexte) { +function afficheDonnees(aId, aTexte) { document.getElementById(aId).innerHTML = aTexte; @@ -59,7 +59,7 @@ function afficheDonnees (aId, aTexte) { // aCible : id du bloc de destination; aCode : argument a passer a la page php chargee du traitement et de l'affichage -function verifResultat (aCible, aCode) { +function verifResultat(aCible, aCode) { if (aCode != '') { if (texte = file ('facturation_dhtml.php?code='+escape(aCode))) { @@ -76,21 +76,9 @@ function verifResultat (aCible, aCode) { // Change dynamiquement la classe de l'element ayant l'id aIdElement pour aClasse -function setStyle (aIdElement, aClasse) { +function setStyle(aIdElement, aClasse) { aIdElement.className = aClasse; } - - - - - - - - - - - - diff --git a/htdocs/cashdesk/javascript/facturation1.js b/htdocs/cashdesk/javascript/facturation1.js index 11f1739e937..b0b9a45a028 100644 --- a/htdocs/cashdesk/javascript/facturation1.js +++ b/htdocs/cashdesk/javascript/facturation1.js @@ -16,7 +16,7 @@ */ // Calcul et affichage en temps reel des informations sur le produit en cours -function modif () { +function modif() { var prix_unit = parseFloat ( document.getElementById('frmQte').txtPrixUnit.value ); var qte = parseFloat ( document.getElementById('frmQte').txtQte.value ); @@ -71,7 +71,7 @@ function modif () { } // Affecte la source de la requete (liste deroulante ou champ texte 'ref') au champ cache -function setSource (aSrc) { +function setSource(aSrc) { document.getElementById('frmFacturation').hdnSource.value = aSrc; document.getElementById('frmFacturation').submit(); @@ -79,7 +79,7 @@ function setSource (aSrc) { } // Verification de la coherence des informations saisies dans le formulaire de choix du nombre d'articles -function verifSaisie () { +function verifSaisie() { if ( document.getElementById('frmQte').txtQte.value ) { @@ -95,17 +95,17 @@ function verifSaisie () { } // Verification de la coherence des informations saisies dans le formulaire de calcul de la difference -function verifDifference () { +function verifDifference() { var du = parseFloat ( document.getElementById('frmDifference').txtDu.value ); var encaisse = parseFloat ( document.getElementById('frmDifference').txtEncaisse.value ); - if ( encaisse > du ) { + if (encaisse > du) { resultat = Math.round ( (encaisse - du) * 100 ) / 100; document.getElementById('frmDifference').txtRendu.value = resultat.toFixed(2); - } else if ( encaisse == du ) { + } else if (encaisse == du) { document.getElementById('frmDifference').txtRendu.value = '0'; @@ -118,14 +118,14 @@ function verifDifference () { } // Affecte le moyen de paiement (ESP, CB ou CHQ) au champ cache en fonction du bouton clique -function verifClic (aChoix) { +function verifClic(aChoix) { document.getElementById('frmDifference').hdnChoix.value = aChoix; } // Determination du moyen de paiement, et validation du formulaire si les donnees sont coherentes -function verifReglement () { +function verifReglement() { var choix = document.getElementById('frmDifference').hdnChoix.value; var du = parseFloat (document.getElementById('frmDifference').txtDu.value); @@ -172,5 +172,4 @@ function verifReglement () { return false; } - } diff --git a/htdocs/core/db/mysqli.class.php b/htdocs/core/db/mysqli.class.php index 9ec495f7ca5..6ebbc541a30 100644 --- a/htdocs/core/db/mysqli.class.php +++ b/htdocs/core/db/mysqli.class.php @@ -357,7 +357,6 @@ class DoliDBMysqli extends DoliDB * @return int Nombre de lignes * @see num_rows */ - function affected_rows($resultset) { // If resultset not provided, we take the last used by connexion