Skip to content
This repository has been archived by the owner on Aug 13, 2020. It is now read-only.

Commit

Permalink
Converted closure to method
Browse files Browse the repository at this point in the history
  • Loading branch information
josephspurrier committed May 4, 2014
1 parent db83835 commit 1e6a794
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions src/SurfStack/Templating/Template_Engine.php
Original file line number Diff line number Diff line change
Expand Up @@ -857,6 +857,21 @@ protected function modifyTemplateRegex($content)
return $this->parsePlugins($content);
}

/**
* Called by isTemplateValid() to record error
* @param int $errno
* @param string $errstr
* @param string $errfile
* @param int $errline
* @return boolean
*/
protected function errorHandler($errno, $errstr, $errfile, $errline)
{
$this->error = false;

return true;
}

/**
* Determines if the template has any non-fatal problems
* @return boolean
Expand All @@ -865,10 +880,7 @@ function isTemplateValid()
{
$this->error = true;

set_error_handler(function ($errno, $errstr, $errfile, $errline) {
$this->error = false;
return true;
});
set_error_handler(array($this, 'errorHandler'));

// If the compile is not current
if (!$this->isCompileCurrent())
Expand Down

0 comments on commit 1e6a794

Please sign in to comment.