It seems like $record can also be of type null; however, parameter $record of Apps\Model\Admin\Profile...ldUpdate::__construct() does only seem to accept Apps\ActiveRecord\ProfileField, 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
32
$model = new FormFieldUpdate(/** @scrutinizer ignore-type */ $record);
Loading history...
33
34
// check if form is submitted
35
if ($model->send() && $model->validate()) {
36
$model->save();
37
if ($record->id) {
38
$this->response->redirect('profile/fieldlist');
39
}
40
App::$Session->getFlashBag()->add('success', __('Profile field was successful updated'));