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"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!ELEMENT ruleset (description,rule+)>
|
<!ELEMENT ruleset (description,exclude-pattern*,rule+)>
|
||||||
<!ATTLIST ruleset name CDATA "">
|
<!ATTLIST ruleset name CDATA "">
|
||||||
<!ELEMENT description (#PCDATA)>
|
<!ELEMENT description (#PCDATA)>
|
||||||
|
<!ELEMENT exclude-pattern (#PCDATA)>
|
||||||
<!ELEMENT rule (properties*,severity*)>
|
<!ELEMENT rule (properties*,severity*)>
|
||||||
<!ATTLIST rule ref CDATA "">
|
<!ATTLIST rule ref CDATA "">
|
||||||
<!ELEMENT properties (property+)>
|
<!ELEMENT properties (property+)>
|
||||||
|
|||||||
@ -3,6 +3,10 @@
|
|||||||
<ruleset name="Dolibarr">
|
<ruleset name="Dolibarr">
|
||||||
<description>Dolibarr coding standard.</description>
|
<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 -->
|
<!-- List of all tests -->
|
||||||
|
|
||||||
<rule ref="Internal.NoCodeFound">
|
<rule ref="Internal.NoCodeFound">
|
||||||
@ -19,7 +23,7 @@
|
|||||||
</rule>
|
</rule>
|
||||||
|
|
||||||
<!-- The closing ?> tag MUST be omitted from files containing only PHP. -->
|
<!-- 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" /> -->
|
<!-- <rule ref="Generic.CodeAnalysis.ForLoopShouldBeWhileLoop" /> -->
|
||||||
|
|
||||||
|
|||||||
@ -149,9 +149,23 @@ class Interfaces
|
|||||||
$objMod = new $modName($this->db);
|
$objMod = new $modName($this->db);
|
||||||
if ($objMod)
|
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)
|
if ($result > 0)
|
||||||
{
|
{
|
||||||
// Action OK
|
// Action OK
|
||||||
@ -173,7 +187,7 @@ class Interfaces
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dol_syslog(get_class($this)."::run_triggers action=".$action." Failed to instantiate trigger for file '".$files[$key]."'", LOG_ERR);
|
dol_syslog(get_class($this)."::run_triggers action=".$action." Failed to instantiate trigger for file '".$files[$key]."'", LOG_ERR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,7 +1,5 @@
|
|||||||
<?php
|
<?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
|
* 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
|
* 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.
|
* 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 string $action Event action code
|
||||||
* @param Object $object Object
|
* @param Object $object Object
|
||||||
* @param User $user Object user
|
* @param User $user Object user
|
||||||
* @param Translate $langs Object langs
|
* @param Translate $langs Object langs
|
||||||
* @param conf $conf Object conf
|
* @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.
|
* 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 string $action Event action code
|
||||||
* @param Object $object Object
|
* @param Object $object Object
|
||||||
* @param User $user Object user
|
* @param User $user Object user
|
||||||
* @param Translate $langs Object langs
|
* @param Translate $langs Object langs
|
||||||
* @param conf $conf Object conf
|
* @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->global->MAIN_LOGEVENTS_DISABLE_ALL)) return 0; // Log events is disabled (hidden features)
|
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.
|
* 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 string $action Event action code
|
||||||
* @param Object $object Object
|
* @param Object $object Object
|
||||||
* @param User $user Object user
|
* @param User $user Object user
|
||||||
* @param Translate $langs Object langs
|
* @param Translate $langs Object langs
|
||||||
* @param conf $conf Object conf
|
* @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)
|
||||||
{
|
{
|
||||||
// Mettre ici le code a executer en reaction de l'action
|
// Mettre ici le code a executer en reaction de l'action
|
||||||
// Les donnees de l'action sont stockees dans $object
|
// 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.
|
* 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 string $action Event action code
|
||||||
* @param Object $object Object
|
* @param Object $object Object
|
||||||
* @param User $user Object user
|
* @param User $user Object user
|
||||||
* @param Translate $langs Object langs
|
* @param Translate $langs Object langs
|
||||||
* @param conf $conf Object conf
|
* @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
|
if (empty($conf->workflow->enabled)) return 0; // Module not active, we do nothing
|
||||||
|
|
||||||
|
|||||||
@ -38,7 +38,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Function called when a Dolibarrr business event is done.
|
* 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:
|
* Following properties must be filled:
|
||||||
* $object->actiontypecode (translation action code: AC_OTH, ...)
|
* $object->actiontypecode (translation action code: AC_OTH, ...)
|
||||||
@ -55,9 +55,9 @@ class InterfaceActionsAuto extends DolibarrTriggers
|
|||||||
* @param User $user Object user
|
* @param User $user Object user
|
||||||
* @param Translate $langs Object langs
|
* @param Translate $langs Object langs
|
||||||
* @param conf $conf Object conf
|
* @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
|
// Module not active, we do nothing
|
||||||
if (empty($conf->agenda->enabled)) {
|
if (empty($conf->agenda->enabled)) {
|
||||||
|
|||||||
@ -37,16 +37,16 @@ class InterfaceLdapsynchro extends DolibarrTriggers
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Function called when a Dolibarrr business event is done.
|
* 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 string $action Event action code
|
||||||
* @param Object $object Object
|
* @param Object $object Object
|
||||||
* @param User $user Object user
|
* @param User $user Object user
|
||||||
* @param Translate $langs Object langs
|
* @param Translate $langs Object langs
|
||||||
* @param conf $conf Object conf
|
* @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
|
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.
|
* 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 string $action Event action code
|
||||||
* @param Object $object Object
|
* @param Object $object Object
|
||||||
* @param User $user Object user
|
* @param User $user Object user
|
||||||
* @param Translate $langs Object langs
|
* @param Translate $langs Object langs
|
||||||
* @param conf $conf Object conf
|
* @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
|
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.
|
* 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 string $action Event action code
|
||||||
* @param Object $object Object
|
* @param Object $object Object
|
||||||
* @param User $user Object user
|
* @param User $user Object user
|
||||||
* @param Translate $langs Object langs
|
* @param Translate $langs Object langs
|
||||||
* @param conf $conf Object conf
|
* @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
|
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.
|
* 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 string $action Event action code
|
||||||
* @param Object $object Object
|
* @param Object $object Object
|
||||||
* @param User $user Object user
|
* @param User $user Object user
|
||||||
* @param Translate $langs Object langs
|
* @param Translate $langs Object langs
|
||||||
* @param conf $conf Object conf
|
* @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.
|
// Put here code you want to execute when a Dolibarr business events occurs.
|
||||||
// Data and type of action are stored into $object and $action
|
// Data and type of action are stored into $object and $action
|
||||||
|
|||||||
@ -959,5 +959,3 @@ class LivraisonLigne
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
|
||||||
|
|||||||
@ -249,5 +249,3 @@ function ajouter_sondage()
|
|||||||
header("Location: ".$urlback);
|
header("Location: ".$urlback);
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
|
||||||
|
|||||||
@ -1078,4 +1078,3 @@ print '<a name="bas"></a>'."\n";
|
|||||||
llxFooterSurvey();
|
llxFooterSurvey();
|
||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
?>
|
|
||||||
|
|||||||
@ -212,4 +212,3 @@ dol_fiche_end();
|
|||||||
llxFooter();
|
llxFooter();
|
||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
?>
|
|
||||||
|
|||||||
@ -110,5 +110,3 @@ else
|
|||||||
{
|
{
|
||||||
echo json_encode(array('nom'=>'ErrorBadParameter','label'=>'ErrorBadParameter','key'=>'ErrorBadParameter','value'=>'ErrorBadParameter'));
|
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;
|
return $result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
|
||||||
@ -233,4 +233,3 @@ class CompanyBankAccountTest extends PHPUnit_Framework_TestCase
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
?>
|
|
||||||
|
|||||||
@ -257,4 +257,3 @@ class EntrepotTest extends PHPUnit_Framework_TestCase
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
|
||||||
@ -265,4 +265,3 @@ class ExportTest extends PHPUnit_Framework_TestCase
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
|
||||||
|
|||||||
@ -196,4 +196,3 @@ class FactureRecTest extends PHPUnit_Framework_TestCase
|
|||||||
return $retAr;
|
return $retAr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
|
||||||
@ -329,4 +329,3 @@ class FactureTest extends PHPUnit_Framework_TestCase
|
|||||||
return $retAr;
|
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;
|
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