original_string: public function updatePreferences(string $key, $data)
      {
          $current = $this->preferences;
  
          $this->preferences = PreferencesParser::parse($current)->update($key, $data)->toJson();
  
          $this->save();
      }
code: public function updatePreferences(string $key, $data)
      {
          $current = $this->preferences;
  
          $this->preferences = PreferencesParser::parse($current)->update($key, $data)->toJson();
  
          $this->save();
      }
code_tokens: public function updatePreferences ( string $ key , $ data ) { $ current = $ this -> preferences ; $ this -> preferences = PreferencesParser :: parse ( $ current ) -> update ( $ key , $ data ) -> toJson ( ) ; $ this -> save ( ) ; }
docstring: Updates the user's preferences for the given key.
  
  @param  string $key
  @param  mixed $data
  
  @return void
docstring_tokens: Updates the user s preferences for the given key .