Fix phpcs
This commit is contained in:
parent
dabccb7967
commit
9a132d9691
@ -70,7 +70,8 @@ class DolConfigCollector extends ConfigCollector
|
|||||||
/**
|
/**
|
||||||
* Convert an object to array
|
* Convert an object to array
|
||||||
*
|
*
|
||||||
* @return array Array
|
* @param mixed $obj Object
|
||||||
|
* @return array Array
|
||||||
*/
|
*/
|
||||||
protected function object_to_array($obj)
|
protected function object_to_array($obj)
|
||||||
{
|
{
|
||||||
@ -82,4 +83,4 @@ class DolConfigCollector extends ConfigCollector
|
|||||||
|
|
||||||
return $arr;
|
return $arr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -22,8 +22,8 @@ class DolLogsCollector extends MessagesCollector
|
|||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param string $path
|
* @param string $path Path
|
||||||
* @param string $name
|
* @param string $name Name
|
||||||
*/
|
*/
|
||||||
public function __construct($path = null, $name = 'logs')
|
public function __construct($path = null, $name = 'logs')
|
||||||
{
|
{
|
||||||
@ -89,7 +89,7 @@ class DolLogsCollector extends MessagesCollector
|
|||||||
/**
|
/**
|
||||||
* Get logs
|
* Get logs
|
||||||
*
|
*
|
||||||
* @param string $path
|
* @param string $path Path
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function getStorageLogs($path)
|
public function getStorageLogs($path)
|
||||||
@ -109,8 +109,8 @@ class DolLogsCollector extends MessagesCollector
|
|||||||
/**
|
/**
|
||||||
* Get latest file lines
|
* Get latest file lines
|
||||||
*
|
*
|
||||||
* @param string $file
|
* @param string $file File
|
||||||
* @param int $lines
|
* @param int $lines Lines
|
||||||
* @return array Array
|
* @return array Array
|
||||||
*/
|
*/
|
||||||
protected function tailFile($file, $lines)
|
protected function tailFile($file, $lines)
|
||||||
|
|||||||
@ -26,4 +26,4 @@ class DolMemoryCollector extends MemoryCollector
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -33,4 +33,4 @@ class DolMessagesCollector extends MessagesCollector
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -10,7 +10,6 @@ dol_include_once('/debugbar/class/TraceableDB.php');
|
|||||||
/**
|
/**
|
||||||
* DolQueryCollector class
|
* DolQueryCollector class
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class DolQueryCollector extends DataCollector implements Renderable, AssetProvider
|
class DolQueryCollector extends DataCollector implements Renderable, AssetProvider
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
@ -33,6 +32,7 @@ class DolQueryCollector extends DataCollector implements Renderable, AssetProvid
|
|||||||
/**
|
/**
|
||||||
* Return collected data
|
* Return collected data
|
||||||
*
|
*
|
||||||
|
* @return array Array
|
||||||
*/
|
*/
|
||||||
public function collect()
|
public function collect()
|
||||||
{
|
{
|
||||||
@ -72,7 +72,7 @@ class DolQueryCollector extends DataCollector implements Renderable, AssetProvid
|
|||||||
/**
|
/**
|
||||||
* Return collector name
|
* Return collector name
|
||||||
*
|
*
|
||||||
* @param string Name
|
* @return string Name
|
||||||
*/
|
*/
|
||||||
public function getName()
|
public function getName()
|
||||||
{
|
{
|
||||||
@ -82,7 +82,7 @@ class DolQueryCollector extends DataCollector implements Renderable, AssetProvid
|
|||||||
/**
|
/**
|
||||||
* Return widget settings
|
* Return widget settings
|
||||||
*
|
*
|
||||||
* @param array Array
|
* @return array Array
|
||||||
*/
|
*/
|
||||||
public function getWidgets()
|
public function getWidgets()
|
||||||
{
|
{
|
||||||
@ -107,7 +107,7 @@ class DolQueryCollector extends DataCollector implements Renderable, AssetProvid
|
|||||||
/**
|
/**
|
||||||
* Return assets
|
* Return assets
|
||||||
*
|
*
|
||||||
* @param array Array
|
* @return array Array
|
||||||
*/
|
*/
|
||||||
public function getAssets()
|
public function getAssets()
|
||||||
{
|
{
|
||||||
@ -116,4 +116,4 @@ class DolQueryCollector extends DataCollector implements Renderable, AssetProvid
|
|||||||
'js' => 'widgets/sqlqueries/widget.js'
|
'js' => 'widgets/sqlqueries/widget.js'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -14,6 +14,7 @@ class DolibarrCollector extends DataCollector implements Renderable, AssetProvid
|
|||||||
/**
|
/**
|
||||||
* Return collector name
|
* Return collector name
|
||||||
*
|
*
|
||||||
|
* @return string Name
|
||||||
*/
|
*/
|
||||||
public function getName()
|
public function getName()
|
||||||
{
|
{
|
||||||
@ -23,6 +24,7 @@ class DolibarrCollector extends DataCollector implements Renderable, AssetProvid
|
|||||||
/**
|
/**
|
||||||
* Return collected data
|
* Return collected data
|
||||||
*
|
*
|
||||||
|
* @return array Array
|
||||||
*/
|
*/
|
||||||
public function collect()
|
public function collect()
|
||||||
{
|
{
|
||||||
@ -52,6 +54,7 @@ class DolibarrCollector extends DataCollector implements Renderable, AssetProvid
|
|||||||
/**
|
/**
|
||||||
* Return dolibarr info as an HTML string
|
* Return dolibarr info as an HTML string
|
||||||
*
|
*
|
||||||
|
* @return string HTML string
|
||||||
*/
|
*/
|
||||||
protected function getDolibarrInfo()
|
protected function getDolibarrInfo()
|
||||||
{
|
{
|
||||||
@ -71,6 +74,7 @@ class DolibarrCollector extends DataCollector implements Renderable, AssetProvid
|
|||||||
/**
|
/**
|
||||||
* Return mail info as an HTML string
|
* Return mail info as an HTML string
|
||||||
*
|
*
|
||||||
|
* @return string HTML string
|
||||||
*/
|
*/
|
||||||
protected function getMailInfo()
|
protected function getMailInfo()
|
||||||
{
|
{
|
||||||
@ -90,6 +94,7 @@ class DolibarrCollector extends DataCollector implements Renderable, AssetProvid
|
|||||||
/**
|
/**
|
||||||
* Return widget settings
|
* Return widget settings
|
||||||
*
|
*
|
||||||
|
* @return array Array
|
||||||
*/
|
*/
|
||||||
public function getWidgets()
|
public function getWidgets()
|
||||||
{
|
{
|
||||||
@ -130,6 +135,7 @@ class DolibarrCollector extends DataCollector implements Renderable, AssetProvid
|
|||||||
/**
|
/**
|
||||||
* Return collector assests
|
* Return collector assests
|
||||||
*
|
*
|
||||||
|
* @return array Array
|
||||||
*/
|
*/
|
||||||
public function getAssets()
|
public function getAssets()
|
||||||
{
|
{
|
||||||
@ -138,4 +144,4 @@ class DolibarrCollector extends DataCollector implements Renderable, AssetProvid
|
|||||||
'js' => 'js/widgets.js'
|
'js' => 'js/widgets.js'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -67,8 +67,8 @@ class TraceableDB extends DoliDB
|
|||||||
/**
|
/**
|
||||||
* Return datas as an array
|
* Return datas as an array
|
||||||
*
|
*
|
||||||
* @param resource $resultset Resultset of request
|
* @param resource $resultset Resultset of request
|
||||||
* @return array Array
|
* @return array Array
|
||||||
*/
|
*/
|
||||||
public function fetch_row($resultset)
|
public function fetch_row($resultset)
|
||||||
{
|
{
|
||||||
@ -145,6 +145,7 @@ class TraceableDB extends DoliDB
|
|||||||
return $this->db->convertSQLFromMysql($line);
|
return $this->db->convertSQLFromMysql($line);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Renvoie le nombre de lignes dans le resultat d'une requete INSERT, DELETE ou UPDATE
|
* Renvoie le nombre de lignes dans le resultat d'une requete INSERT, DELETE ou UPDATE
|
||||||
*
|
*
|
||||||
@ -154,6 +155,7 @@ class TraceableDB extends DoliDB
|
|||||||
*/
|
*/
|
||||||
public function affected_rows($resultset)
|
public function affected_rows($resultset)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
return $this->db->affected_rows($resultset);
|
return $this->db->affected_rows($resultset);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -284,11 +286,11 @@ class TraceableDB extends DoliDB
|
|||||||
/**
|
/**
|
||||||
* Execute a SQL request and return the resultset
|
* Execute a SQL request and return the resultset
|
||||||
*
|
*
|
||||||
* @param string $query SQL query string
|
* @param string $query SQL query string
|
||||||
* @param int $usesavepoint 0=Default mode, 1=Run a savepoint before and a rollback to savepoint if error (this allow to have some request with errors inside global transactions).
|
* @param int $usesavepoint 0=Default mode, 1=Run a savepoint before and a rollback to savepoint if error (this allow to have some request with errors inside global transactions).
|
||||||
* Note that with Mysql, this parameter is not used as Myssql can already commit a transaction even if one request is in error, without using savepoints.
|
* Note that with Mysql, this parameter is not used as Myssql can already commit a transaction even if one request is in error, without using savepoints.
|
||||||
* @param string $type Type of SQL order ('ddl' for insert, update, select, delete or 'dml' for create, alter...)
|
* @param string $type Type of SQL order ('ddl' for insert, update, select, delete or 'dml' for create, alter...)
|
||||||
* @return resource Resultset of answer
|
* @return resource Resultset of answer
|
||||||
*/
|
*/
|
||||||
public function query($query, $usesavepoint = 0, $type = 'auto')
|
public function query($query, $usesavepoint = 0, $type = 'auto')
|
||||||
{
|
{
|
||||||
@ -303,6 +305,8 @@ class TraceableDB extends DoliDB
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Start query tracing
|
* Start query tracing
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
protected function startTracing()
|
protected function startTracing()
|
||||||
{
|
{
|
||||||
@ -313,8 +317,9 @@ class TraceableDB extends DoliDB
|
|||||||
/**
|
/**
|
||||||
* End query tracing
|
* End query tracing
|
||||||
*
|
*
|
||||||
* @param string $sql query string
|
* @param string $sql query string
|
||||||
* @param string $resql query result
|
* @param string $resql query result
|
||||||
|
* @return void
|
||||||
*/
|
*/
|
||||||
protected function endTracing($sql, $resql)
|
protected function endTracing($sql, $resql)
|
||||||
{
|
{
|
||||||
@ -334,7 +339,7 @@ class TraceableDB extends DoliDB
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Connexion to server
|
* Connexion to server
|
||||||
*
|
*
|
||||||
* @param string $host database server host
|
* @param string $host database server host
|
||||||
* @param string $login login
|
* @param string $login login
|
||||||
@ -393,15 +398,17 @@ class TraceableDB extends DoliDB
|
|||||||
return $this->db->getDefaultCollationDatabase();
|
return $this->db->getDefaultCollationDatabase();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Return number of lines for result of a SELECT
|
* Return number of lines for result of a SELECT
|
||||||
*
|
*
|
||||||
* @param resource $resultset Resulset of requests
|
* @param resource $resultset Resulset of requests
|
||||||
* @return int Nb of lines
|
* @return int Nb of lines
|
||||||
* @see affected_rows()
|
* @see affected_rows()
|
||||||
*/
|
*/
|
||||||
public function num_rows($resultset)
|
public function num_rows($resultset)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
return $this->db->num_rows($resultset);
|
return $this->db->num_rows($resultset);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -568,6 +575,7 @@ class TraceableDB extends DoliDB
|
|||||||
return $this->db->DDLCreateUser($dolibarr_main_db_host, $dolibarr_main_db_user, $dolibarr_main_db_pass, $dolibarr_main_db_name);
|
return $this->db->DDLCreateUser($dolibarr_main_db_host, $dolibarr_main_db_user, $dolibarr_main_db_pass, $dolibarr_main_db_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Convert (by PHP) a PHP server TZ string date into a Timestamps date (GMT if gm=true)
|
* Convert (by PHP) a PHP server TZ string date into a Timestamps date (GMT if gm=true)
|
||||||
* 19700101020000 -> 3600 with TZ+1 and gmt=0
|
* 19700101020000 -> 3600 with TZ+1 and gmt=0
|
||||||
@ -577,8 +585,9 @@ class TraceableDB extends DoliDB
|
|||||||
* @param bool $gm 1=Input informations are GMT values, otherwise local to server TZ
|
* @param bool $gm 1=Input informations are GMT values, otherwise local to server TZ
|
||||||
* @return int|string Date TMS or ''
|
* @return int|string Date TMS or ''
|
||||||
*/
|
*/
|
||||||
public function jdate($string, $gm=false)
|
public function jdate($string, $gm = false)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
return $this->db->jdate($string, $gm);
|
return $this->db->jdate($string, $gm);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -15,4 +15,4 @@ spl_autoload_register(function ($class) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user