Skip to content

Commit 7284b0a

Browse files
committed
Fixes for the issues found by Magento Unit Tests for PHP 8.1 compatibility
1 parent c8ab365 commit 7284b0a

File tree

5 files changed

+5
-4
lines changed

5 files changed

+5
-4
lines changed

library/Zend/Db/Adapter/Abstract.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -928,7 +928,7 @@ public function quote($value, $type = null)
928928
public function quoteInto($text, $value, $type = null, $count = null)
929929
{
930930
if ($count === null) {
931-
return str_replace('?', $this->quote($value, $type), $text);
931+
return str_replace('?', $this->quote($value, $type) ?? '', $text);
932932
} else {
933933
return implode($this->quote($value, $type), explode('?', $text, $count + 1));
934934
}

library/Zend/Db/Select.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -817,6 +817,7 @@ protected function _join($type, $name, $cond, $cols, $schema = null)
817817
$tableName = $name;
818818
$correlationName = $this->_uniqueCorrelation($tableName);
819819
}
820+
$tableName = $tableName ?? '';
820821

821822
// Schema from table name overrides schema argument
822823
if (!is_object($tableName) && false !== strpos($tableName, '.')) {

library/Zend/Db/Statement/Pdo.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ public function _execute(array $params = null)
245245
* @return mixed Array, object, or scalar depending on fetch mode.
246246
* @throws Zend_Db_Statement_Exception
247247
*/
248-
public function fetch($style = null, $cursor = null, $offset = null)
248+
public function fetch($style = null, $cursor = PDO::FETCH_ORI_NEXT, $offset = 0)
249249
{
250250
if ($style === null) {
251251
$style = $this->_fetchMode;

library/Zend/Locale/Data.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -982,7 +982,7 @@ public static function getContent($locale, $path, $value = false)
982982
if (is_array($value)) {
983983
$val = implode('_' , $value);
984984
}
985-
$val = urlencode($val);
985+
$val = urlencode((string) $val);
986986
$id = self::_filterCacheId('Zend_LocaleC_' . $locale . '_' . $path . '_' . $val);
987987
if (!self::$_cacheDisabled && ($result = self::$_cache->load($id))) {
988988
return unserialize($result);

library/Zend/Oauth/Http/Utility.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ public function generateTimestamp()
210210
*/
211211
public static function urlEncode($value)
212212
{
213-
$encoded = rawurlencode($value);
213+
$encoded = rawurlencode((string) $value);
214214
$encoded = str_replace('%7E', '~', $encoded);
215215
return $encoded;
216216
}

0 commit comments

Comments
 (0)