original_string: public function deleteFromDisk($file)
      {
          if (!is_array($file)) {
              $file = $this->get($file);
          }
  
          $result = null;
          $this->hook->attach('file.delete.disk.before', $file, $result, $this);
  
          if (isset($result)) {
              return (bool) $result;
          }
  
          if (empty($file['path'])) {
              return false;
          }
  
          $path = gplcart_file_absolute($file['path']);
  
          if (!is_file($path)) {
              return false;
          }
  
          $result = unlink($path);
          $this->hook->attach('file.delete.disk.after', $file, $result, $this);
          return $result;
      }
code: public function deleteFromDisk($file)
      {
          if (!is_array($file)) {
              $file = $this->get($file);
          }
  
          $result = null;
          $this->hook->attach('file.delete.disk.before', $file, $result, $this);
  
          if (isset($result)) {
              return (bool) $result;
          }
  
          if (empty($file['path'])) {
              return false;
          }
  
          $path = gplcart_file_absolute($file['path']);
  
          if (!is_file($path)) {
              return false;
          }
  
          $result = unlink($path);
          $this->hook->attach('file.delete.disk.after', $file, $result, $this);
          return $result;
      }
code_tokens: public function deleteFromDisk ( $ file ) { if ( ! is_array ( $ file ) ) { $ file = $ this -> get ( $ file ) ; } $ result = null ; $ this -> hook -> attach ( 'file.delete.disk.before' , $ file , $ result , $ this ) ; if ( isset ( $ result ) ) { return ( bool ) $ result ; } if ( empty ( $ file [ 'path' ] ) ) { return false ; } $ path = gplcart_file_absolute ( $ file [ 'path' ] ) ; if ( ! is_file ( $ path ) ) { return false ; } $ result = unlink ( $ path ) ; $ this -> hook -> attach ( 'file.delete.disk.after' , $ file , $ result , $ this ) ; return $ result ; }
docstring: Deletes a file from disk
  @param array|int $file
  @return boolean
docstring_tokens: Deletes a file from disk