Why does my $instance within a custom widget return empty (undefined index)?

Shouldn’t “function widget( $args, $instance )” be “public function widget( $args, $instance )”? Reference: WPBeginner

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)