Commit 5ea66de0 authored by Johan Cwiklinski's avatar Johan Cwiklinski

Same version everywhere

Some minor cs
parent 810bba2b
......@@ -71,7 +71,7 @@ abstract class AbstractQuery {
*
* @return array
*
* @since 10.0
* @since 10.0.0
*/
abstract public function getParameters();
}
......@@ -7029,7 +7029,7 @@ abstract class CommonITILObject extends CommonDBTM {
/**
* Get common request criteria
*
* @since 10.0
* @since 10.0.0
*
* @return array
*/
......
......@@ -71,7 +71,7 @@ class DBmysql extends AbstractDatabase {
* taking into account the current charset of the connection
*
* @since 0.84
* @deprecated 10.0
* @deprecated 10.0.0
*
* @param string $string String to escape
*
......@@ -86,7 +86,7 @@ class DBmysql extends AbstractDatabase {
/**
* Execute a MySQL query
*
* @deprecated 10.0
* @deprecated 10.0.0
*
* @param string $query Query to execute
*
......@@ -108,7 +108,7 @@ class DBmysql extends AbstractDatabase {
* (optionnaly with a message) if it fails
*
* @since 0.84
* @deprecated 10.0
* @deprecated 10.0.0
*
* @param string $query Query to execute
* @param string $message Explanation of query (default '')
......@@ -128,7 +128,7 @@ class DBmysql extends AbstractDatabase {
*
* @return string[]|null array results
*
* @deprecated 10.0
* @deprecated 10.0.0
*/
function fetch_array($result) {
Toolbox::deprecated('Use AbstractDatabase::fetchArray');
......@@ -142,7 +142,7 @@ class DBmysql extends AbstractDatabase {
*
* @return mixed|null result row
*
* @deprecated 10.0
* @deprecated 10.0.0
*/
function fetch_row($result) {
Toolbox::deprecated('Use AbstractDatabase::fetchRow');
......@@ -156,7 +156,7 @@ class DBmysql extends AbstractDatabase {
*
* @return string[]|null result associative array
*
* @deprecated 10.0
* @deprecated 10.0.0
*/
function fetch_assoc($result) {
Toolbox::deprecated('Use AbstractDatabase::fetchAssoc');
......@@ -170,7 +170,7 @@ class DBmysql extends AbstractDatabase {
*
* @return object|null
*
* @deprecated 10.0
* @deprecated 10.0.0
*/
function fetch_object($result) {
Toolbox::deprecated('Use AbstractDatabase::fetchObject');
......@@ -185,7 +185,7 @@ class DBmysql extends AbstractDatabase {
*
* @return boolean
*
* @deprecated 10.0
* @deprecated 10.0.0
*/
function data_seek($result, $num) {
throw new \RuntimeException('"data_seek" is not supported by PDO MySQL driver.');
......@@ -198,7 +198,7 @@ class DBmysql extends AbstractDatabase {
*
* @return mixed
*
* @deprecated 10.0
* @deprecated 10.0.0
*/
public function insert_id($table = '') {
Toolbox::deprecated('Use AbstractDatabase::insertId');
......@@ -216,7 +216,7 @@ class DBmysql extends AbstractDatabase {
*
* @return int number of fields
*
* @deprecated 10.0
* @deprecated 10.0.0
*/
function num_fields($result) {
Toolbox::deprecated('Use PDOStatement::columnCount()');
......@@ -231,7 +231,7 @@ class DBmysql extends AbstractDatabase {
*
* @return string name of the field
*
* @deprecated 10.0
* @deprecated 10.0.0
*/
function field_name($result, $nb) {
Toolbox::deprecated('Use AbstractDatabase::fieldName()');
......@@ -269,7 +269,7 @@ class DBmysql extends AbstractDatabase {
*
* @return mixed list of fields
*
* @deprecated 10.0
* @deprecated 10.0.0
*/
function list_fields($table, $usecache = true) {
Toolbox::deprecated('Use AbstractDatabase::listFields');
......@@ -300,7 +300,7 @@ class DBmysql extends AbstractDatabase {
*
* @return int number of affected rows on success, and -1 if the last query failed.
*
* @deprecated 10.0
* @deprecated 10.0.0
*/
public function affected_rows() {
throw new \RuntimeException('affected_rows method could not be used... Use PDOStatement::rowCount instead.');
......@@ -313,7 +313,7 @@ class DBmysql extends AbstractDatabase {
*
* @return boolean TRUE on success or FALSE on failure.
*
* @deprecated 10.0
* @deprecated 10.0.0
*/
public function free_result($result) {
Toolbox::deprecated('Use AbstractDatabase::freeResult');
......@@ -356,7 +356,7 @@ class DBmysql extends AbstractDatabase {
* @return boolean
*
* @since 0.90
* @deprecated 10.0
* @deprecated 10.0.0
*/
static public function isMySQLStrictMode(&$msg) {
Toolbox::deprecated();
......
......@@ -514,7 +514,7 @@ class DBmysqlIterator implements Iterator, Countable {
/**
* Retrieve statement parameters
*
* @since 10.0
* @since 10.0.0
*
* @return array
*/
......
......@@ -655,7 +655,7 @@ class IPNetwork extends CommonImplicitTreeDropdown {
/**
* Get SQL WHERE statement for requesting elements that are contained inside the current network
*
* @deprecated 10.0
* @deprecated 10.0.0
*
* @param $tableName name of the table containing the element
* (for instance : glpi_ipaddresses)
......@@ -687,7 +687,7 @@ class IPNetwork extends CommonImplicitTreeDropdown {
/**
* Get SQL WHERE criteria for requesting elements that are contained inside the current network
*
* @since 10.0
* @since 10.0.0
*
* @param string $tableName name of the table containing the element
* (for instance : glpi_ipaddresses)
......
......@@ -429,7 +429,7 @@ class KnowbaseItem extends CommonDBVisible {
* Return visibility SQL restriction to add
*
* @since 0.83
* @since 10.0 Return value changed from string to array
* @since 10.0.0 Return value changed from string to array
*
* @return array with 'sql' and 'params'
**/
......
......@@ -874,7 +874,7 @@ class Migration {
*
* @return Migration
*
* @since 10.0 Added $params parameter
* @since 10.0.0 Added $params parameter
*/
private function addQuery($type, $query, $params, $message = null) {
$this->queries[$type][] = [
......@@ -894,7 +894,7 @@ class Migration {
*
* @return Migration
*
* @since 10.0 Added $params parameter
* @since 10.0.0 Added $params parameter
*/
public function addPreQuery($query, $params = [], $message = null) {
return $this->addQuery(self::PRE_QUERY, $query, $params, $message);
......@@ -909,7 +909,7 @@ class Migration {
*
* @return Migration
*
* @since 10.0 Added $params parameter
* @since 10.0.0 Added $params parameter
*/
public function addPostQuery($query, $params = [], $message = null) {
return $this->addQuery(self::POST_QUERY, $query, $params, $message);
......
......@@ -1269,7 +1269,7 @@ class SavedSearch extends CommonDBTM {
*
* @return string where clause
*
* @since 10.0 Added $qry_params parameter
* @since 10.0.0 Added $qry_params parameter
*/
public static function addWhere($link, $nott, $itemtype, $ID, $searchtype, $val, array &$qry_params, $meta = 0) {
......
......@@ -110,8 +110,8 @@ class Search {
*
* @return void
*
* @since 10.0 Method is no longer static
* @since 10.0 Added $data parameter
* @since 10.0.0 Method is no longer static
* @since 10.0.0 Added $data parameter
**/
public function showList($itemtype, $params, $data = []) {
if (empty($data)) {
......@@ -131,8 +131,8 @@ class Search {
*
* @return void
*
* @since 10.0 Method is no longer static
* @since 10.0 Added $data parameter
* @since 10.0.0 Method is no longer static
* @since 10.0.0 Added $data parameter
**/
public function showMap($itemtype, $params, $data = []) {
global $CFG_GLPI;
......@@ -336,7 +336,7 @@ class Search {
*
* @return data array
*
* @since 10.0 Method has been renamed and is no longer static.
* @since 10.0.0 Method has been renamed and is no longer static.
**/
public function getData($itemtype, $params, array $forcedisplay = []) {
......@@ -360,7 +360,7 @@ class Search {
*
* @return array prepare to be used for a search (include criterias and others needed informations)
*
* @since 10.0 Method has been renamed is no longer static
* @since 10.0.0 Method has been renamed is no longer static
**/
public function prepareDataForSearch($itemtype, array $params, array $forcedisplay = []) {
global $CFG_GLPI;
......@@ -566,7 +566,7 @@ class Search {
*
* @return void
*
* @since 10.0 Method is no longer static
* @since 10.0.0 Method is no longer static
**/
public function constructSQL(array &$data) {
global $CFG_GLPI, $DB;
......@@ -963,7 +963,7 @@ class Search {
*
* @return string the sql sub string
*
* @since 10.0 Method is no longer static
* @since 10.0.0 Method is no longer static
*/
public function constructCriteriaSQL($criteria = [], $data = [], $searchopt = [], $is_having = false) {
$sql = "";
......@@ -1124,7 +1124,7 @@ class Search {
*
* @return void
*
* @since 10.0 Method is no longer static
* @since 10.0.0 Method is no longer static
*/
public function constructAdditionalSqlForMetacriteria($criteria = [],
&$SELECT = "",
......@@ -1202,7 +1202,7 @@ class Search {
*
* @return nothing
*
* @since 10.0 Method is no longer static
* @since 10.0.0 Method is no longer static
**/
public function constructData(array &$data, $onlycount = false) {
if (!isset($data['sql']) || !isset($data['sql']['search'])) {
......@@ -3076,7 +3076,7 @@ JAVASCRIPT;
*
* @return select string
*
* @since 10.0 Method is no longer static
* @since 10.0.0 Method is no longer static
**/
public function addHaving($LINK, $NOT, $itemtype, $ID, $searchtype, $val, $meta) {
......@@ -3174,7 +3174,7 @@ JAVASCRIPT;
*
* @return select string
*
* @since 10.0 Method is no longer static
* @since 10.0.0 Method is no longer static
**/
public function addOrderBy($itemtype, $ID, $order) {
global $CFG_GLPI;
......@@ -3335,7 +3335,7 @@ JAVASCRIPT;
*
* @return string Select SQL string
*
* @since 10.0 Method is no longer static
* @since 10.0.0 Method is no longer static
**/
public function addDefaultSelect($itemtype) {
......@@ -3383,7 +3383,7 @@ JAVASCRIPT;
*
* @return select string
*
* @since 10.0 Method is no longer static
* @since 10.0.0 Method is no longer static
**/
public function addSelect($itemtype, $ID, $meta = 0, $meta_type = 0) {
global $CFG_GLPI;
......@@ -3717,7 +3717,7 @@ JAVASCRIPT;
*
* @return string
*
* @since 10.0 Method is no longer static
* @since 10.0.0 Method is no longer static
**/
public function addDefaultWhere($itemtype) {
$condition = '';
......@@ -4024,7 +4024,7 @@ JAVASCRIPT;
*
* @return select string
*
* @since 10.0 Method is no longer static
* @since 10.0.0 Method is no longer static
**/
public function addWhere($link, $nott, $itemtype, $ID, $searchtype, $val, $meta = 0) {
......@@ -4580,7 +4580,7 @@ JAVASCRIPT;
*
* @return string Left join SQL string
*
* @since 10.0 Method is no longer static
* @since 10.0.0 Method is no longer static
**/
public function addDefaultJoin($itemtype, $ref_table, array &$already_link_tables) {
......@@ -4762,7 +4762,7 @@ JAVASCRIPT;
*
* @return string
*
* @since 10.0 Method is no longer static
* @since 10.0.0 Method is no longer static
**/
public function addLeftJoin($itemtype, $ref_table, array &$already_link_tables, $new_table,
$linkfield, $meta = 0, $meta_type = 0, $joinparams = [], $field = '') {
......@@ -5045,7 +5045,7 @@ JAVASCRIPT;
*
* @return Meta Left join string
*
* @since 10.0 Method is no longer static
* @since 10.0.0 Method is no longer static
**/
public function addMetaLeftJoin($from_type, $to_type, array &$already_link_tables2,
$nullornott, $joinparams = []) {
......@@ -5344,7 +5344,7 @@ JAVASCRIPT;
*
* @return string to print
*
* @since 10.0 Method is no longer static
* @since 10.0.0 Method is no longer static
**/
public function giveItem($itemtype, $ID, array $data, $meta = 0,
array $addobjectparams = [], $orig_itemtype = null) {
......@@ -7538,7 +7538,7 @@ JAVASCRIPT;
*
* @return search SQL string
*
* @since 10.0 Method is no longer static
* @since 10.0.0 Method is no longer static
**/
public function makeTextCriteria ($field, $val, $not = false, $link = 'AND') {
......@@ -7565,7 +7565,7 @@ JAVASCRIPT;
*
* @return string|null
*
* @since 10.0 Method is no longer static
* @since 10.0.0 Method is no longer static
**/
public function makeTextSearchValue($val) {
// Unclean to permit < and > search
......@@ -7598,7 +7598,7 @@ JAVASCRIPT;
*
* @return search string
*
* @since 10.0 Method is no longer static
* @since 10.0.0 Method is no longer static
**/
public function makeTextSearch($val, $not = false) {
......@@ -7668,7 +7668,7 @@ JAVASCRIPT;
*
* @return array
*
* @since 10.0
* @since 10.0.0
*/
public function addQueryParam($param) {
$this->qry_params[] = $param;
......@@ -7682,7 +7682,7 @@ JAVASCRIPT;
*
* @return array
*
* @since 10.0
* @since 10.0.0
*/
public function addQueryParams(array $params) {
$this->qry_params = array_merge($this->qry_params, $params);
......@@ -7694,7 +7694,7 @@ JAVASCRIPT;
*
* @return array
*
* @since 10.0
* @since 10.0.0
*/
public function getQueryParams() {
return $this->qry_params;
......
......@@ -30,7 +30,7 @@
* ---------------------------------------------------------------------
*/
/**
* Update from 9.4 to 10.0
* Update from 9.4 to 10.0.0
*
* @return bool for success (will die for most error)
**/
......
......@@ -51,7 +51,7 @@ use Toolbox;
* @property-read string $dbpassword Database password.
* @property-read string $dbdefault Database name.
*
* @since 10.0
* @since 10.0.0
*/
abstract class AbstractDatabase
{
......@@ -145,7 +145,7 @@ abstract class AbstractDatabase
*
* @return string
*
* @since 10.0
* @since 10.0.0
*/
abstract public function getDriver(): string;
......@@ -157,7 +157,7 @@ abstract class AbstractDatabase
*
* @return PDOStatement
*
* @since 10.0
* @since 10.0.0
*/
public function execute(string $query, array $params = []): PDOStatement
{
......@@ -197,7 +197,7 @@ abstract class AbstractDatabase
*
* @throws GlpitestSQLError
*
* @since 10.0
* @since 10.0.0
*/
public function rawQuery(string $query, array $params = [])
{
......@@ -247,7 +247,7 @@ abstract class AbstractDatabase
*
* @return PDOStatement
*
* @since 10.0
* @since 10.0.0
*/
public function rawQueryOrDie(string $query, $message = null, array $params = []): PDOStatement
{
......@@ -310,13 +310,13 @@ abstract class AbstractDatabase
/**
* Give result from a sql result.
*
* @param PDOStatement $result result handler
* @param integer $i Row offset to give
* @param integer|string $field Field to give
* @param PDOStatement $result result handler
* @param integer $i Row offset to give
* @param integer|string $field Field to give
*
* @return mixed Value of the Row $i and the Field $field of the $result
*
* @deprecated 10.0
* @deprecated 10.0.0
*/
public function result(PDOStatement $result, int $i, $field)
{
......@@ -348,7 +348,7 @@ abstract class AbstractDatabase
*
* @return string[]|null array results
*
* @since 10.0
* @since 10.0.0
*/
public function fetchArray(PDOStatement $result)
{
......@@ -363,7 +363,7 @@ abstract class AbstractDatabase
*
* @return mixed|null result row
*
* @since 10.0
* @since 10.0.0
*/
public function fetchRow(PDOStatement $result)
{
......@@ -377,7 +377,7 @@ abstract class AbstractDatabase
*
* @return string[]|null result associative array
*
* @since 10.0
* @since 10.0.0
*/
public function fetchAssoc(PDOStatement $result)
{
......@@ -392,7 +392,7 @@ abstract class AbstractDatabase
*
* @return object|null
*
* @since 10.0
* @since 10.0.0
*/
public function fetchObject(PDOStatement $result)
{
......@@ -407,7 +407,7 @@ abstract class AbstractDatabase
*
* @return mixed
*
* @since 10.0
* @since 10.0.0
*/
abstract public function insertId(string $table = '');
......@@ -438,7 +438,7 @@ abstract class AbstractDatabase
*
* @return boolean TRUE on success or FALSE on failure.
*
* @since 10.0
* @since 10.0.0
*/
public function freeResult(PDOStatement $result): bool
{
......@@ -692,7 +692,7 @@ abstract class AbstractDatabase
*
* @return mixed
*
* @since 10.0
* @since 10.0.0
*/
public function quote($value, int $type = \PDO::PARAM_STR)
{
......@@ -704,7 +704,7 @@ abstract class AbstractDatabase
*
* @return string
*
* @since 10.0
* @since 10.0.0
*/
abstract public static function getQuoteNameChar(): string;
......@@ -754,7 +754,7 @@ abstract class AbstractDatabase
*
* @return mixed
*
* @since 10.0 Method is more static
* @since 10.0.0 Method is more static
*/
public function quoteValue($value)
{
......@@ -964,8 +964,13 @@ abstract class AbstractDatabase
*
* @return PDOStatement Query result handler
*/
public function updateOrDie(string $table, array $params, array $where, $message = null, array $joins = []): PDOStatement
{
public function updateOrDie(
string $table,
array $params,
array $where,
$message = null,
array $joins = []
): PDOStatement {
$update = $this->buildUpdate($table, $params, $where, $joins);
$res = $this->rawQuery($update, $params);
if (!$res) {
......@@ -1099,7 +1104,7 @@ abstract class AbstractDatabase
/**
* Truncate table in the database
*
* @since 10.0
* @since 10.0.0
*
* @param string $table Table name
*
......@@ -1116,7 +1121,7 @@ abstract class AbstractDatabase
* Truncate table in the database and die
* (optionnaly with a message) if it fails
*
* @since 10.0
* @since 10.0.0
*
* @param string $table Table name
* @param string|null $message Explanation of query
......@@ -1148,10 +1153,8 @@ abstract class AbstractDatabase
/**
* Get table schema
*
* @param string $table
* Table name,
* @param string|null $structure
* Raw table structure
* @param string $table Table name
* @param string|null $structure Raw table structure
*
* @return array
*/
......@@ -1209,7 +1212,7 @@ abstract class AbstractDatabase
*
* @return boolean
*
* @since 10.0
* @since 10.0.0
*/
public function inTransaction(): bool
{
......@@ -1223,7 +1226,7 @@ abstract class AbstractDatabase
*
* @return null|string
*
* @since 10.0
* @since 10.0.0
*/
public function getDsn($server)
{
......@@ -1261,7 +1264,7 @@ abstract class AbstractDatabase
*
* @return boolean
*
* @since 10.0
* @since 10.0.0
*/
public static function isNameQuoted($value): bool
{
......@@ -1275,7 +1278,7 @@ abstract class AbstractDatabase
* @param string $sql SQL statement
* @param array $parameters Query parameters
*
* @since 10.0
* @since 10.0.0
*
* @return string
*/
......@@ -1314,8 +1317,8 @@ abstract class AbstractDatabase
/**
* Give name of a field/column of a Mysql result.
*
* @param PDOStatement $result Resultset
* @param integer $i Index of the field/column
* @param PDOStatement $result Resultset
* @param integer $i Index of the field/column
*
* @return string Name of the field
*/
......
......@@ -39,7 +39,7 @@ use Zend\Cache\Psr\SimpleCache\SimpleCacheDecorator;
*
* This decorator aims to make transparent any future change of cache management component.
*
* @since 10.0
* @since 10.0.0
*/
class SimpleCache extends SimpleCacheDecorator
{
......
......@@ -36,7 +36,7 @@ use CommonDBTM;
use Symfony\Component\EventDispatcher\Event;
/**
* @since 10.0
* @since 10.0.0