diff --git a/dev/setup/codesniffer/ruleset.xml b/dev/setup/codesniffer/ruleset.xml index 4494e21f95a..03104270dcf 100644 --- a/dev/setup/codesniffer/ruleset.xml +++ b/dev/setup/codesniffer/ruleset.xml @@ -214,7 +214,7 @@ - + diff --git a/htdocs/document.php b/htdocs/document.php index 0d08296e63e..3afa7d252cf 100644 --- a/htdocs/document.php +++ b/htdocs/document.php @@ -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) { diff --git a/htdocs/viewimage.php b/htdocs/viewimage.php index fa769933355..c2856848dc5 100644 --- a/htdocs/viewimage.php +++ b/htdocs/viewimage.php @@ -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; } diff --git a/test/phpunit/CodingSqlTest.php b/test/phpunit/CodingSqlTest.php index c9a5d12f3fc..56b0d001a81 100644 --- a/test/phpunit/CodingSqlTest.php +++ b/test/phpunit/CodingSqlTest.php @@ -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"; diff --git a/test/phpunit/FactureRecTest.php b/test/phpunit/FactureRecTest.php index fa44fda619f..3778989945a 100644 --- a/test/phpunit/FactureRecTest.php +++ b/test/phpunit/FactureRecTest.php @@ -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); diff --git a/test/phpunit/FactureTest.php b/test/phpunit/FactureTest.php index 83a7c0cfbe9..dc34b061806 100644 --- a/test/phpunit/FactureTest.php +++ b/test/phpunit/FactureTest.php @@ -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); diff --git a/test/phpunit/WebservicesInvoicesTest.php b/test/phpunit/WebservicesInvoicesTest.php index dc6cc93c8a5..428db9e8ef5 100644 --- a/test/phpunit/WebservicesInvoicesTest.php +++ b/test/phpunit/WebservicesInvoicesTest.php @@ -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;