add new rule

This commit is contained in:
Frédéric FRANCE
2020-05-21 15:13:31 +02:00
parent d9f42f85d1
commit 674b0e38c8
7 changed files with 14 additions and 27 deletions

View File

@@ -214,7 +214,7 @@
<rule ref="Squiz.WhiteSpace.ControlStructureSpacing.SpacingBeforeClose" />
<!-- <rule ref="Squiz.ControlStructures.ControlSignature.SpaceAfterCloseParenthesis" /> -->
<rule ref="Squiz.ControlStructures.ControlSignature.SpaceAfterCloseBrace" />
<!-- <rule ref="Squiz.ControlStructures.ControlSignature.SpaceAfterCloseBrace" /> -->
<rule ref="Squiz.ControlStructures.ControlSignature.SpaceAfterKeyword" />
<rule ref="Squiz.ControlStructures.ForEachLoopDeclaration.SpaceAfterOpen" />

View File

@@ -133,17 +133,14 @@ if (!empty($hashp))
// We remove first level of directory
$original_file = (($tmp[1] ? $tmp[1].'/' : '').$ecmfile->filename); // this is relative to module dir
//var_dump($original_file); exit;
}
else {
} else {
accessforbidden('Bad link. File is from another module part.', 0, 0, 1);
}
}
else {
} else {
$modulepart = $moduleparttocheck;
$original_file = (($tmp[1] ? $tmp[1].'/' : '').$ecmfile->filename); // this is relative to module dir
}
}
else {
} else {
$langs->load("errors");
accessforbidden($langs->trans("ErrorFileNotFoundWithSharedLink"), 0, 0, 1);
}
@@ -181,8 +178,7 @@ if (!empty($hashp))
{
$accessallowed = 1; // When using hashp, link is public so we force $accessallowed
$sqlprotectagainstexternals = '';
}
else {
} else {
// Basic protection (against external users only)
if ($user->socid > 0)
{

View File

@@ -127,8 +127,7 @@ if (GETPOST("cache", 'alpha'))
{
header('Cache-Control: max-age=3600, public, must-revalidate');
header('Pragma: cache'); // This is to avoid having Pragma: no-cache
}
else header('Cache-Control: no-cache');
} else header('Cache-Control: no-cache');
//print $dolibarr_nocache; exit;
}

View File

@@ -201,17 +201,14 @@ class CodingSqlTest extends PHPUnit\Framework\TestCase
if ($dir == DOL_DOCUMENT_ROOT.'/install/mysql/migration')
{
// Test for migration files only
}
elseif ($dir == DOL_DOCUMENT_ROOT.'/install/mysql/data')
} elseif ($dir == DOL_DOCUMENT_ROOT.'/install/mysql/data')
{
// Test for data files only
}
else {
} else {
if (preg_match('/\.key\.sql$/', $file))
{
// Test for key files only
}
else {
} else {
// Test for non key files only
$result=(strpos($filecontent, 'KEY ') && strpos($filecontent, 'PRIMARY KEY') == 0);
print __METHOD__." Result for checking we don't have ' KEY ' instead of a sql file to create index = ".$result."\n";

View File

@@ -186,8 +186,7 @@ class FactureRecTest extends PHPUnit\Framework\TestCase
if (get_class($oA) !== get_class($oB))
{
$retAr[]="Supplied objects are not of same class.";
}
else {
} else {
$oVarsA=get_object_vars($oA);
$oVarsB=get_object_vars($oB);
$aKeys=array_keys($oVarsA);

View File

@@ -365,8 +365,7 @@ class FactureTest extends PHPUnit\Framework\TestCase
if (get_class($oA) !== get_class($oB))
{
$retAr[]="Supplied objects are not of same class.";
}
else {
} else {
$oVarsA=get_object_vars($oA);
$oVarsB=get_object_vars($oB);
$aKeys=array_keys($oVarsA);

View File

@@ -255,8 +255,7 @@ class WebservicesInvoicesTest extends PHPUnit\Framework\TestCase
print __METHOD__." call method ".$WS_METHOD."\n";
try {
$result = $this->soapclient->call($WS_METHOD, $parameters, $this->ns, '');
}
catch (SoapFault $exception)
} catch (SoapFault $exception)
{
echo $exception;
$result=0;
@@ -313,8 +312,7 @@ class WebservicesInvoicesTest extends PHPUnit\Framework\TestCase
print __METHOD__." call method ".$WS_METHOD."\n";
try {
$result = $this->soapclient->call($WS_METHOD, $parameters, $this->ns, '');
}
catch (SoapFault $exception)
} catch (SoapFault $exception)
{
echo $exception;
$result=0;
@@ -413,8 +411,7 @@ class WebservicesInvoicesTest extends PHPUnit\Framework\TestCase
print __METHOD__." call method ".$WS_METHOD."\n";
try {
$result = $this->soapclient->call($WS_METHOD, $parameters, $this->ns, '');
}
catch (SoapFault $exception)
} catch (SoapFault $exception)
{
echo $exception;
$result=0;