original_string: public static function write($file_path = null, $content, $type = 'a', $force = false, array &$logs = array())
      {
          if (is_null($file_path)) {
              return null;
          }
          if (!file_exists($file_path)) {
              if (true===$force) {
                  self::touch($file_path, $logs);
              } else {
                  $logs[] = sprintf('File path "%s" to copy was not found.', $file_path);
                  return false;
              }
          }
          if (is_writable($file_path)) {
              $h = fopen($file_path, $type);
              if (false !== fwrite($h, $content)) {
                  fclose($h);
                  return true;
              }
          }
          $logs[] = sprintf('Can not write in file "%s".', $file_path);
          return false;
      }
code: public static function write($file_path = null, $content, $type = 'a', $force = false, array &$logs = array())
      {
          if (is_null($file_path)) {
              return null;
          }
          if (!file_exists($file_path)) {
              if (true===$force) {
                  self::touch($file_path, $logs);
              } else {
                  $logs[] = sprintf('File path "%s" to copy was not found.', $file_path);
                  return false;
              }
          }
          if (is_writable($file_path)) {
              $h = fopen($file_path, $type);
              if (false !== fwrite($h, $content)) {
                  fclose($h);
                  return true;
              }
          }
          $logs[] = sprintf('Can not write in file "%s".', $file_path);
          return false;
      }
code_tokens: public static function write ( $ file_path = null , $ content , $ type = 'a' , $ force = false , array & $ logs = array ( ) ) { if ( is_null ( $ file_path ) ) { return null ; } if ( ! file_exists ( $ file_path ) ) { if ( true === $ force ) { self :: touch ( $ file_path , $ logs ) ; } else { $ logs [ ] = sprintf ( 'File path "%s" to copy was not found.' , $ file_path ) ; return false ; } } if ( is_writable ( $ file_path ) ) { $ h = fopen ( $ file_path , $ type ) ; if ( false !== fwrite ( $ h , $ content ) ) { fclose ( $ h ) ; return true ; } } $ logs [ ] = sprintf ( 'Can not write in file "%s".' , $ file_path ) ; return false ; }
docstring: Write a content in a file
  
  @param   string  $file_path
  @param   string  $content
  @param   string  $type
  @param   bool    $force
  @param   array   $logs
  @return  bool
docstring_tokens: Write a content in a file