mirror of
https://github.com/yiisoft/yii2.git
synced 2025-10-27 20:06:19 +08:00
Fix #20548: Fix PHP 8.5 null array offset deprecation warnings
This commit is contained in:
@ -37,6 +37,7 @@ Yii Framework 2 Change Log
|
||||
- Bug #19655: Fix `LinkPager::getPageRange` when `maxButtons` is 2 (max-s-lab)
|
||||
- Enh #20539: Update minimum PHP version requirement from `7.3` to `7.4` (terabytesoftw)
|
||||
- Bug #20541: Remove deprecated caching components: `XCache` and `ZendDataCache`, and update related tests and documentation (terabytesoftw)
|
||||
- Bug #20548: Fix PHP `8.5` `null` array offset deprecation warnings (terabytesoftw)
|
||||
- Enh #19526: Add the `convertIniSizeToBytes` method to `BaseStringHelper` (max-s-lab)
|
||||
|
||||
|
||||
|
||||
@ -835,7 +835,8 @@ abstract class BaseActiveRecord extends Model implements ActiveRecordInterface
|
||||
throw new StaleObjectException('The object being updated is outdated.');
|
||||
}
|
||||
|
||||
if (isset($values[$lock])) {
|
||||
// using null as an array offset is deprecated in PHP `8.5`
|
||||
if ($lock !== null && isset($values[$lock])) {
|
||||
$this->$lock = $values[$lock];
|
||||
}
|
||||
|
||||
|
||||
@ -112,7 +112,12 @@ class PhpManager extends BaseManager
|
||||
*/
|
||||
public function getAssignments($userId)
|
||||
{
|
||||
return isset($this->assignments[$userId]) ? $this->assignments[$userId] : [];
|
||||
// using null as an array offset is deprecated in PHP `8.5`
|
||||
if ($userId !== null && isset($this->assignments[$userId])) {
|
||||
return $this->assignments[$userId];
|
||||
}
|
||||
|
||||
return [];
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user