src/Manager/FileManager.php
public function generate(FilesystemAdapter $filesystemAdapter, $extension, $path = null)
    {
        $hash = sha1(time() + microtime());

        $exists = $filesystemAdapter->exists($path . '/' . $hash . '.' . $extension);

        if ($exists) {
            $this->generate($filesystemAdapter, $extension, $path);
        }

        return $hash;
    }
public function generate(FilesystemAdapter $filesystemAdapter, $extension, $path = null)
    {
        $hash = sha1(time() + microtime());

        $exists = $filesystemAdapter->exists($path . '/' . $hash . '.' . $extension);

        if ($exists) {
            $this->generate($filesystemAdapter, $extension, $path);
        }

        return $hash;
    }
public function generate ( FilesystemAdapter $ filesystemAdapter , $ extension , $ path = null ) { $ hash = sha1 ( time ( ) + microtime ( ) ) ; $ exists = $ filesystemAdapter -> exists ( $ path . '/' . $ hash . '.' . $ extension ) ; if ( $ exists ) { $ this -> generate ( $ filesystemAdapter , $ extension , $ path ) ; } return $ hash ; }
Generates unique filename

@param FilesystemAdapter $filesystemAdapter
@param string $extension File extension
@param null|string $path Directory path

@return string
Generates unique filename