It seems like $role can also be of type null; however, parameter $role of Apps\Model\Admin\User\Fo...upUpdate::__construct() does only seem to accept Apps\ActiveRecord\Role, maybe add an additional type check?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the ignore-type annotation
34
$model = new FormUserGroupUpdate(/** @scrutinizer ignore-type */ $role);
Loading history...
35
if ($model->send()) { // work with post request
36
if ($model->validate()) {
37
$model->save();
38
App::$Session->getFlashBag()->add('success', __('Data was successful updated'));
39
} else {
40
App::$Session->getFlashBag()->add('error', __('Form validation is failed'));