You are here

public function Twig_Extension_Sandbox::ensureToStringAllowed in Translation template extractor 6.3

Same name and namespace in other branches
  1. 7.3 vendor/Twig/Extension/Sandbox.php \Twig_Extension_Sandbox::ensureToStringAllowed()

File

vendor/Twig/Extension/Sandbox.php, line 94

Class

Twig_Extension_Sandbox

Code

public function ensureToStringAllowed($obj) {
  if ($this
    ->isSandboxed() && is_object($obj)) {
    $this->policy
      ->checkMethodAllowed($obj, '__toString');
  }
  return $obj;
}