src/ExceptionHandler.php
public static function error($severity, $message, $file, $line){

		// Respect the "@" error suppression operator

		if(error_reporting() == 0) return;

		elseif(error_reporting() && $severity){

			$ErrorException = new PHPErrorException(
				$message, 0, $severity, $file, $line);

			// If we're in an assert()-chain, *immediately* terminate execution

			if(assert_options(ASSERT_ACTIVE)){

				foreach($ErrorException->getStackTrace() as $element){

					if(isset($element['function']) &&
						$element['function'] == 'assert'){

						self::exception($ErrorException);
					}
				}
			}

			$recoverable = [
				E_WARNING,
				E_NOTICE,
				E_USER_WARNING,
				E_USER_NOTICE,
				E_STRICT,
				E_DEPRECATED,
				E_USER_DEPRECATED
			];

			// Only for non-fatal errors

			if(in_array($severity, $recoverable)){

				return;
			}

			throw $ErrorException;
		}
	}
public static function error($severity, $message, $file, $line){

		// Respect the "@" error suppression operator

		if(error_reporting() == 0) return;

		elseif(error_reporting() && $severity){

			$ErrorException = new PHPErrorException(
				$message, 0, $severity, $file, $line);

			// If we're in an assert()-chain, *immediately* terminate execution

			if(assert_options(ASSERT_ACTIVE)){

				foreach($ErrorException->getStackTrace() as $element){

					if(isset($element['function']) &&
						$element['function'] == 'assert'){

						self::exception($ErrorException);
					}
				}
			}

			$recoverable = [
				E_WARNING,
				E_NOTICE,
				E_USER_WARNING,
				E_USER_NOTICE,
				E_STRICT,
				E_DEPRECATED,
				E_USER_DEPRECATED
			];

			// Only for non-fatal errors

			if(in_array($severity, $recoverable)){

				return;
			}

			throw $ErrorException;
		}
	}
Convert all PHP-errors into exceptions.

<p>When the FireLogger class exists and is enabled, this function
attempts to utilise it to log all non-fatal errors. This means that in
these cases, non-fatal errors are <strong>not</strong> converted to
Exceptions and also do not affect the original code-flow.</p>

<p>If assertions are enabled and error_handler() detect it is being
called from a <strong>within</strong> an assertion, execution is
immediately halted. Not doing so has the potential to lead to
<em>very</em> wacky behaviour.</p>

@param integer $severity
@param string $message
@param string $file
@param integer $line
@return void
@throws PHPErrorException
@see ExceptionHandler::exception()