Carew\Twig\CarewExtension::getDocumentWithPath PHP Метод

getDocumentWithPath() приватный Метод

private getDocumentWithPath ( Twig_Environment $twig, $filePath )
$twig Twig_Environment
    private function getDocumentWithPath(\Twig_Environment $twig, $filePath)
    {
        $globals = $twig->getGlobals();
        $documents = $globals['carew']->documents;
        if (!array_key_exists($filePath, $documents)) {
            throw new \InvalidArgumentException(sprintf('The document with path "%s" does not exist.', $filePath));
        }
        return $documents[$filePath];
    }