for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types = 1);
namespace Liip\ImagineBundle\Imagine\Cache\Helper;
/**
* @author Dmitrijs Balabka <[email protected]>
*/
class PathHelper
{
public static function filePathToUrlPath(string $path): string
return implode('/', array_map('rawurlencode', explode('/', $path)));
}
public static function urlPathToFilePath(string $url): string
// used urldecode instead of rawurlencode for BC safety to support "+" in URL
return urldecode($url);