FileNamingResolver\FileInfo::purifyPath PHP Method

purifyPath() public static method

public static purifyPath ( string $path ) : string
$path string
return string
    public static function purifyPath($path)
    {
        $path = (string) $path;
        $path = trim($path);
        $path = rtrim($path, '\\/');
        return $path;
    }

Usage Example

 /**
  * {@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;
 }
All Usage Examples Of FileNamingResolver\FileInfo::purifyPath