mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-02 21:41:19 +08:00
Fix #20548: Fix PHP 8.5 null array offset deprecation warnings
This commit is contained in:
@ -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