We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b057013 commit c280e48Copy full SHA for c280e48
src/functions.php
@@ -3,6 +3,7 @@
3
namespace WyriHaximus;
4
5
use Exception;
6
+use ReflectionClass;
7
use ReflectionProperty;
8
use Throwable;
9
@@ -58,6 +59,10 @@ function throwable_decode($json)
58
59
60
$throwable = new $json['class']();
61
foreach ($properties as $key) {
62
+ if (!(new ReflectionClass($json['class']))->hasProperty($key)) {
63
+ continue;
64
+ }
65
+
66
$property = new ReflectionProperty($json['class'], $key);
67
$property->setAccessible(true);
68
$property->setValue($throwable, $json[$key]);
0 commit comments