original_string: public function addFile(string $filename, string $field, array $crop = null): bool
      {
          if (!file_exists($filename)) {
              throw new \RuntimeException("File not found: {$filename}");
          }
  
          // Prepare upload data for later save
          $data = [
              'name' => basename($filename),
              'type' => Utils::getMimeByLocalFile($filename),
              'size' => filesize($filename),
          ];
  
          $this->addFileInternal($field, $data['name'], $data, $crop);
  
          return true;
      }
code: public function addFile(string $filename, string $field, array $crop = null): bool
      {
          if (!file_exists($filename)) {
              throw new \RuntimeException("File not found: {$filename}");
          }
  
          // Prepare upload data for later save
          $data = [
              'name' => basename($filename),
              'type' => Utils::getMimeByLocalFile($filename),
              'size' => filesize($filename),
          ];
  
          $this->addFileInternal($field, $data['name'], $data, $crop);
  
          return true;
      }
code_tokens: public function addFile ( string $ filename , string $ field , array $ crop = null ) : bool { if ( ! file_exists ( $ filename ) ) { throw new \ RuntimeException ( "File not found: {$filename}" ) ; } // Prepare upload data for later save $ data = [ 'name' => basename ( $ filename ) , 'type' => Utils :: getMimeByLocalFile ( $ filename ) , 'size' => filesize ( $ filename ) , ] ; $ this -> addFileInternal ( $ field , $ data [ 'name' ] , $ data , $ crop ) ; return true ; }
docstring: Add existing file to the form flash.
  
  @param string $filename
  @param string $field
  @param array $crop
  @return bool
docstring_tokens: Add existing file to the form flash .