[Debug][HttpKernel][VarDumper] Prepare for committed 7.2 changes
This commit is contained in:
parent
386e5e78b4
commit
feb2cd0c71
@ -263,7 +263,10 @@ class FlattenException extends LegacyFlattenException
|
||||
if (++$count > 1e4) {
|
||||
return array('array', '*SKIPPED over 10000 entries*');
|
||||
}
|
||||
if (is_object($value)) {
|
||||
if ($value instanceof \__PHP_Incomplete_Class) {
|
||||
// is_object() returns false on PHP<=7.1
|
||||
$result[$key] = array('incomplete-object', $this->getClassNameFromIncomplete($value));
|
||||
} elseif (is_object($value)) {
|
||||
$result[$key] = array('object', get_class($value));
|
||||
} elseif (is_array($value)) {
|
||||
if ($level > 10) {
|
||||
@ -277,9 +280,6 @@ class FlattenException extends LegacyFlattenException
|
||||
$result[$key] = array('boolean', $value);
|
||||
} elseif (is_resource($value)) {
|
||||
$result[$key] = array('resource', get_resource_type($value));
|
||||
} elseif ($value instanceof \__PHP_Incomplete_Class) {
|
||||
// Special case of object, is_object will return false
|
||||
$result[$key] = array('incomplete-object', $this->getClassNameFromIncomplete($value));
|
||||
} else {
|
||||
$result[$key] = array('string', (string) $value);
|
||||
}
|
||||
|
@ -27,6 +27,10 @@ class ValueExporter
|
||||
*/
|
||||
public function exportValue($value, $depth = 1, $deep = false)
|
||||
{
|
||||
if ($value instanceof \__PHP_Incomplete_Class) {
|
||||
return sprintf('__PHP_Incomplete_Class(%s)', $this->getClassNameFromIncomplete($value));
|
||||
}
|
||||
|
||||
if (is_object($value)) {
|
||||
if ($value instanceof \DateTime || $value instanceof \DateTimeInterface) {
|
||||
return sprintf('Object(%s) - %s', get_class($value), $value->format(\DateTime::ISO8601));
|
||||
@ -35,10 +39,6 @@ class ValueExporter
|
||||
return sprintf('Object(%s)', get_class($value));
|
||||
}
|
||||
|
||||
if ($value instanceof \__PHP_Incomplete_Class) {
|
||||
return sprintf('__PHP_Incomplete_Class(%s)', $this->getClassNameFromIncomplete($value));
|
||||
}
|
||||
|
||||
if (is_array($value)) {
|
||||
if (empty($value)) {
|
||||
return '[]';
|
||||
|
@ -39,9 +39,12 @@ class CutStub extends Stub
|
||||
|
||||
case 'resource':
|
||||
case 'unknown type':
|
||||
case 'resource (closed)':
|
||||
$this->type = self::TYPE_RESOURCE;
|
||||
$this->handle = (int) $value;
|
||||
$this->class = @get_resource_type($value);
|
||||
if ('Unknown' === $this->class = @get_resource_type($value)) {
|
||||
$this->class = 'Closed';
|
||||
}
|
||||
$this->cut = -1;
|
||||
break;
|
||||
|
||||
|
@ -183,10 +183,13 @@ class VarCloner extends AbstractCloner
|
||||
|
||||
case 'resource':
|
||||
case 'unknown type':
|
||||
case 'resource (closed)':
|
||||
if (empty($resRefs[$h = (int) $v])) {
|
||||
$stub = new Stub();
|
||||
$stub->type = Stub::TYPE_RESOURCE;
|
||||
$stub->class = $zval['resource_type'] ?: get_resource_type($v);
|
||||
if ('Unknown' === $stub->class = $zval['resource_type'] ?: @get_resource_type($v)) {
|
||||
$stub->class = 'Closed';
|
||||
}
|
||||
$stub->value = $v;
|
||||
$stub->handle = $h;
|
||||
$a = $this->castResource($stub, 0 < $i);
|
||||
|
@ -193,7 +193,7 @@ EOTXT
|
||||
|
||||
$this->assertStringMatchesFormat(
|
||||
<<<EOTXT
|
||||
Unknown resource @{$res}
|
||||
Closed resource @{$res}
|
||||
|
||||
EOTXT
|
||||
,
|
||||
|
Reference in New Issue
Block a user