|
@@ 100-102 (lines=3) @@
|
| 97 |
|
*/ |
| 98 |
|
public static function toErrorException($callback, $types = null) |
| 99 |
|
{ |
| 100 |
|
if (!is_callable($callback)) { |
| 101 |
|
throw new \InvalidArgumentException(get_called_class() . '::' . __METHOD__ . '() expects parameter 1 to be callable, ' . gettype($callback) . ' given'); |
| 102 |
|
} |
| 103 |
|
if ($types !== null && !is_numeric($types)) { |
| 104 |
|
throw new \InvalidArgumentException(get_called_class() . '::' . __METHOD__ . '() expects parameter 2 to be integer, ' . gettype($types) . ' given'); |
| 105 |
|
} |
|
@@ 103-105 (lines=3) @@
|
| 100 |
|
if (!is_callable($callback)) { |
| 101 |
|
throw new \InvalidArgumentException(get_called_class() . '::' . __METHOD__ . '() expects parameter 1 to be callable, ' . gettype($callback) . ' given'); |
| 102 |
|
} |
| 103 |
|
if ($types !== null && !is_numeric($types)) { |
| 104 |
|
throw new \InvalidArgumentException(get_called_class() . '::' . __METHOD__ . '() expects parameter 2 to be integer, ' . gettype($types) . ' given'); |
| 105 |
|
} |
| 106 |
|
|
| 107 |
|
return Core::handle($callback, function ($severity, $message, $file, $line) { |
| 108 |
|
if (!(error_reporting() & $severity)) { |
|
@@ 123-125 (lines=3) @@
|
| 120 |
|
*/ |
| 121 |
|
public static function silent($callback, $types = null, $captureExceptions = true) |
| 122 |
|
{ |
| 123 |
|
if (!is_callable($callback)) { |
| 124 |
|
throw new \InvalidArgumentException(get_called_class() . '::' . __METHOD__ . '() expects parameter 1 to be callable, ' . gettype($callback) . ' given'); |
| 125 |
|
} |
| 126 |
|
if ($types !== null && !is_numeric($types)) { |
| 127 |
|
throw new \InvalidArgumentException(get_called_class() . '::' . __METHOD__ . '() expects parameter 2 to be integer, ' . gettype($types) . ' given'); |
| 128 |
|
} |
|
@@ 126-128 (lines=3) @@
|
| 123 |
|
if (!is_callable($callback)) { |
| 124 |
|
throw new \InvalidArgumentException(get_called_class() . '::' . __METHOD__ . '() expects parameter 1 to be callable, ' . gettype($callback) . ' given'); |
| 125 |
|
} |
| 126 |
|
if ($types !== null && !is_numeric($types)) { |
| 127 |
|
throw new \InvalidArgumentException(get_called_class() . '::' . __METHOD__ . '() expects parameter 2 to be integer, ' . gettype($types) . ' given'); |
| 128 |
|
} |
| 129 |
|
|
| 130 |
|
$dummyException = new \Exception; |
| 131 |
|
try { |