original_string: public function set($key, $value, $linebreak = false)
      {
          $oldValue = $this->get($key);
  
          if (! preg_match('/\d/', $value) || preg_match('/=/', $value)) {
              $value = "\"$value\"";
          }
  
          $new = $linebreak ? "\n$key=$value" : "$key=$value";
  
          if (! is_null($oldValue)) {
              return $this->replaceInFile("$key=$oldValue", $new);
          }
  
          file_put_contents($this->getPath(), "\n$new", FILE_APPEND);
  
          return $this;
      }
code: public function set($key, $value, $linebreak = false)
      {
          $oldValue = $this->get($key);
  
          if (! preg_match('/\d/', $value) || preg_match('/=/', $value)) {
              $value = "\"$value\"";
          }
  
          $new = $linebreak ? "\n$key=$value" : "$key=$value";
  
          if (! is_null($oldValue)) {
              return $this->replaceInFile("$key=$oldValue", $new);
          }
  
          file_put_contents($this->getPath(), "\n$new", FILE_APPEND);
  
          return $this;
      }
code_tokens: public function set ( $ key , $ value , $ linebreak = false ) { $ oldValue = $ this -> get ( $ key ) ; if ( ! preg_match ( '/\d/' , $ value ) || preg_match ( '/=/' , $ value ) ) { $ value = "\"$value\"" ; } $ new = $ linebreak ? "\n$key=$value" : "$key=$value" ; if ( ! is_null ( $ oldValue ) ) { return $ this -> replaceInFile ( "$key=$oldValue" , $ new ) ; } file_put_contents ( $ this -> getPath ( ) , "\n$new" , FILE_APPEND ) ; return $ this ; }
docstring: Set the value of the given key to the value supplied.
  
  @param string $key
  @param string $value
  @param bool   $linebreak
  
  @return \Sven\FlexEnv\Env
docstring_tokens: Set the value of the given key to the value supplied .