public function extractSnippetTypeFromPath($path)
{
if (substr($path, 0, 1) !== '/') {
throw new \InvalidArgumentException(sprintf('Path must be absolute, got "%s"', $path));
}
$snippetsPath = '/' . $this->getPath('base') . '/' . $this->getPath('snippet') . '/';
$newPath = PathHelper::getParentPath($path);
$newPath = substr($newPath, strlen($snippetsPath));
if (false === $newPath) {
throw new \InvalidArgumentException(sprintf('Cannot extract snippet template type from path "%s"', $path));
}
return $newPath;
}