function AbstractCloner::castResource
Casts a resource to an array representation.
Parameters
bool $isNested True if the object is nested in the dumped structure:
1 call to AbstractCloner::castResource()
- VarCloner::doClone in vendor/
symfony/ var-dumper/ Cloner/ VarCloner.php - Effectively clones the PHP variable.
File
-
vendor/
symfony/ var-dumper/ Cloner/ AbstractCloner.php, line 388
Class
- AbstractCloner
- AbstractCloner implements a generic caster mechanism for objects and resources.
Namespace
Symfony\Component\VarDumper\ClonerCode
protected function castResource(Stub $stub, bool $isNested) : array {
$a = [];
$res = $stub->value;
$type = $stub->class;
try {
if (!empty($this->casters[':' . $type])) {
foreach ($this->casters[':' . $type] as $callback) {
$a = $callback($res, $a, $stub, $isNested, $this->filter);
}
}
} catch (\Exception $e) {
$a = [
(Stub::TYPE_OBJECT === $stub->type ? Caster::PREFIX_VIRTUAL : '') . '⚠' => new ThrowingCasterException($e),
] + $a;
}
return $a;
}