This commit is contained in:
Olusesan Ameye
2022-10-02 00:26:03 +00:00
parent f8b7061089
commit b4604e02b5
17 changed files with 69 additions and 44 deletions
+6
View File
@@ -30,6 +30,7 @@ use Kint\Zval\Representation\Representation;
use Kint\Zval\Value;
use ReflectionClass;
use ReflectionProperty;
use UnitEnum;
class ClassStaticsPlugin extends Plugin
{
@@ -56,6 +57,11 @@ class ClassStaticsPlugin extends Plugin
$consts = [];
foreach ($reflection->getConstants() as $name => $val) {
// Skip enum constants
if ($var instanceof UnitEnum && $val instanceof UnitEnum && $o->classname == \get_class($val)) {
continue;
}
$const = Value::blank($name, '\\'.$class.'::'.$name);
$const->const = true;
$const->depth = $o->depth + 1;
+11 -2
View File
@@ -34,6 +34,7 @@ use Kint\Zval\ResourceValue;
use Kint\Zval\Value;
use ReflectionObject;
use stdClass;
use TypeError;
class Parser
{
@@ -191,6 +192,10 @@ class Parser
public function childHasPath(InstanceValue $parent, Value $child)
{
if ('__PHP_Incomplete_Class' === $parent->classname) {
return false;
}
if ('object' === $parent->type && (null !== $parent->access_path || $child->static || $child->const)) {
if (Value::ACCESS_PUBLIC === $child->access) {
return true;
@@ -434,7 +439,7 @@ class Parser
$rep = new Representation('Properties');
if (KINT_PHP74) {
if (KINT_PHP74 && '__PHP_Incomplete_Class' != $object->classname) {
$rprops = $reflector->getProperties();
foreach ($rprops as $rprop) {
@@ -524,7 +529,11 @@ class Parser
}
$stash = $val;
$copy[$i] = $refmarker;
try {
$copy[$i] = $refmarker;
} catch (TypeError $e) {
$child->reference = true;
}
if ($val === $refmarker) {
$child->reference = true;
$val = $stash;
+4
View File
@@ -52,6 +52,10 @@ class TimestampPlugin extends Plugin
return;
}
if ($var < 0) {
return;
}
if (\in_array($var, self::$blacklist, true)) {
return;
}