* @license MIT */ class FileLocator implements FileLocatorInterface { /** * @var string */ protected $proxiesDirectory; /** * @param string $proxiesDirectory * * @throws \ProxyManager\Exception\InvalidProxyDirectoryException */ public function __construct($proxiesDirectory) { $this->proxiesDirectory = realpath($proxiesDirectory); if (false === $this->proxiesDirectory) { throw InvalidProxyDirectoryException::proxyDirectoryNotFound($proxiesDirectory); } } /** * {@inheritDoc} */ public function getProxyFileName($className) { return $this->proxiesDirectory . DIRECTORY_SEPARATOR . str_replace('\\', '', $className) . '.php'; } }