public function getByPath($path, array $accessors = [])
{
$propertyPathSegments = explode('.', $path);
$subject = $this->variables;
foreach ($propertyPathSegments as $propertyName) {
if ($subject === null) {
break;
}
try {
$subject = ObjectAccess::getProperty($subject, $propertyName);
} catch (PropertyNotAccessibleException $exception) {
$subject = null;
}
if ($subject instanceof TemplateObjectAccessInterface) {
$subject = $subject->objectAccess();
}
}
if ($subject === null) {
$subject = $this->getBooleanValue($path);
}
return $subject;
}