src/PHPDish/Bundle/ResourceBundle/AvatarGenerator/AvatarGenerator.php
public function generate($idString, $width = 256)
    {
        $avatar = new MDAvatars($idString, $width);
        $tmpFile = sys_get_temp_dir() . '/' . md5(uniqid('avatar'));
        $avatar->Save($tmpFile, $width);
        $content = new Stream(fopen($tmpFile, 'r+'));
        $file = new File($this->namer->transformWithExtension('png'), $content);
        $this->fileManager->upload($file);
        @unlink($tmpFile);
        return $file;
    }
public function generate($idString, $width = 256)
    {
        $avatar = new MDAvatars($idString, $width);
        $tmpFile = sys_get_temp_dir() . '/' . md5(uniqid('avatar'));
        $avatar->Save($tmpFile, $width);
        $content = new Stream(fopen($tmpFile, 'r+'));
        $file = new File($this->namer->transformWithExtension('png'), $content);
        $this->fileManager->upload($file);
        @unlink($tmpFile);
        return $file;
    }
{@inheritdoc}