From 01f566bc7fd910771ce8cd4ec0a957bf00024db9 Mon Sep 17 00:00:00 2001 From: Jason Coward Date: Thu, 4 Dec 2025 11:56:48 -0700 Subject: [PATCH 1/2] Replace non-canonical cast names deprecated in PHP 8.5 --- src/xPDO/Cache/xPDOCache.php | 2 +- src/xPDO/Cache/xPDOCacheManager.php | 6 +++--- src/xPDO/Cache/xPDOFileCache.php | 4 ++-- src/xPDO/Cache/xPDOMemCache.php | 4 ++-- src/xPDO/Cache/xPDOMemCached.php | 4 ++-- src/xPDO/Cache/xPDORedisCache.php | 4 ++-- src/xPDO/Om/sqlsrv/xPDOQuery.php | 2 +- src/xPDO/Om/xPDOGenerator.php | 10 +++++----- src/xPDO/Om/xPDOObject.php | 22 +++++++++++----------- src/xPDO/Om/xPDOQuery.php | 2 +- src/xPDO/Transport/xPDOFileVehicle.php | 4 ++-- src/xPDO/Transport/xPDOObjectVehicle.php | 2 +- src/xPDO/Validation/xPDOValidator.php | 2 +- src/xPDO/xPDO.php | 14 +++++++------- src/xPDO/xPDOConnection.php | 2 +- tools/schema/upgrade-mysql-1.1.php | 2 +- 16 files changed, 43 insertions(+), 43 deletions(-) diff --git a/src/xPDO/Cache/xPDOCache.php b/src/xPDO/Cache/xPDOCache.php index 6e14c1cf..1b70ffc8 100644 --- a/src/xPDO/Cache/xPDOCache.php +++ b/src/xPDO/Cache/xPDOCache.php @@ -36,7 +36,7 @@ public function __construct(& $xpdo, $options = array()) { * @return boolean true if the implementation was initialized successfully. */ public function isInitialized() { - return (boolean) $this->initialized; + return (bool) $this->initialized; } /** diff --git a/src/xPDO/Cache/xPDOCacheManager.php b/src/xPDO/Cache/xPDOCacheManager.php index 7b6416a7..2bc30db7 100644 --- a/src/xPDO/Cache/xPDOCacheManager.php +++ b/src/xPDO/Cache/xPDOCacheManager.php @@ -215,8 +215,8 @@ public function writeFile($filename, $content, $mode= 'wb', $options= array()) { } else { $locked = false; $attempt = 1; - $attempts = (integer) $this->getOption(xPDO::OPT_CACHE_ATTEMPTS, $options, 1); - $attemptDelay = (integer) $this->getOption(xPDO::OPT_CACHE_ATTEMPT_DELAY, $options, 1000); + $attempts = (int) $this->getOption(xPDO::OPT_CACHE_ATTEMPTS, $options, 1); + $attemptDelay = (int) $this->getOption(xPDO::OPT_CACHE_ATTEMPT_DELAY, $options, 1000); while (!$locked && ($attempts === 0 || $attempt <= $attempts)) { if ($this->getOption('use_flock', $options, true)) { $locked = flock($file, LOCK_EX | LOCK_NB); @@ -466,7 +466,7 @@ public function deleteTree($dirname, $options= array('deleteTop' => false, 'skip if (!is_array($options)) { $numArgs = func_num_args(); $options = array( - 'deleteTop' => is_scalar($options) ? (boolean) $options : false + 'deleteTop' => is_scalar($options) ? (bool) $options : false ,'skipDirs' => $numArgs > 2 ? func_get_arg(2) : false ,'extensions' => $numArgs > 3 ? func_get_arg(3) : array('.cache.php') ); diff --git a/src/xPDO/Cache/xPDOFileCache.php b/src/xPDO/Cache/xPDOFileCache.php index 0dc2b02f..51edeb6f 100644 --- a/src/xPDO/Cache/xPDOFileCache.php +++ b/src/xPDO/Cache/xPDOFileCache.php @@ -56,7 +56,7 @@ public function set($key, $var, $expire= 0, $options= array()) { $expireContent= 'if(time() > ' . $expirationTS . '){return null;}'; } $fileName= $this->getCacheKey($key, $options); - $format = (integer) $this->getOption(xPDO::OPT_CACHE_FORMAT, $options, xPDOCacheManager::CACHE_PHP); + $format = (int) $this->getOption(xPDO::OPT_CACHE_FORMAT, $options, xPDOCacheManager::CACHE_PHP); switch ($format) { case xPDOCacheManager::CACHE_SERIALIZE: $content= serialize(array('expires' => $expirationTS, 'content' => $var)); @@ -107,7 +107,7 @@ public function get($key, $options= array()) { $cacheKey= $this->getCacheKey($key, $options); if (file_exists($cacheKey)) { if ($file = @fopen($cacheKey, 'rb')) { - $format = (integer) $this->getOption(xPDO::OPT_CACHE_FORMAT, $options, xPDOCacheManager::CACHE_PHP); + $format = (int) $this->getOption(xPDO::OPT_CACHE_FORMAT, $options, xPDOCacheManager::CACHE_PHP); if (flock($file, LOCK_SH)) { switch ($format) { case xPDOCacheManager::CACHE_PHP: diff --git a/src/xPDO/Cache/xPDOMemCache.php b/src/xPDO/Cache/xPDOMemCache.php index 66715fa4..3a807ddf 100644 --- a/src/xPDO/Cache/xPDOMemCache.php +++ b/src/xPDO/Cache/xPDOMemCache.php @@ -31,13 +31,13 @@ public function __construct(& $xpdo, $options = array()) { $servers = explode(',', $this->getOption($this->key . '_memcached_server', $options, $this->getOption('memcached_server', $options, 'localhost:11211'))); foreach ($servers as $server) { $server = explode(':', $server); - $this->memcache->addServer($server[0], (integer) $server[1]); + $this->memcache->addServer($server[0], (int) $server[1]); } $compressThreshold = $this->getOption($this->key . '_memcached_compress_threshold', $options, $this->getOption('memcached_compress_threshold', array(), '20000:0.2')); if (!empty($compressThreshold)) { $threshold = explode(':', $compressThreshold); if (count($threshold) == 2) { - $minValue = (integer) $threshold[0]; + $minValue = (int) $threshold[0]; $minSaving = (float) $threshold[1]; if ($minSaving >= 0 && $minSaving <= 1) { $this->memcache->setCompressThreshold($minValue, $minSaving); diff --git a/src/xPDO/Cache/xPDOMemCached.php b/src/xPDO/Cache/xPDOMemCached.php index dd7cfa54..e5b5696a 100644 --- a/src/xPDO/Cache/xPDOMemCached.php +++ b/src/xPDO/Cache/xPDOMemCached.php @@ -31,9 +31,9 @@ public function __construct(& $xpdo, $options = array()) { $servers = explode(',', $this->getOption($this->key . '_memcached_server', $options, $this->getOption('memcached_server', $options, 'localhost:11211'))); foreach ($servers as $server) { $server = explode(':', $server); - $this->memcached->addServer($server[0], (integer) $server[1]); + $this->memcached->addServer($server[0], (int) $server[1]); } - $this->memcached->setOption(Memcached::OPT_COMPRESSION, (boolean) $this->getOption($this->key . '_memcached_compression', $options, $this->getOption('memcached_compression', $options, $this->getOption(Memcached::OPT_COMPRESSION, $options, true)))); + $this->memcached->setOption(Memcached::OPT_COMPRESSION, (bool) $this->getOption($this->key . '_memcached_compression', $options, $this->getOption('memcached_compression', $options, $this->getOption(Memcached::OPT_COMPRESSION, $options, true)))); $this->initialized = true; } else { $this->memcached = null; diff --git a/src/xPDO/Cache/xPDORedisCache.php b/src/xPDO/Cache/xPDORedisCache.php index 81722103..4dc84ff7 100644 --- a/src/xPDO/Cache/xPDORedisCache.php +++ b/src/xPDO/Cache/xPDORedisCache.php @@ -38,12 +38,12 @@ public function __construct(&$xpdo, $options = []) $this->getOption('redis_server', $options, 'localhost:6379') ) ); - if ($this->redis->pconnect($server[0], (integer)$server[1])) { + if ($this->redis->pconnect($server[0], (int)$server[1])) { $redis_auth = $this->getOption('redis_auth', $options, ''); if (!empty($redis_auth)) { $this->redis->auth($redis_auth); } - $this->redis->select((integer)$this->getOption('redis_db', $options, 0)); + $this->redis->select((int)$this->getOption('redis_db', $options, 0)); $this->redis->setOption(Redis::OPT_SERIALIZER, Redis::SERIALIZER_PHP); $this->initialized = true; } diff --git a/src/xPDO/Om/sqlsrv/xPDOQuery.php b/src/xPDO/Om/sqlsrv/xPDOQuery.php index f8adac8e..d191ea95 100644 --- a/src/xPDO/Om/sqlsrv/xPDOQuery.php +++ b/src/xPDO/Om/sqlsrv/xPDOQuery.php @@ -100,7 +100,7 @@ public function parseConditions($conditions, $conjunction = xPDOQuery::SQL_AND) foreach ($val as $v) { switch ($type) { case \PDO::PARAM_INT: - $vals[] = (integer) $v; + $vals[] = (int) $v; break; case \PDO::PARAM_STR: $vals[] = $this->xpdo->quote($v); diff --git a/src/xPDO/Om/xPDOGenerator.php b/src/xPDO/Om/xPDOGenerator.php index 3a0fa4dd..11baccef 100644 --- a/src/xPDO/Om/xPDOGenerator.php +++ b/src/xPDO/Om/xPDOGenerator.php @@ -240,12 +240,12 @@ abstract public function writeSchema(string $schemaFile, string $package = '', s public function parseSchema($schemaFile, $outputDir= '', $options = array()) { $this->_reset(); if (!is_array($options)) { - $compile = (boolean) $options; + $compile = (bool) $options; } else { - $compile = array_key_exists('compile', $options) ? (boolean) $options['compile'] : false; + $compile = array_key_exists('compile', $options) ? (bool) $options['compile'] : false; } - $regenerate = array_key_exists('regenerate', $options) ? (integer) $options['regenerate'] : 0; - $update = array_key_exists('update', $options) ? (integer) $options['update'] : 2; + $regenerate = array_key_exists('regenerate', $options) ? (int) $options['regenerate'] : 0; + $update = array_key_exists('update', $options) ? (int) $options['update'] : 2; $namespacePrefix = array_key_exists('namespacePrefix', $options) ? trim($options['namespacePrefix'], '\\') : ''; $this->schemaFile= $schemaFile; @@ -307,7 +307,7 @@ public function parseSchema($schemaFile, $outputDir= '', $options = array()) { case 'integer': case 'boolean': case 'bit': - $fldAttrValue = (integer) $fldAttrValue; + $fldAttrValue = (int) $fldAttrValue; break; case 'float': case 'numeric': diff --git a/src/xPDO/Om/xPDOObject.php b/src/xPDO/Om/xPDOObject.php index e609ed96..dcb4a641 100644 --- a/src/xPDO/Om/xPDOObject.php +++ b/src/xPDO/Om/xPDOObject.php @@ -460,7 +460,7 @@ public static function loadCollection(xPDO & $xpdo, $className, $criteria= null, if (!$className= $xpdo->loadClass($className)) return $objCollection; $rows= false; $fromCache= false; - $collectionCaching = (integer) $xpdo->getOption(xPDO::OPT_CACHE_DB_COLLECTIONS, array(), 1); + $collectionCaching = (int) $xpdo->getOption(xPDO::OPT_CACHE_DB_COLLECTIONS, array(), 1); if (!is_object($criteria)) { $criteria= $xpdo->getCriteria($className, $criteria, $cacheFlag); } @@ -516,7 +516,7 @@ public static function loadCollectionGraph(xPDO & $xpdo, $className, $graph, $cr $query->bindGraph($graph); $rows = array(); $fromCache = false; - $collectionCaching = (integer) $xpdo->getOption(xPDO::OPT_CACHE_DB_COLLECTIONS, array(), 1); + $collectionCaching = (int) $xpdo->getOption(xPDO::OPT_CACHE_DB_COLLECTIONS, array(), 1); if ($collectionCaching > 0 && $xpdo->_cacheEnabled && $cacheFlag) { $rows= $xpdo->fromCache($query); $fromCache = !empty($rows); @@ -797,7 +797,7 @@ public function set($k, $v= null, $vType= '') { //type validation $phptype= $this->_fieldMeta[$k]['phptype']; $dbtype= $this->_fieldMeta[$k]['dbtype']; - $allowNull= isset($this->_fieldMeta[$k]['null']) ? (boolean) $this->_fieldMeta[$k]['null'] : true; + $allowNull= isset($this->_fieldMeta[$k]['null']) ? (bool) $this->_fieldMeta[$k]['null'] : true; if ($v === null) { if ($allowNull) { $this->_fields[$k]= null; @@ -813,7 +813,7 @@ public function set($k, $v= null, $vType= '') { $ts= false; if (preg_match('/int/i', $dbtype)) { if (strtolower($vType) == 'integer' || is_int($v) || $v == '0') { - $ts= (integer) $v; + $ts= (int) $v; } else { $ts= strtotime($v); } @@ -842,7 +842,7 @@ public function set($k, $v= null, $vType= '') { case 'date' : if (preg_match('/int/i', $dbtype)) { if (strtolower($vType) == 'integer' || is_int($v) || $v == '0') { - $ts= (integer) $v; + $ts= (int) $v; } else { $ts= strtotime($v); } @@ -974,7 +974,7 @@ public function get($k, $format = null, $formatTemplate= null) { if ($value !== null) { switch ($fieldType) { case 'boolean' : - $value= (boolean) $value; + $value= (bool) $value; break; case 'integer' : $value= intval($value); @@ -1707,8 +1707,8 @@ public function remove(array $ancestors= array ()) { array( xPDO::OPT_CACHE_KEY => $this->getOption('cache_db_key', null, 'db'), xPDO::OPT_CACHE_HANDLER => $this->getOption(xPDO::OPT_CACHE_DB_HANDLER, null, $this->getOption(xPDO::OPT_CACHE_HANDLER, null, 'xPDO\\Cache\\xPDOFileCache')), - xPDO::OPT_CACHE_FORMAT => (integer) $this->getOption('cache_db_format', null, $this->getOption(xPDO::OPT_CACHE_FORMAT, null, xPDOCacheManager::CACHE_PHP)), - xPDO::OPT_CACHE_EXPIRES => (integer) $this->getOption(xPDO::OPT_CACHE_DB_EXPIRES, null, $this->getOption(xPDO::OPT_CACHE_EXPIRES, null, 0)), + xPDO::OPT_CACHE_FORMAT => (int) $this->getOption('cache_db_format', null, $this->getOption(xPDO::OPT_CACHE_FORMAT, null, xPDOCacheManager::CACHE_PHP)), + xPDO::OPT_CACHE_EXPIRES => (int) $this->getOption(xPDO::OPT_CACHE_DB_EXPIRES, null, $this->getOption(xPDO::OPT_CACHE_EXPIRES, null, 0)), xPDO::OPT_CACHE_PREFIX => $this->getOption('cache_db_prefix', null, xPDOCacheManager::CACHE_DIR) ) ); @@ -2402,7 +2402,7 @@ public function setDirty($key= '') { * the database. */ public function isNew() { - return (boolean) $this->_new; + return (bool) $this->_new; } /** @@ -2481,7 +2481,7 @@ protected function _setRaw($key, $val) { case 'int': case 'integer': case 'boolean': - $this->_fields[$key] = (integer) $val; + $this->_fields[$key] = (int) $val; $set = true; break; case 'float': @@ -2519,7 +2519,7 @@ protected function _setRaw($key, $val) { case 'datetime': case 'timestamp': if (preg_match('/int/i', $dbtype)) { - $this->_fields[$key] = (integer) $val; + $this->_fields[$key] = (int) $val; $set = true; break; } diff --git a/src/xPDO/Om/xPDOQuery.php b/src/xPDO/Om/xPDOQuery.php index 81d2e537..c4e98907 100644 --- a/src/xPDO/Om/xPDOQuery.php +++ b/src/xPDO/Om/xPDOQuery.php @@ -770,7 +770,7 @@ public function parseConditions($conditions, $conjunction = xPDOQuery::SQL_AND) } else { switch ($type) { case \PDO::PARAM_INT: - $vals[] = (integer) $v; + $vals[] = (int) $v; break; case \PDO::PARAM_STR: $vals[] = $this->xpdo->quote($v); diff --git a/src/xPDO/Transport/xPDOFileVehicle.php b/src/xPDO/Transport/xPDOFileVehicle.php index 13978359..deb5a026 100644 --- a/src/xPDO/Transport/xPDOFileVehicle.php +++ b/src/xPDO/Transport/xPDOFileVehicle.php @@ -57,7 +57,7 @@ protected function _installFiles(& $transport, $options) { $fileTargetPath = $fileTarget . $fileName; $preExistingMode = xPDOTransport::PRESERVE_PREEXISTING; if (isset ($vOptions[xPDOTransport::PREEXISTING_MODE])) { - $preExistingMode = (integer) $vOptions[xPDOTransport::PREEXISTING_MODE]; + $preExistingMode = (int) $vOptions[xPDOTransport::PREEXISTING_MODE]; } $cacheManager = $transport->xpdo->getCacheManager(); if ($this->validate($transport, $object, $vOptions)) { @@ -120,7 +120,7 @@ protected function _uninstallFiles(& $transport, $options) { $fileTarget = eval ($object['target']); $preExistingMode = xPDOTransport::PRESERVE_PREEXISTING; if (isset ($vOptions[xPDOTransport::PREEXISTING_MODE])) { - $preExistingMode = (integer) $vOptions[xPDOTransport::PREEXISTING_MODE]; + $preExistingMode = (int) $vOptions[xPDOTransport::PREEXISTING_MODE]; } $cacheManager = $transport->xpdo->getCacheManager(); $path = $fileTarget . $fileName; diff --git a/src/xPDO/Transport/xPDOObjectVehicle.php b/src/xPDO/Transport/xPDOObjectVehicle.php index b9308240..0f9bc619 100644 --- a/src/xPDO/Transport/xPDOObjectVehicle.php +++ b/src/xPDO/Transport/xPDOObjectVehicle.php @@ -60,7 +60,7 @@ public function get(& $transport, $options = array (), $element = null) { $options = array_merge($options, $element); $setKeys = false; if (isset ($options[xPDOTransport::PRESERVE_KEYS])) { - $setKeys = (boolean) $options[xPDOTransport::PRESERVE_KEYS]; + $setKeys = (bool) $options[xPDOTransport::PRESERVE_KEYS]; } $object->fromJSON($element['object'], '', $setKeys, true); } diff --git a/src/xPDO/Validation/xPDOValidator.php b/src/xPDO/Validation/xPDOValidator.php index 1bdf33ef..3eba9d52 100644 --- a/src/xPDO/Validation/xPDOValidator.php +++ b/src/xPDO/Validation/xPDOValidator.php @@ -68,7 +68,7 @@ public function validate(array $parameters = array()) { if (is_null($this->object->_fields[$column])) { $result = false; } else { - $result = (boolean)preg_match($rule['rule'], $this->object->_fields[$column]); + $result = (bool)preg_match($rule['rule'], $this->object->_fields[$column]); } if (!$result) $this->addMessage($column, $ruleName, isset($rule['parameters']['message']) ? $rule['parameters']['message'] : $ruleName . ' failed'); if ($this->object->xpdo->getDebug() === true) diff --git a/src/xPDO/xPDO.php b/src/xPDO/xPDO.php index 002c7222..6a81c254 100644 --- a/src/xPDO/xPDO.php +++ b/src/xPDO/xPDO.php @@ -910,7 +910,7 @@ public function updateCollection($className, array $set, $criteria= null) { $this->cacheManager->delete($relatedClass, array( xPDO::OPT_CACHE_KEY => $this->getOption('cache_db_key', null, 'db'), xPDO::OPT_CACHE_HANDLER => $this->getOption(xPDO::OPT_CACHE_DB_HANDLER, null, $this->getOption(xPDO::OPT_CACHE_HANDLER, null, 'xPDO\\Cache\\xPDOFileCache')), - xPDO::OPT_CACHE_FORMAT => (integer) $this->getOption('cache_db_format', null, $this->getOption(xPDO::OPT_CACHE_FORMAT, null, Cache\xPDOCacheManager::CACHE_PHP)), + xPDO::OPT_CACHE_FORMAT => (int) $this->getOption('cache_db_format', null, $this->getOption(xPDO::OPT_CACHE_FORMAT, null, Cache\xPDOCacheManager::CACHE_PHP)), xPDO::OPT_CACHE_PREFIX => $this->getOption('cache_db_prefix', null, Cache\xPDOCacheManager::CACHE_DIR), xPDO::OPT_CACHE_MULTIPLE_OBJECT_DELETE => true )); @@ -2300,7 +2300,7 @@ public function fromCache($signature, $class= '', $options= array()) { $result= $this->cacheManager->get($sig, array( xPDO::OPT_CACHE_KEY => $this->getOption('cache_db_key', $options, 'db'), xPDO::OPT_CACHE_HANDLER => $this->getOption(xPDO::OPT_CACHE_DB_HANDLER, $options, $this->getOption(xPDO::OPT_CACHE_HANDLER, $options, 'xPDO\\Cache\\xPDOFileCache')), - xPDO::OPT_CACHE_FORMAT => (integer) $this->getOption('cache_db_format', null, $this->getOption(xPDO::OPT_CACHE_FORMAT, null, Cache\xPDOCacheManager::CACHE_PHP)), + xPDO::OPT_CACHE_FORMAT => (int) $this->getOption('cache_db_format', null, $this->getOption(xPDO::OPT_CACHE_FORMAT, null, Cache\xPDOCacheManager::CACHE_PHP)), 'cache_prefix' => $this->getOption('cache_db_prefix', $options, Cache\xPDOCacheManager::CACHE_DIR), )); if ($this->getDebug() === true) { @@ -2387,8 +2387,8 @@ public function toCache($signature, $object, $lifetime= 0, $options = array()) { $removed= $this->cacheManager->delete($gClass, array_merge($options, array( xPDO::OPT_CACHE_KEY => $this->getOption('cache_db_key', $options, 'db'), xPDO::OPT_CACHE_HANDLER => $this->getOption(xPDO::OPT_CACHE_DB_HANDLER, $options, $this->getOption(xPDO::OPT_CACHE_HANDLER, $options, 'xPDO\\Cache\\xPDOFileCache')), - xPDO::OPT_CACHE_FORMAT => (integer) $this->getOption('cache_db_format', $options, $this->getOption(xPDO::OPT_CACHE_FORMAT, $options, Cache\xPDOCacheManager::CACHE_PHP)), - xPDO::OPT_CACHE_EXPIRES => (integer) $this->getOption(xPDO::OPT_CACHE_DB_EXPIRES, null, $this->getOption(xPDO::OPT_CACHE_EXPIRES, null, 0)), + xPDO::OPT_CACHE_FORMAT => (int) $this->getOption('cache_db_format', $options, $this->getOption(xPDO::OPT_CACHE_FORMAT, $options, Cache\xPDOCacheManager::CACHE_PHP)), + xPDO::OPT_CACHE_EXPIRES => (int) $this->getOption(xPDO::OPT_CACHE_DB_EXPIRES, null, $this->getOption(xPDO::OPT_CACHE_EXPIRES, null, 0)), xPDO::OPT_CACHE_PREFIX => $this->getOption('cache_db_prefix', $options, Cache\xPDOCacheManager::CACHE_DIR), xPDO::OPT_CACHE_MULTIPLE_OBJECT_DELETE => true ))); @@ -2401,8 +2401,8 @@ public function toCache($signature, $object, $lifetime= 0, $options = array()) { $cacheOptions = array_merge($options, array( xPDO::OPT_CACHE_KEY => $this->getOption('cache_db_key', $options, 'db'), xPDO::OPT_CACHE_HANDLER => $this->getOption(xPDO::OPT_CACHE_DB_HANDLER, $options, $this->getOption(xPDO::OPT_CACHE_HANDLER, $options, 'xPDO\\Cache\\xPDOFileCache')), - xPDO::OPT_CACHE_FORMAT => (integer) $this->getOption('cache_db_format', $options, $this->getOption(xPDO::OPT_CACHE_FORMAT, $options, Cache\xPDOCacheManager::CACHE_PHP)), - xPDO::OPT_CACHE_EXPIRES => (integer) $this->getOption(xPDO::OPT_CACHE_DB_EXPIRES, null, $this->getOption(xPDO::OPT_CACHE_EXPIRES, null, 0)), + xPDO::OPT_CACHE_FORMAT => (int) $this->getOption('cache_db_format', $options, $this->getOption(xPDO::OPT_CACHE_FORMAT, $options, Cache\xPDOCacheManager::CACHE_PHP)), + xPDO::OPT_CACHE_EXPIRES => (int) $this->getOption(xPDO::OPT_CACHE_DB_EXPIRES, null, $this->getOption(xPDO::OPT_CACHE_EXPIRES, null, 0)), xPDO::OPT_CACHE_PREFIX => $this->getOption('cache_db_prefix', $options, Cache\xPDOCacheManager::CACHE_DIR) )); $result= $this->cacheManager->set($sig, $object, $lifetime, $cacheOptions); @@ -2580,7 +2580,7 @@ public function quote($string, $parameter_type= \PDO::PARAM_STR) { break; case \PDO::PARAM_INT: $quoted = trim($quoted); - $quoted = (integer) trim($quoted, "'"); + $quoted = (int) trim($quoted, "'"); break; default: break; diff --git a/src/xPDO/xPDOConnection.php b/src/xPDO/xPDOConnection.php index 09287c34..4380d850 100644 --- a/src/xPDO/xPDOConnection.php +++ b/src/xPDO/xPDOConnection.php @@ -59,7 +59,7 @@ public function __construct(xPDO &$xpdo, $dsn, $username= '', $password= '', $op } $this->config['driverOptions']= $driverOptions; if (array_key_exists(xPDO::OPT_CONN_MUTABLE, $this->config)) { - $this->_mutable= (boolean) $this->config[xPDO::OPT_CONN_MUTABLE]; + $this->_mutable= (bool) $this->config[xPDO::OPT_CONN_MUTABLE]; } } diff --git a/tools/schema/upgrade-mysql-1.1.php b/tools/schema/upgrade-mysql-1.1.php index 3eb8df5c..ebf3bdf8 100644 --- a/tools/schema/upgrade-mysql-1.1.php +++ b/tools/schema/upgrade-mysql-1.1.php @@ -185,7 +185,7 @@ } error_reporting($error_reporting); -ini_set('display_errors', (boolean) $display_errors); +ini_set('display_errors', (bool) $display_errors); $xpdo->setPackage($pkg, $pkg_path); From 0d1880e3ffada9200f29d58b0b27e4b49f4cbaaa Mon Sep 17 00:00:00 2001 From: Jason Coward Date: Thu, 4 Dec 2025 11:57:56 -0700 Subject: [PATCH 2/2] Add PHP 8.5 to CI workflow --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5659f54b..243d7f25 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,7 @@ jobs: strategy: matrix: - php-version: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4'] + php-version: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5'] steps: - name: Checkout @@ -63,7 +63,7 @@ jobs: strategy: matrix: - php-version: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4'] + php-version: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5'] steps: - name: Checkout @@ -114,7 +114,7 @@ jobs: strategy: matrix: - php-version: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4'] + php-version: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5'] steps: - name: Checkout