Qual: Enable php checkstyle rule Zend.Files.ClosingTag
Fix: Solve a lot of checkstyle errors.
This commit is contained in:
parent
ad104470d8
commit
cfc337a79a
@ -1,7 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!ELEMENT ruleset (description,rule+)>
|
||||
<!ELEMENT ruleset (description,exclude-pattern*,rule+)>
|
||||
<!ATTLIST ruleset name CDATA "">
|
||||
<!ELEMENT description (#PCDATA)>
|
||||
<!ELEMENT exclude-pattern (#PCDATA)>
|
||||
<!ELEMENT rule (properties*,severity*)>
|
||||
<!ATTLIST rule ref CDATA "">
|
||||
<!ELEMENT properties (property+)>
|
||||
|
||||
@ -3,6 +3,10 @@
|
||||
<ruleset name="Dolibarr">
|
||||
<description>Dolibarr coding standard.</description>
|
||||
|
||||
<exclude-pattern>*/conf.php</exclude-pattern>
|
||||
<exclude-pattern>*/includes/*</exclude-pattern>
|
||||
<exclude-pattern>*/documents/*</exclude-pattern>
|
||||
|
||||
<!-- List of all tests -->
|
||||
|
||||
<rule ref="Internal.NoCodeFound">
|
||||
@ -19,7 +23,7 @@
|
||||
</rule>
|
||||
|
||||
<!-- The closing ?> tag MUST be omitted from files containing only PHP. -->
|
||||
<!-- <rule ref="Zend.Files.ClosingTag"/> -->
|
||||
<rule ref="Zend.Files.ClosingTag"/>
|
||||
|
||||
<!-- <rule ref="Generic.CodeAnalysis.ForLoopShouldBeWhileLoop" /> -->
|
||||
|
||||
|
||||
@ -149,9 +149,23 @@ class Interfaces
|
||||
$objMod = new $modName($this->db);
|
||||
if ($objMod)
|
||||
{
|
||||
dol_syslog(get_class($this)."::run_triggers action=".$action." Launch triggers for file '".$files[$key]."'", LOG_INFO);
|
||||
$result=0;
|
||||
|
||||
if (method_exists($objMod, 'runTrigger')) // New method to implement
|
||||
{
|
||||
dol_syslog(get_class($this)."::run_triggers action=".$action." Launch runTrigger for file '".$files[$key]."'", LOG_INFO);
|
||||
$result=$objMod->runTrigger($action,$object,$user,$langs,$conf);
|
||||
}
|
||||
elseif (method_exists($objMod, 'run_trigger')) // Deprecated method
|
||||
{
|
||||
dol_syslog(get_class($this)."::run_triggers action=".$action." Launch run_trigger for file '".$files[$key]."'", LOG_INFO);
|
||||
$result=$objMod->run_trigger($action,$object,$user,$langs,$conf);
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_syslog(get_class($this)."::run_triggers action=".$action." A trigger was declared for class ".get_class($objMod)." but method runTrigger was not found", LOG_ERR);
|
||||
}
|
||||
|
||||
$result=$objMod->run_trigger($action,$object,$user,$langs,$conf);
|
||||
if ($result > 0)
|
||||
{
|
||||
// Action OK
|
||||
@ -173,7 +187,7 @@ class Interfaces
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
dol_syslog(get_class($this)."::run_triggers action=".$action." Failed to instantiate trigger for file '".$files[$key]."'", LOG_ERR);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,7 +1,5 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
|
||||
/* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -135,15 +133,15 @@ abstract class DolibarrTriggers
|
||||
|
||||
/**
|
||||
* Function called when a Dolibarrr business event is done.
|
||||
* All functions "run_trigger" are triggered if file is inside directory htdocs/core/triggers
|
||||
* All functions "runTrigger" are triggered if file is inside directory htdocs/core/triggers or htdocs/module/code/triggers (and declared)
|
||||
*
|
||||
* @param string $action Event action code
|
||||
* @param Object $object Object
|
||||
* @param User $user Object user
|
||||
* @param Translate $langs Object langs
|
||||
* @param conf $conf Object conf
|
||||
* @return int <0 if KO, 0 if no triggered ran, >0 if OK
|
||||
* @return int <0 if KO, 0 if no triggered ran, >0 if OK
|
||||
*/
|
||||
abstract function run_trigger($action, $object, User $user, Translate $langs, Conf $conf);
|
||||
abstract function runTrigger($action, $object, User $user, Translate $langs, Conf $conf);
|
||||
|
||||
}
|
||||
@ -36,16 +36,16 @@ class InterfaceLogevents extends DolibarrTriggers
|
||||
|
||||
/**
|
||||
* Function called when a Dolibarrr business event is done.
|
||||
* All functions "run_trigger" are triggered if file is inside directory htdocs/core/triggers
|
||||
* All functions "runTrigger" are triggered if file is inside directory htdocs/core/triggers or htdocs/module/code/triggers (and declared)
|
||||
*
|
||||
* @param string $action Event action code
|
||||
* @param Object $object Object
|
||||
* @param User $user Object user
|
||||
* @param Translate $langs Object langs
|
||||
* @param conf $conf Object conf
|
||||
* @return int <0 if KO, 0 if no triggered ran, >0 if OK
|
||||
* @param User $user Object user
|
||||
* @param Translate $langs Object langs
|
||||
* @param conf $conf Object conf
|
||||
* @return int <0 if KO, 0 if no triggered ran, >0 if OK
|
||||
*/
|
||||
public function run_trigger($action, $object, User $user, Translate $langs, Conf $conf)
|
||||
public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf)
|
||||
{
|
||||
if (! empty($conf->global->MAIN_LOGEVENTS_DISABLE_ALL)) return 0; // Log events is disabled (hidden features)
|
||||
|
||||
|
||||
@ -35,16 +35,16 @@ class InterfacePaypalWorkflow extends DolibarrTriggers
|
||||
|
||||
/**
|
||||
* Function called when a Dolibarrr business event is done.
|
||||
* All functions "run_trigger" are triggered if file is inside directory htdocs/core/triggers
|
||||
* All functions "runTrigger" are triggered if file is inside directory htdocs/core/triggers or htdocs/module/code/triggers (and declared)
|
||||
*
|
||||
* @param string $action Event action code
|
||||
* @param Object $object Object
|
||||
* @param User $user Object user
|
||||
* @param Translate $langs Object langs
|
||||
* @param conf $conf Object conf
|
||||
* @return int <0 if KO, 0 if no triggered ran, >0 if OK
|
||||
* @param User $user Object user
|
||||
* @param Translate $langs Object langs
|
||||
* @param conf $conf Object conf
|
||||
* @return int <0 if KO, 0 if no triggered ran, >0 if OK
|
||||
*/
|
||||
public function run_trigger($action, $object, User $user, Translate $langs, Conf $conf)
|
||||
public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf)
|
||||
{
|
||||
// Mettre ici le code a executer en reaction de l'action
|
||||
// Les donnees de l'action sont stockees dans $object
|
||||
|
||||
@ -37,16 +37,16 @@ class InterfaceWorkflowManager extends DolibarrTriggers
|
||||
|
||||
/**
|
||||
* Function called when a Dolibarrr business event is done.
|
||||
* All functions "run_trigger" are triggered if file is inside directory htdocs/core/triggers
|
||||
* All functions "runTrigger" are triggered if file is inside directory htdocs/core/triggers or htdocs/module/code/triggers (and declared)
|
||||
*
|
||||
* @param string $action Event action code
|
||||
* @param Object $object Object
|
||||
* @param User $user Object user
|
||||
* @param Translate $langs Object langs
|
||||
* @param conf $conf Object conf
|
||||
* @return int <0 if KO, 0 if no triggered ran, >0 if OK
|
||||
* @return int <0 if KO, 0 if no triggered ran, >0 if OK
|
||||
*/
|
||||
public function run_trigger($action, $object, User $user, Translate $langs, Conf $conf)
|
||||
public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf)
|
||||
{
|
||||
if (empty($conf->workflow->enabled)) return 0; // Module not active, we do nothing
|
||||
|
||||
@ -116,7 +116,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers
|
||||
return $ret;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// classify billed order
|
||||
if ($action == 'BILL_VALIDATE')
|
||||
{
|
||||
|
||||
@ -38,7 +38,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
|
||||
|
||||
/**
|
||||
* Function called when a Dolibarrr business event is done.
|
||||
* All functions "run_trigger" are triggered if file is inside directory htdocs/core/triggers
|
||||
* All functions "runTrigger" are triggered if file is inside directory htdocs/core/triggers or htdocs/module/code/triggers (and declared)
|
||||
*
|
||||
* Following properties must be filled:
|
||||
* $object->actiontypecode (translation action code: AC_OTH, ...)
|
||||
@ -55,9 +55,9 @@ class InterfaceActionsAuto extends DolibarrTriggers
|
||||
* @param User $user Object user
|
||||
* @param Translate $langs Object langs
|
||||
* @param conf $conf Object conf
|
||||
* @return int <0 if KO, 0 if no triggered ran, >0 if OK
|
||||
* @return int <0 if KO, 0 if no triggered ran, >0 if OK
|
||||
*/
|
||||
public function run_trigger($action, $object, User $user, Translate $langs, Conf $conf)
|
||||
public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf)
|
||||
{
|
||||
// Module not active, we do nothing
|
||||
if (empty($conf->agenda->enabled)) {
|
||||
|
||||
@ -37,16 +37,16 @@ class InterfaceLdapsynchro extends DolibarrTriggers
|
||||
|
||||
/**
|
||||
* Function called when a Dolibarrr business event is done.
|
||||
* All functions "run_trigger" are triggered if file is inside directory htdocs/core/triggers
|
||||
* All functions "runTrigger" are triggered if file is inside directory htdocs/core/triggers or htdocs/module/code/triggers (and declared)
|
||||
*
|
||||
* @param string $action Event action code
|
||||
* @param Object $object Object
|
||||
* @param User $user Object user
|
||||
* @param Translate $langs Object langs
|
||||
* @param conf $conf Object conf
|
||||
* @return int <0 if KO, 0 if no triggered ran, >0 if OK
|
||||
* @return int <0 if KO, 0 if no triggered ran, >0 if OK
|
||||
*/
|
||||
public function run_trigger($action, $object, User $user, Translate $langs, Conf $conf)
|
||||
public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf)
|
||||
{
|
||||
if (empty($conf->ldap->enabled)) return 0; // Module not active, we do nothing
|
||||
|
||||
|
||||
@ -37,16 +37,16 @@ class InterfaceMailmanSpipsynchro extends DolibarrTriggers
|
||||
|
||||
/**
|
||||
* Function called when a Dolibarrr business event is done.
|
||||
* All functions "run_trigger" are triggered if file is inside directory htdocs/core/triggers
|
||||
* All functions "runTrigger" are triggered if file is inside directory htdocs/core/triggers or htdocs/module/code/triggers (and declared)
|
||||
*
|
||||
* @param string $action Event action code
|
||||
* @param Object $object Object
|
||||
* @param User $user Object user
|
||||
* @param Translate $langs Object langs
|
||||
* @param conf $conf Object conf
|
||||
* @return int <0 if KO, 0 if no triggered ran, >0 if OK
|
||||
* @return int <0 if KO, 0 if no triggered ran, >0 if OK
|
||||
*/
|
||||
public function run_trigger($action, $object, User $user, Translate $langs, Conf $conf)
|
||||
public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf)
|
||||
{
|
||||
if (empty($conf->mailmanspip->enabled)) return 0; // Module not active, we do nothing
|
||||
|
||||
|
||||
@ -46,16 +46,16 @@ class InterfaceNotification extends DolibarrTriggers
|
||||
|
||||
/**
|
||||
* Function called when a Dolibarrr business event is done.
|
||||
* All functions "run_trigger" are triggered if file is inside directory htdocs/core/triggers
|
||||
* All functions "runTrigger" are triggered if file is inside directory htdocs/core/triggers or htdocs/module/code/triggers (and declared)
|
||||
*
|
||||
* @param string $action Event action code
|
||||
* @param Object $object Object
|
||||
* @param User $user Object user
|
||||
* @param Translate $langs Object langs
|
||||
* @param conf $conf Object conf
|
||||
* @return int <0 if KO, 0 if no triggered ran, >0 if OK
|
||||
* @return int <0 if KO, 0 if no triggered ran, >0 if OK
|
||||
*/
|
||||
public function run_trigger($action, $object, User $user, Translate $langs, Conf $conf)
|
||||
public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf)
|
||||
{
|
||||
if (empty($conf->notification->enabled)) return 0; // Module not active, we do nothing
|
||||
|
||||
|
||||
@ -43,16 +43,16 @@ class InterfaceDemo extends DolibarrTriggers
|
||||
|
||||
/**
|
||||
* Function called when a Dolibarrr business event is done.
|
||||
* All functions "run_trigger" are triggered if file is inside directory htdocs/core/triggers
|
||||
* All functions "runTrigger" are triggered if file is inside directory htdocs/core/triggers or htdocs/module/code/triggers (and declared)
|
||||
*
|
||||
* @param string $action Event action code
|
||||
* @param Object $object Object
|
||||
* @param User $user Object user
|
||||
* @param Translate $langs Object langs
|
||||
* @param conf $conf Object conf
|
||||
* @return int <0 if KO, 0 if no triggered ran, >0 if OK
|
||||
* @return int <0 if KO, 0 if no triggered ran, >0 if OK
|
||||
*/
|
||||
public function run_trigger($action, $object, User $user, Translate $langs, Conf $conf)
|
||||
public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf)
|
||||
{
|
||||
// Put here code you want to execute when a Dolibarr business events occurs.
|
||||
// Data and type of action are stored into $object and $action
|
||||
|
||||
@ -606,8 +606,8 @@ class Livraison extends CommonObject
|
||||
if ($result < 0)
|
||||
{
|
||||
$this->db->rollback();
|
||||
return -4;
|
||||
}
|
||||
return -4;
|
||||
}
|
||||
// End call triggers
|
||||
|
||||
return 1;
|
||||
@ -959,5 +959,3 @@ class LivraisonLigne
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@ -25,14 +25,14 @@
|
||||
/**
|
||||
* Returns an array with the tabs for the "Opensurvey poll" section
|
||||
* It loads tabs from modules looking for the entity Opensurveyso
|
||||
*
|
||||
*
|
||||
* @param Opensurveysondage $object Current viewing poll
|
||||
* @return array Tabs for the opensurvey section
|
||||
*/
|
||||
function opensurvey_prepare_head(Opensurveysondage $object) {
|
||||
|
||||
|
||||
global $langs, $conf;
|
||||
|
||||
|
||||
$h = 0;
|
||||
$head = array();
|
||||
|
||||
@ -40,7 +40,7 @@ function opensurvey_prepare_head(Opensurveysondage $object) {
|
||||
$head[0][1] = $langs->trans("Card");
|
||||
$head[0][2] = 'general';
|
||||
$h++;
|
||||
|
||||
|
||||
$head[1][0] = 'results.php?id='.$object->id_sondage;
|
||||
$head[1][1] = $langs->trans("SurveyResults");
|
||||
$head[1][2] = 'preview';
|
||||
@ -111,12 +111,12 @@ function showlogo()
|
||||
$urllogo=DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=companylogo&file=thumbs/'.urlencode($mysoc->logo_small);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!$urllogo && (is_readable(DOL_DOCUMENT_ROOT.'/theme/dolibarr_logo.png')))
|
||||
{
|
||||
$urllogo=DOL_URL_ROOT.'/theme/dolibarr_logo.png';
|
||||
}
|
||||
|
||||
|
||||
print '<div style="text-align:center"><img alt="Logo" id="logosubscribe" title="" src="'.$urllogo.'"/></div>';
|
||||
print '<br>';
|
||||
}
|
||||
@ -205,14 +205,14 @@ function dol_survey_random($car)
|
||||
function ajouter_sondage()
|
||||
{
|
||||
global $db, $user;
|
||||
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/opensurvey/class/opensurveysondage.class.php';
|
||||
|
||||
$sondage=dol_survey_random(16);
|
||||
|
||||
$allow_comments = empty($_SESSION['allow_comments']) ? 0 : 1;
|
||||
$allow_spy = empty($_SESSION['allow_spy']) ? 0 : 1;
|
||||
|
||||
|
||||
// Insert survey
|
||||
$opensurveysondage = new Opensurveysondage($db);
|
||||
$opensurveysondage->id_sondage = $sondage;
|
||||
@ -226,9 +226,9 @@ function ajouter_sondage()
|
||||
$opensurveysondage->allow_comments = $allow_comments;
|
||||
$opensurveysondage->allow_spy = $allow_spy;
|
||||
$opensurveysondage->sujet = $_SESSION['toutchoix'];
|
||||
|
||||
|
||||
$res = $opensurveysondage->create($user);
|
||||
|
||||
|
||||
if ($res < 0) {
|
||||
dol_print_error($db);
|
||||
}
|
||||
@ -243,11 +243,9 @@ function ajouter_sondage()
|
||||
unset($_SESSION['toutchoix']);
|
||||
unset($_SESSION['totalchoixjour']);
|
||||
unset($_SESSION['champdatefin']);
|
||||
|
||||
|
||||
$urlback=dol_buildpath('/opensurvey/card.php',1).'?id='.$sondage;
|
||||
|
||||
header("Location: ".$urlback);
|
||||
exit();
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@ -1078,4 +1078,3 @@ print '<a name="bas"></a>'."\n";
|
||||
llxFooterSurvey();
|
||||
|
||||
$db->close();
|
||||
?>
|
||||
|
||||
@ -149,7 +149,7 @@ if ($mode == 'config' && $user->admin)
|
||||
print $langs->trans("PRINTIPP_PASSWORD").'</td><td>';
|
||||
print '<input size="32" type="text" name="PRINTIPP_PASSWORD" value="'.$conf->global->PRINTIPP_PASSWORD.'">';
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
//$var=true;
|
||||
//print '<tr class="liste_titre">';
|
||||
//print '<td>'.$langs->trans("OtherParameter").'</td>';
|
||||
@ -181,7 +181,7 @@ if ($mode == 'test' && $user->admin)
|
||||
print '<td>Media</td>';
|
||||
print '<td>Supported</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
$list = $printer->getlist_available_printers();
|
||||
$var = true;
|
||||
foreach ($list as $value)
|
||||
@ -203,7 +203,7 @@ if ($mode == 'test' && $user->admin)
|
||||
print "</tr>\n";
|
||||
}
|
||||
print '</table>';
|
||||
|
||||
|
||||
if (count($list) == 0) print $langs->trans("NoPrinterFound");
|
||||
}
|
||||
|
||||
@ -212,4 +212,3 @@ dol_fiche_end();
|
||||
llxFooter();
|
||||
|
||||
$db->close();
|
||||
?>
|
||||
|
||||
@ -110,5 +110,3 @@ else
|
||||
{
|
||||
echo json_encode(array('nom'=>'ErrorBadParameter','label'=>'ErrorBadParameter','key'=>'ErrorBadParameter','value'=>'ErrorBadParameter'));
|
||||
}
|
||||
|
||||
?>
|
||||
@ -705,5 +705,3 @@ abstract class ActionsCardCommon
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@ -338,4 +338,3 @@ class CommandeFournisseurTest extends PHPUnit_Framework_TestCase
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
@ -265,4 +265,3 @@ class CommandeTest extends PHPUnit_Framework_TestCase
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
@ -183,4 +183,3 @@ class CommonObjectTest extends PHPUnit_Framework_TestCase
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -233,4 +233,3 @@ class CompanyBankAccountTest extends PHPUnit_Framework_TestCase
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
|
||||
@ -257,4 +257,3 @@ class EntrepotTest extends PHPUnit_Framework_TestCase
|
||||
return;
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -265,4 +265,3 @@ class ExportTest extends PHPUnit_Framework_TestCase
|
||||
return true;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
@ -131,7 +131,7 @@ class FactureRecTest extends PHPUnit_Framework_TestCase
|
||||
$localobjectinv=new Facture($this->savdb);
|
||||
$localobjectinv->initAsSpecimen();
|
||||
$localobjectinv->create($user);
|
||||
|
||||
|
||||
$localobject=new FactureRec($this->savdb);
|
||||
$localobject->initAsSpecimen();
|
||||
$result=$localobject->create($user, $localobjectinv->id);
|
||||
@ -141,11 +141,11 @@ class FactureRecTest extends PHPUnit_Framework_TestCase
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Edit an object to test updates
|
||||
*
|
||||
@ -196,4 +196,3 @@ class FactureRecTest extends PHPUnit_Framework_TestCase
|
||||
return $retAr;
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -329,4 +329,3 @@ class FactureTest extends PHPUnit_Framework_TestCase
|
||||
return $retAr;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
@ -784,4 +784,3 @@ class FunctionsLibTest extends PHPUnit_Framework_TestCase
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
|
||||
@ -265,4 +265,3 @@ class PropalTest extends PHPUnit_Framework_TestCase
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
|
||||
@ -456,4 +456,3 @@ class SocieteTest extends PHPUnit_Framework_TestCase
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
|
||||
@ -318,4 +318,3 @@ class UserTest extends PHPUnit_Framework_TestCase
|
||||
return $retAr;
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -181,4 +181,3 @@ class WebservicesInvoicesTest extends PHPUnit_Framework_TestCase
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
|
||||
@ -181,4 +181,3 @@ class WebservicesThirdpartyTest extends PHPUnit_Framework_TestCase
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user