diff options
| author | Damien Regad <dregad@mantisbt.org> | 2025-10-25 01:12:07 +0200 |
|---|---|---|
| committer | Damien Regad <dregad@mantisbt.org> | 2025-10-25 01:12:07 +0200 |
| commit | 481bb5292033af2918bea9a9af4b551781d17f5f (patch) | |
| tree | ae01b368c98ec0061b5937884f8ce696de133551 /drivers | |
| parent | 4cacd51045237191d07f98aa4d85f35647fc92e1 (diff) | |
| download | adodb-481bb5292033af2918bea9a9af4b551781d17f5f.tar.gz adodb-481bb5292033af2918bea9a9af4b551781d17f5f.tar.bz2 adodb-481bb5292033af2918bea9a9af4b551781d17f5f.zip | |
PHP 8.5: fix Non-canonical cast deprecations
Non-canonical cast (integer) is deprecated, use the (int) cast instead
Global search and replace throughout the code base.
Fixes #1143
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/adodb-ado.inc.php | 2 | ||||
| -rw-r--r-- | drivers/adodb-ado5.inc.php | 2 | ||||
| -rw-r--r-- | drivers/adodb-ads.inc.php | 2 | ||||
| -rw-r--r-- | drivers/adodb-csv.inc.php | 4 | ||||
| -rw-r--r-- | drivers/adodb-db2.inc.php | 10 | ||||
| -rw-r--r-- | drivers/adodb-db2oci.inc.php | 2 | ||||
| -rw-r--r-- | drivers/adodb-db2ora.inc.php | 2 | ||||
| -rw-r--r-- | drivers/adodb-firebird.inc.php | 8 | ||||
| -rw-r--r-- | drivers/adodb-ibase.inc.php | 4 | ||||
| -rw-r--r-- | drivers/adodb-ldap.inc.php | 10 | ||||
| -rw-r--r-- | drivers/adodb-odbc.inc.php | 2 | ||||
| -rw-r--r-- | drivers/adodb-odbc_db2.inc.php | 2 | ||||
| -rw-r--r-- | drivers/adodb-pdo.inc.php | 6 | ||||
| -rw-r--r-- | drivers/adodb-pdo_dblib.inc.php | 2 | ||||
| -rw-r--r-- | drivers/adodb-pdo_firebird.inc.php | 6 | ||||
| -rw-r--r-- | drivers/adodb-postgres7.inc.php | 4 | ||||
| -rw-r--r-- | drivers/adodb-sqlanywhere.inc.php | 4 | ||||
| -rw-r--r-- | drivers/adodb-sybase.inc.php | 4 | ||||
| -rw-r--r-- | drivers/adodb-text.inc.php | 2 |
19 files changed, 39 insertions, 39 deletions
diff --git a/drivers/adodb-ado.inc.php b/drivers/adodb-ado.inc.php index df95c690..b0979ff5 100644 --- a/drivers/adodb-ado.inc.php +++ b/drivers/adodb-ado.inc.php @@ -407,7 +407,7 @@ class ADORecordSet_ado extends ADORecordSet { // $rs->AbsolutePosition->$row-2; // return true; if ($this->_currentRow > $row) return false; - @$rs->Move((integer)$row - $this->_currentRow-1); //adBookmarkFirst + @$rs->Move((int)$row - $this->_currentRow-1); //adBookmarkFirst return true; } diff --git a/drivers/adodb-ado5.inc.php b/drivers/adodb-ado5.inc.php index 04b45abf..e4fa0cfe 100644 --- a/drivers/adodb-ado5.inc.php +++ b/drivers/adodb-ado5.inc.php @@ -451,7 +451,7 @@ class ADORecordSet_ado extends ADORecordSet { // $rs->AbsolutePosition->$row-2; // return true; if ($this->_currentRow > $row) return false; - @$rs->Move((integer)$row - $this->_currentRow-1); //adBookmarkFirst + @$rs->Move((int)$row - $this->_currentRow-1); //adBookmarkFirst return true; } diff --git a/drivers/adodb-ads.inc.php b/drivers/adodb-ads.inc.php index 16eec976..436a2d62 100644 --- a/drivers/adodb-ads.inc.php +++ b/drivers/adodb-ads.inc.php @@ -371,7 +371,7 @@ class ADODB_ads extends ADOConnection */ function ODBCTypes($t) { - switch ((integer)$t) { + switch ((int)$t) { case 1: case 12: case 0: diff --git a/drivers/adodb-csv.inc.php b/drivers/adodb-csv.inc.php index e6694d9a..8f1a7dd6 100644 --- a/drivers/adodb-csv.inc.php +++ b/drivers/adodb-csv.inc.php @@ -103,7 +103,7 @@ class ADODB_csv extends ADOConnection { $at = strpos($err,'::::'); if ($at === false) { $this->_errorMsg = $err; - $this->_errorNo = (integer)$err; + $this->_errorNo = (int)$err; } else { $this->_errorMsg = substr($err,$at+4,1024); $this->_errorNo = -9999; @@ -159,7 +159,7 @@ class ADODB_csv extends ADOConnection { $at = strpos($err,'::::'); if ($at === false) { $this->_errorMsg = $err; - $this->_errorNo = (integer)$err; + $this->_errorNo = (int)$err; } else { $this->_errorMsg = substr($err,$at+4,1024); $this->_errorNo = -9999; diff --git a/drivers/adodb-db2.inc.php b/drivers/adodb-db2.inc.php index 60cd093a..77466db1 100644 --- a/drivers/adodb-db2.inc.php +++ b/drivers/adodb-db2.inc.php @@ -179,7 +179,7 @@ class ADODB_db2 extends ADOConnection { $db2Options); } else - + $this->_connectionID = $db2Function($argDSN, '', '', @@ -193,7 +193,7 @@ class ADODB_db2 extends ADOConnection { if ($this->_connectionID && $argDatabasename) $this->execute("SET SCHEMA=$argDatabasename"); - + return $this->_connectionID != false; } @@ -228,7 +228,7 @@ class ADODB_db2 extends ADOConnection { $connectionParameters['dsn'] = $argDSN; $connectionParameters['database'] = $argDatabasename; $connectionParameters['catalogue'] = false; - + return $connectionParameters; } @@ -537,7 +537,7 @@ class ADODB_db2 extends ADOConnection { function selectLimit($sql,$nrows=-1,$offset=-1,$inputArr=false,$secs2cache=0) { - $nrows = (integer) $nrows; + $nrows = (int) $nrows; if ($offset <= 0) { @@ -1059,7 +1059,7 @@ See http://msdn.microsoft.com/library/default.asp?url=/library/en-us/db2/htm/db2 */ function DB2Types($t) { - switch ((integer)$t) { + switch ((int)$t) { case 1: case 12: case 0: diff --git a/drivers/adodb-db2oci.inc.php b/drivers/adodb-db2oci.inc.php index eea63d94..4e98d141 100644 --- a/drivers/adodb-db2oci.inc.php +++ b/drivers/adodb-db2oci.inc.php @@ -101,7 +101,7 @@ function _colonparser($sql,$arr) $ch2 = $at < $lensql ? $sql[$at] : ''; } while ('0' <= $ch && $ch <= '9'); #echo "$n $arrsize ] "; - $n = (integer) $n; + $n = (int) $n; if ($n < $arrsize) { $sql2 .= substr($sql,$nprev,$nat-$nprev-1).'?'; $nprev = $at-1; diff --git a/drivers/adodb-db2ora.inc.php b/drivers/adodb-db2ora.inc.php index d343a8ae..71b21e90 100644 --- a/drivers/adodb-db2ora.inc.php +++ b/drivers/adodb-db2ora.inc.php @@ -41,7 +41,7 @@ define('ADODB_DB2OCI',1); function _colontrack($p) { global $_COLONARR, $_COLONSZ; - $v = (integer) substr($p[1], 1); + $v = (int) substr($p[1], 1); if ($v > $_COLONSZ) return $p[1]; $_COLONARR[] = $v; return '?'; diff --git a/drivers/adodb-firebird.inc.php b/drivers/adodb-firebird.inc.php index db3cca5d..52d751d8 100644 --- a/drivers/adodb-firebird.inc.php +++ b/drivers/adodb-firebird.inc.php @@ -427,7 +427,7 @@ class ADODB_firebird extends ADOConnection { $rs = $this->Execute($getnext); } if ($rs && !$rs->EOF) { - $this->genID = (integer) reset($rs->fields); + $this->genID = (int) reset($rs->fields); } else { $this->genID = 0; // false @@ -454,7 +454,7 @@ class ADODB_firebird extends ADOConnection { public function errorNo() { - return (integer) $this->_errorCode; + return (int) $this->_errorCode; } function errorMsg() @@ -989,8 +989,8 @@ class ADODB_firebird extends ADOConnection { */ public function selectLimit($sql,$nrows=-1,$offset=-1,$inputarr=false, $secs2cache=0) { - $nrows = (integer) $nrows; - $offset = (integer) $offset; + $nrows = (int) $nrows; + $offset = (int) $offset; $str = 'SELECT '; if ($nrows >= 0) $str .= "FIRST $nrows "; $str .=($offset>=0) ? "SKIP $offset " : ''; diff --git a/drivers/adodb-ibase.inc.php b/drivers/adodb-ibase.inc.php index 8159c512..7a37976b 100644 --- a/drivers/adodb-ibase.inc.php +++ b/drivers/adodb-ibase.inc.php @@ -289,7 +289,7 @@ class ADODB_ibase extends ADOConnection { $rs = $this->Execute($getnext); } if ($rs && !$rs->EOF) { - $this->genID = (integer) reset($rs->fields); + $this->genID = (int) reset($rs->fields); } else { $this->genID = 0; // false @@ -314,7 +314,7 @@ class ADODB_ibase extends ADOConnection { function ErrorNo() { - if (preg_match('/error code = ([\-0-9]*)/i', $this->_errorMsg,$arr)) return (integer) $arr[1]; + if (preg_match('/error code = ([\-0-9]*)/i', $this->_errorMsg,$arr)) return (int) $arr[1]; else return 0; } diff --git a/drivers/adodb-ldap.inc.php b/drivers/adodb-ldap.inc.php index e1cba330..55d4334a 100644 --- a/drivers/adodb-ldap.inc.php +++ b/drivers/adodb-ldap.inc.php @@ -101,11 +101,11 @@ class ADODB_ldap extends ADOConnection { /* Valid Domain Values for LDAP Options: - LDAP_OPT_DEREF (integer) - LDAP_OPT_SIZELIMIT (integer) - LDAP_OPT_TIMELIMIT (integer) - LDAP_OPT_PROTOCOL_VERSION (integer) - LDAP_OPT_ERROR_NUMBER (integer) + LDAP_OPT_DEREF (int) + LDAP_OPT_SIZELIMIT (int) + LDAP_OPT_TIMELIMIT (int) + LDAP_OPT_PROTOCOL_VERSION (int) + LDAP_OPT_ERROR_NUMBER (int) LDAP_OPT_REFERRALS (boolean) LDAP_OPT_RESTART (boolean) LDAP_OPT_HOST_NAME (string) diff --git a/drivers/adodb-odbc.inc.php b/drivers/adodb-odbc.inc.php index 56db8b0e..13184d07 100644 --- a/drivers/adodb-odbc.inc.php +++ b/drivers/adodb-odbc.inc.php @@ -355,7 +355,7 @@ See http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odbc/htm/od */ function ODBCTypes($t) { - switch ((integer)$t) { + switch ((int)$t) { case 1: case 12: case 0: diff --git a/drivers/adodb-odbc_db2.inc.php b/drivers/adodb-odbc_db2.inc.php index 8f0e60cb..a3ac67ed 100644 --- a/drivers/adodb-odbc_db2.inc.php +++ b/drivers/adodb-odbc_db2.inc.php @@ -212,7 +212,7 @@ class ADODB_ODBC_DB2 extends ADODB_odbc { function SelectLimit($sql, $nrows = -1, $offset = -1, $inputArr = false, $secs2cache = 0) { - $nrows = (integer) $nrows; + $nrows = (int) $nrows; if ($offset <= 0) { // could also use " OPTIMIZE FOR $nrows ROWS " if ($nrows >= 0) $sql .= " FETCH FIRST $nrows ROWS ONLY "; diff --git a/drivers/adodb-pdo.inc.php b/drivers/adodb-pdo.inc.php index d3ce12d0..d254895e 100644 --- a/drivers/adodb-pdo.inc.php +++ b/drivers/adodb-pdo.inc.php @@ -404,7 +404,7 @@ class ADODB_pdo extends ADOConnection { if (sizeof($arr)<2) { return ''; } - if ((integer)$arr[0]) { + if ((int)$arr[0]) { return $arr[2]; } else { @@ -616,7 +616,7 @@ class ADODB_pdo extends ADOConnection { if ($stmt) { $arr = $stmt->errorinfo(); - if ((integer)$arr[1]) { + if ((int)$arr[1]) { $this->_errormsg = $arr[2]; $this->_errorno = $arr[1]; } @@ -752,7 +752,7 @@ class ADOPDOStatement { } if (is_array($arr)) { - if ((integer) $arr[0] && isset($arr[2])) { + if ((int) $arr[0] && isset($arr[2])) { return $arr[2]; } else { diff --git a/drivers/adodb-pdo_dblib.inc.php b/drivers/adodb-pdo_dblib.inc.php index aae561bf..fa217af0 100644 --- a/drivers/adodb-pdo_dblib.inc.php +++ b/drivers/adodb-pdo_dblib.inc.php @@ -163,7 +163,7 @@ class ADODB_pdo_dblib extends ADODB_pdo if ($stmt) { $arr = $stmt->errorinfo(); - if ((integer)$arr[1]) { + if ((int)$arr[1]) { $this->_errormsg = $arr[2]; $this->_errorno = $arr[1]; } diff --git a/drivers/adodb-pdo_firebird.inc.php b/drivers/adodb-pdo_firebird.inc.php index 1ccbf01c..4671b396 100644 --- a/drivers/adodb-pdo_firebird.inc.php +++ b/drivers/adodb-pdo_firebird.inc.php @@ -245,7 +245,7 @@ class ADODB_pdo_firebird extends ADODB_pdo_base $rs = $this->execute($getnext); } if ($rs && !$rs->EOF) { - $this->genID = (integer)reset($rs->fields); + $this->genID = (int)reset($rs->fields); } else { $this->genID = 0; // false } @@ -259,8 +259,8 @@ class ADODB_pdo_firebird extends ADODB_pdo_base public function selectLimit($sql, $nrows = -1, $offset = -1, $inputarr = false, $secs = 0) { - $nrows = (integer)$nrows; - $offset = (integer)$offset; + $nrows = (int)$nrows; + $offset = (int)$offset; $str = 'SELECT '; if ($nrows >= 0) { $str .= "FIRST $nrows "; diff --git a/drivers/adodb-postgres7.inc.php b/drivers/adodb-postgres7.inc.php index b5e63acf..9559eb00 100644 --- a/drivers/adodb-postgres7.inc.php +++ b/drivers/adodb-postgres7.inc.php @@ -117,8 +117,8 @@ class ADODB_postgres7 extends ADODB_postgres64 { { $nrows = (int) $nrows; $offset = (int) $offset; - $offsetStr = ($offset >= 0) ? " OFFSET ".((integer)$offset) : ''; - $limitStr = ($nrows >= 0) ? " LIMIT ".((integer)$nrows) : ''; + $offsetStr = ($offset >= 0) ? " OFFSET ".((int)$offset) : ''; + $limitStr = ($nrows >= 0) ? " LIMIT ".((int)$nrows) : ''; if ($secs2cache) $rs = $this->CacheExecute($secs2cache,$sql."$limitStr$offsetStr",$inputarr); else diff --git a/drivers/adodb-sqlanywhere.inc.php b/drivers/adodb-sqlanywhere.inc.php index 8d909fde..3bbf6155 100644 --- a/drivers/adodb-sqlanywhere.inc.php +++ b/drivers/adodb-sqlanywhere.inc.php @@ -55,7 +55,7 @@ if (!defined('ADODB_SYBASE_SQLANYWHERE')){ $fd = fopen ($filename, "rb"); - $integer_chunks = (integer)filesize($filename) / $chunk_size; + $integer_chunks = (int)filesize($filename) / $chunk_size; $modulus = filesize($filename) % $chunk_size; if ($modulus != 0){ $integer_chunks += 1; @@ -83,7 +83,7 @@ if (!defined('ADODB_SYBASE_SQLANYWHERE')){ function load_blobvar_from_var($blobVarName, &$varName) { $chunk_size = 1000; - $integer_chunks = (integer)strlen($varName) / $chunk_size; + $integer_chunks = (int)strlen($varName) / $chunk_size; $modulus = strlen($varName) % $chunk_size; if ($modulus != 0){ $integer_chunks += 1; diff --git a/drivers/adodb-sybase.inc.php b/drivers/adodb-sybase.inc.php index 79fb82e8..699025f2 100644 --- a/drivers/adodb-sybase.inc.php +++ b/drivers/adodb-sybase.inc.php @@ -188,8 +188,8 @@ class ADODB_sybase extends ADOConnection { return $rs; } - $nrows = (integer) $nrows; - $offset = (integer) $offset; + $nrows = (int) $nrows; + $offset = (int) $offset; $cnt = ($nrows >= 0) ? $nrows : 999999999; if ($offset > 0 && $cnt) $cnt += $offset; diff --git a/drivers/adodb-text.inc.php b/drivers/adodb-text.inc.php index 36a1a0d4..afdfe71d 100644 --- a/drivers/adodb-text.inc.php +++ b/drivers/adodb-text.inc.php @@ -257,7 +257,7 @@ class ADODB_text extends ADOConnection { preg_match("/$eregword/",$orderby,$arr); if (sizeof($arr) < 2) return $this; // actually invalid sql $col = $arr[1]; - $at = (integer) $col; + $at = (int) $col; if ($at == 0) { $i = 0; reset($projnames); |
