protected function getDropboxName(File $file, $hash) { return sprintf('/%s/%s.%s', basename(dirname($file->getPathname())), $hash, $file->getExtension()); }
public function testGetExtension() { $this->file = new File('test.ext'); $ext = $this->file->getExtension(); $this->assertEquals('ext', $ext); }
/** * @param \Diamante\DeskBundle\Model\Attachment\File $file * @return bool */ protected function isImage(File $file) { $ext = strtolower($file->getExtension()); return in_array($ext, ['jpg', 'jpeg', 'png', 'gif', 'bmp']); }