Closed
Description
While the user doesn't delete the session data or clear cache of the browser, this exception occurrs when I access to panel profile > "Request/Response" > tab "Session" > "Session Attributes" and exists a serialized object (in session) whose class doesn't exist. Here has threw the exception:
//Symfony\Component\HttpKernel\DataCollector\Util\ValueExporter.php line #76
return (string) $value; //instance of __PHP_Incomplete_Class
Since in these cases is_object
will return false
, I propose to add the following code to avoid the exception and display a readable value to the user:
// Special case of object
if ($value instanceof \__PHP_Incomplete_Class) {
$array = new \ArrayObject($value);
return sprintf('__PHP_Incomplete_Class(%s)', $array['__PHP_Incomplete_Class_Name']);
}
Result:
Session Attributes
Attribute | Value |
---|---|
name | __PHP_Incomplete_Class(AppBundle\Model\DeletedClass) |
If they agree, I can create a PR to fix it.