original_string: public function update($data)
      {
          $validator = new StringValidator();
          $validator->max = 255;
  
          foreach ($data as $key => $value) {
              if (!in_array($key, $this->readonly) && array_key_exists($key, $this->settings)) {
                  if (!$validator->validate($value)) {
                      return false;
                  }
                  if (!$this->config->set($key, $value)) {
                      return false;
                  }
              }
          }
          return true;
      }
code: public function update($data)
      {
          $validator = new StringValidator();
          $validator->max = 255;
  
          foreach ($data as $key => $value) {
              if (!in_array($key, $this->readonly) && array_key_exists($key, $this->settings)) {
                  if (!$validator->validate($value)) {
                      return false;
                  }
                  if (!$this->config->set($key, $value)) {
                      return false;
                  }
              }
          }
          return true;
      }
code_tokens: public function update ( $ data ) { $ validator = new StringValidator ( ) ; $ validator -> max = 255 ; foreach ( $ data as $ key => $ value ) { if ( ! in_array ( $ key , $ this -> readonly ) && array_key_exists ( $ key , $ this -> settings ) ) { if ( ! $ validator -> validate ( $ value ) ) { return false ; } if ( ! $ this -> config -> set ( $ key , $ value ) ) { return false ; } } } return true ; }
docstring: Updates the value of setting.
  @param string[] $data
  @return bool
docstring_tokens: Updates the value of setting .