<?php

namespace App\VichUploader\Namer\Epage;

use App\Entity\OnBoaringEpage;
use Symfony\Component\HttpFoundation\File\UploadedFile;
use Symfony\Component\Uid\Uuid;
use Vich\UploaderBundle\Mapping\PropertyMapping;
use Vich\UploaderBundle\Naming\NamerInterface;
use Vich\UploaderBundle\Templating\Helper\UploaderHelper;

class AvatarNamer implements NamerInterface
{

    public function name(object $object, PropertyMapping $mapping): string
    {
        $file = $mapping->getFile($object);
        $extension = pathinfo($file->getClientOriginalName(), PATHINFO_EXTENSION);
        return "avatar.".$extension;
    }
}
