Permalink
Browse files

Debugger::$strictMode can determine severity of strictness

  • Loading branch information...
1 parent f38d86f commit 07a7493562d7895d83028e317cfe85079858d15b @juzna committed Sep 13, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 Nette/Diagnostics/Debugger.php
@@ -65,7 +65,7 @@
/** @var BlueScreen */
public static $blueScreen;
- /** @var bool determines whether any error will cause immediate death */
+ /** @var bool|int determines whether any error will cause immediate death; if integer that it's matched against error severity */
public static $strictMode = FALSE; // $immediateDeath
/** @var bool disables the @ (shut-up) operator so that notices and warnings are no longer hidden */
@@ -467,7 +467,7 @@ public static function _errorHandler($severity, $message, $file, $line, $context
} elseif (($severity & error_reporting()) !== $severity) {
return FALSE; // calls normal error handler to fill-in error_get_last()
- } elseif (self::$strictMode && !self::$productionMode) {
+ } elseif (!self::$productionMode && (is_bool(self::$strictMode) ? self::$strictMode : ((self::$strictMode & $severity) === $severity))) {
self::_exceptionHandler(new Nette\FatalErrorException($message, 0, $severity, $file, $line, $context));
}

2 comments on commit 07a7493

"if integer that it's matched" doesn't make sense to me. It rather should be: "if an integer is set then the value is matched"...

Owner

juzna replied Oct 4, 2011

sure, it's a typo, sorry for that

Please sign in to comment.