/**
  * @inheritdoc
  */
 public function addParent(IView $parent, IView $child)
 {
     foreach ($parent->getVars() as $name => $value) {
         if (!$child->hasVar($name)) {
             $child->setVar($name, $value);
         }
     }
 }
 /**
  * @inheritdoc
  */
 public function compile(IView $view)
 {
     $obStartLevel = ob_get_level();
     ob_start();
     extract($view->getVars());
     try {
         if (eval('?>' . $view->getContents()) === false) {
             throw new ViewCompilerException("Invalid PHP in view");
         }
     } catch (Exception $ex) {
         $this->handleException($ex, $obStartLevel);
     } catch (Throwable $ex) {
         $this->handleException($ex, $obStartLevel);
     }
     return ob_get_clean();
 }