Hi, how would I be able to fix this error? The current code is below but I’m not sure how to fix this deprecation error:
foreach ( $res as $row ) {
$user = $this->getOption( 'user' );
if ( $user ) {
$nameIsValid = User::newFromName( $user )->getId();
$name = $this->importPrefix . $user;
if ( strpos( $row->rev_user_text, $this->importPrefix ) === 0 ) {
if ( $nameIsValid !== 0 && $row->rev_user_text === $name ) {
$this->assignEdit( $name );
}
}
} else {
$user = $row->rev_user_text;
$nameIsValid = User::newFromName( str_replace( $this->importPrefix, '', $user ) );
if ( strpos( $user, $this->importPrefix ) === 0 ) {
if ( $nameIsValid && $user ) {
$this->assignEdit( $user );
}
}
}
}
}