original_string: public function write_setting($data) {
          // Try to remove duplicates before storing the contexts (to avoid problems in sync_users()).
          $data = explode(';', $data);
          $data = array_map(function($x) {
              return core_text::strtolower(trim($x));
          }, $data);
          $data = implode(';', array_unique($data));
          return parent::write_setting($data);
      }
code: public function write_setting($data) {
          // Try to remove duplicates before storing the contexts (to avoid problems in sync_users()).
          $data = explode(';', $data);
          $data = array_map(function($x) {
              return core_text::strtolower(trim($x));
          }, $data);
          $data = implode(';', array_unique($data));
          return parent::write_setting($data);
      }
code_tokens: public function write_setting ( $ data ) { // Try to remove duplicates before storing the contexts (to avoid problems in sync_users()). $ data = explode ( ';' , $ data ) ; $ data = array_map ( function ( $ x ) { return core_text :: strtolower ( trim ( $ x ) ) ; } , $ data ) ; $ data = implode ( ';' , array_unique ( $ data ) ) ; return parent :: write_setting ( $ data ) ; }
docstring: We need to remove duplicates on save to prevent issues in other areas of Moodle.
  
  @param string $data Form data.
  @return string Empty when no errors.
docstring_tokens: We need to remove duplicates on save to prevent issues in other areas of Moodle .