Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[Debug][HttpKernel][VarDumper] Prepare for committed 7.2 changes (aka "small-bc-breaks") #19702

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 23, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
[Debug][HttpKernel][VarDumper] Prepare for committed 7.2 changes
  • Loading branch information
nicolas-grekas committed Aug 22, 2016
commit feb2cd0c71fab766052b45f5f46fd10daed9c3fb
8 changes: 4 additions & 4 deletions 8 src/Symfony/Component/Debug/Exception/FlattenException.php
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,10 @@ private function flattenArgs($args, $level = 0, &$count = 0)
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) {
Expand All @@ -277,9 +280,6 @@ private function flattenArgs($args, $level = 0, &$count = 0)
$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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand All @@ -35,10 +39,6 @@ public function exportValue($value, $depth = 1, $deep = false)
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 '[]';
Expand Down
5 changes: 4 additions & 1 deletion 5 src/Symfony/Component/VarDumper/Caster/CutStub.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,12 @@ public function __construct($value)

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;

Expand Down
5 changes: 4 additions & 1 deletion 5 src/Symfony/Component/VarDumper/Cloner/VarCloner.php
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,13 @@ protected function doClone($var)

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);
Expand Down
2 changes: 1 addition & 1 deletion 2 src/Symfony/Component/VarDumper/Tests/CliDumperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ public function testClosedResource()

$this->assertStringMatchesFormat(
<<<EOTXT
Unknown resource @{$res}
Closed resource @{$res}

EOTXT
,
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.