original_string: public function writeCallback($connection, $string)
      {
          $this->content .= $string;
  
          if (!$this->mime) {
              $this->mime = finfo_buffer($this->finfo, $this->content);
  
              if (!in_array($this->mime, static::$mimetypes, true)) {
                  $this->mime = null;
  
                  return -1;
              }
          }
  
          if (!($info = getimagesizefromstring($this->content))) {
              return strlen($string);
          }
  
          $this->info = [
              'width' => $info[0],
              'height' => $info[1],
              'size' => $info[0] * $info[1],
              'mime' => $this->mime,
          ];
  
          return -1;
      }
code: public function writeCallback($connection, $string)
      {
          $this->content .= $string;
  
          if (!$this->mime) {
              $this->mime = finfo_buffer($this->finfo, $this->content);
  
              if (!in_array($this->mime, static::$mimetypes, true)) {
                  $this->mime = null;
  
                  return -1;
              }
          }
  
          if (!($info = getimagesizefromstring($this->content))) {
              return strlen($string);
          }
  
          $this->info = [
              'width' => $info[0],
              'height' => $info[1],
              'size' => $info[0] * $info[1],
              'mime' => $this->mime,
          ];
  
          return -1;
      }
code_tokens: public function writeCallback ( $ connection , $ string ) { $ this -> content .= $ string ; if ( ! $ this -> mime ) { $ this -> mime = finfo_buffer ( $ this -> finfo , $ this -> content ) ; if ( ! in_array ( $ this -> mime , static :: $ mimetypes , true ) ) { $ this -> mime = null ; return - 1 ; } } if ( ! ( $ info = getimagesizefromstring ( $ this -> content ) ) ) { return strlen ( $ string ) ; } $ this -> info = [ 'width' => $ info [ 0 ] , 'height' => $ info [ 1 ] , 'size' => $ info [ 0 ] * $ info [ 1 ] , 'mime' => $ this -> mime , ] ; return - 1 ; }
docstring: Callback used to save the first bytes of the body content
  
  @param resource $connection
  @param string   $string
  
  return integer
docstring_tokens: Callback used to save the first bytes of the body content