public changePath ( string $path ) : |
||
$path | string | |
return |
public function changePath($path)
{
$pathname = $this->createPathname($path, $this->getBasename(), $this->getExtension());
return new static($pathname);
}
/** * {@inheritdoc} */ public function provideName(FileInfo $srcFileInfo) { $datetime = \DateTime::createFromFormat('U.u', microtime(true)); $pathSuffix = FileInfo::purifyPath($datetime->format($this->dirFormat)); $dstFileInfo = $srcFileInfo->changePath($srcFileInfo->getPath() . FileInfo::SEPARATOR_DIRECTORY . $pathSuffix)->changeBasename($datetime->format($this->fileFormat)); return $dstFileInfo; }