Permalink
Browse files

Throwable replaces Exception

  • Loading branch information...
dg committed Mar 21, 2018
1 parent 81dac58 commit e6366004afcfb10d31e002c7a6eab2785a206e55
Showing with 6 additions and 7 deletions.
  1. +3 βˆ’4 src/Framework/Assert.php
  2. +2 βˆ’2 src/Framework/Dumper.php
  3. +1 βˆ’1 src/Framework/Environment.php
@@ -283,15 +283,14 @@ public static function type($type, $value, $description = null)
* @param string class
* @param string message
* @param int code
* @return \Exception|\Throwable
* @return \Throwable
*/
public static function exception(callable $function, $class, $message = null, $code = null)
{
self::$counter++;
$e = null;
try {
call_user_func($function);
} catch (\Exception $e) {
} catch (\Throwable $e) {
}
if ($e === null) {
@@ -312,7 +311,7 @@ public static function exception(callable $function, $class, $message = null, $c
/**
* Checks if the function throws exception, alias for exception().
* @return \Exception|\Throwable
* @return \Throwable
*/
public static function throws(callable $function, $class, $message = null, $code = null)
{
@@ -325,7 +324,7 @@ public static function throws(callable $function, $class, $message = null, $code
* @param callable
* @param int|string|array
* @param string message
* @return null|\Exception|\Throwable
* @return null|\Throwable
*/
public static function error(callable $function, $expectedType, $expectedMessage = null)
{
@@ -75,7 +75,7 @@ public static function toLine($var)
}
return "[$out]";
} elseif ($var instanceof \Exception || $var instanceof \Throwable) {
} elseif ($var instanceof \Throwable) {
return 'Exception ' . get_class($var) . ': ' . ($var->getCode() ? '#' . $var->getCode() . ' ' : '') . $var->getMessage();
} elseif (is_object($var)) {
@@ -247,7 +247,7 @@ private static function _toPhp(&$var, &$list = [], $level = 0, &$line = 1)
/**
* @param \Exception|\Throwable
* @param \Throwable
* @internal
*/
public static function dumpException($e)
@@ -120,7 +120,7 @@ public static function setupErrors()
/**
* @param \Exception|\Throwable
* @param \Throwable
* @internal
*/
public static function handleException($e)

0 comments on commit e636600

Please sign in to comment.